First, install XAMPP.
Access the following site. https://www.apachefriends.org/jp/index.html
Click XAMPP for Linux. ⇒ The XAMPP installer "xampp-linux-x64-7.4.8-0-installer.run" will be downloaded.
Launch the installer. (By default, it will be installed in / opt / lampp.)
$ sudo ./xampp-linux-x64-7.4.8-0-installer.run
[sudo] ubuntu password: ---------------------------------------------------------------------------- Welcome to the XAMPP Setup Wizard.
----------------------------------------------------------------------------
Select the components you want to install; clear the components you do not want
to install. Click Next when you are ready to continue.
XAMPP Core Files: Y (Cannot be edited) ★ Press the "y" key.
XAMPP Developer Files [Y / n]: y ★ Press the "y" key.
Is the selection above correct? [Y / n]: y ★ Press the "y" key.
----------------------------------------------------------------------------
Installation Directory
XAMPP will be installed to /opt/lampp
Press [Enter] to continue: ★ Press the "Enter" key.
----------------------------------------------------------------------------
Setup is now ready to begin installing XAMPP on your computer.
Do you want to continue? [Y / n]: y ★ Press the "y" key.
----------------------------------------------------------------------------
Please wait while Setup installs XAMPP on your computer.
Installing
0% ______________ 50% ______________ 100%
#########################################
----------------------------------------------------------------------------
Setup has finished installing XAMPP on your computer.
~~~
Make sure it is installed in / opt / lampp.
$ ls /opt/lampp/
README-wsrep ctlscript.sh info manager-linux-x64.run properties.ini
README.md docs lampp manual sbin
RELEASENOTES error lib modules share
THIRDPARTY etc lib64 mysql temp
apache2 htdocs libexec pear uninstall
bin icons licenses php uninstall.dat
build img logs phpmyadmin var
cgi-bin include man proftpd xampp
Install the tools needed to run XAMPP.
$ sudo apt-get install net-tools
Next, configure phpMyAdmin settings.
Set it so that it can be accessed from other machines.
$ sudo nano /opt/lampp/etc/extra/httpd-xampp.conf
【Change before】 <Directory "/opt/lampp/phpmyadmin"> AllowOverride AuthConfig Limit Require local ★ Before change ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var ~~~
~~~
[After change] <Directory "/opt/lampp/phpmyadmin"> AllowOverride AuthConfig Limit Require all granted ★ After change ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var ~~~
Start phpMyAdmin.
If you have Apache, MySQL, or ProFTPD running, you need to stop it.
[Example] For Apache $ sudo systemctl stop apache2 ~~~
Start XAMPP. (If you get an error saying "already running", it may work after rebooting.)
$ sudo /opt/lampp/lampp start
$ sudo /opt/lampp/lampp restart
Start your browser and access the following URL to open "phpMyAdmin". http://{UbuntuのIPアドレス}/phpmyadmin/
Stop XAMPP.
$ sudo /opt/lampp/lampp stop
Set the password to access the database.
Open the User Accounts tab in phpMyAdmin.
Press the "Change Password" button in phpMyAdmin, change the password and press the "Run" button.
Open the phpMyAdmin configuration file (config.inc.php) and enter the password you set in the ★ section below.
$ sudo nano /opt/lampp/phpmyadmin/config.inc.php
/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$ cfg ['Servers'] [$ i] ['password'] ='****'; ★ Enter the password you set.
Create a database.
Open the Import tab in phpMyAdmin.
Click the "Browse" button on the right side of the upload field, select the following SQL file, and click the "Execute" button to register the database of the user account. (Leave all the default settings.)
/ * Create sample database * / create database sample;
/ * Use sample database * / use sample;
/ * Create account table * / CREATE TABLE sample.account ( username CHAR(20) NOT NULL, password CHAR(20) NOT NULL, mailaddr CHAR(30) NOT NULL, PRIMARY KEY ( username ) );
/ * Register user account information in the account table * / INSERT INTO sample.account (username, password, mailaddr) VALUES ('Yamada','yamada','[email protected]'); INSERT INTO sample.account (username, password, mailaddr) VALUES ('jun','jun','[email protected]'); INSERT INTO sample.account (username, password, mailaddr) VALUES ('Aiko','aiko','[email protected]'); INSERT INTO sample.account (username, password, mailaddr) VALUES ('Michael', 'michael', '[email protected]'); ~~~
This is an example of operating a database.
Open the "SQL" tab in phpMyAdmin, enter the SQL statement and press the "Execute" button.
The execution result is displayed.
Recommended Posts