1. MySQL
i. MySQL install
sudo apt-get install mysql-server
sudo apt-get install mysql-client
-
Be careful:
a. Input the user "root" password;
b. The user "root" and the UBUNTU system "root" user are not the same thing;
ii. MySQL installed check
sudo service mysql restart
Comfirm MySQL start/running, and loging in:
mysql -u root -p
Input the password for the user "root" to log in.
2. Apache
i. Apache installation
sudo apt-get install apache2
ii. Checking
Using browser open http://localhost/ and get:
iii. Restart the apache
sudo /etc/init.d/apache2 restart
iv. Let apache support MySQL
sudo apt-get install libapache2-mod-auth-mysql
3. Php
The php is used to install phpMyAdmin which is the graphical user interface for MySQL.
i. Php installation
sudo apt-get install php5
sudo apt-get install libapache2-mod-php5
sudo /etc/init.d/apache2 restart
ii. Php support MySQL
sudo apt-get install php5-mysql
-
Be careful:
In this version of PHP5, the webpage file is in the directory "html" rather than directory "WWW", so it has to creat the file in the directory "html":
sudo gedit /var/www/html/test.php
And edit the "test.php":
<?php
phpinfo();
?>
iii. Checking
Browser --> http://localhost/test.php and if it is succeed, it will get:
iv. PHP & MySQL working together
Edit the file "/etc/php5/apache2/php.ini", and change "; extension=msql.so" to "extension=msql.so" (cancel the NOTE).
4. phpMyAdmin
i. phpMyAdmin installation
sudo apt-get install phpmyadmin
ii. Soft-connection
Browser could not open "http://localhost/phpmyadmin" because the directory "phpmyadmin" is not in the directory "/var/www/html/", so it could make a soft-connection to resolve the problem:
cd /var/www//html
sudo ln -s /usr/share/phpmyadmin
iii. Checking
Browser --> "http://localhost/phpmyadmin" , and get:
5. Problem
i.
After the login if it show the error: "Connection for controluser as defined in your configuration failed.". The solving method:
Edit the file "/etc/phpmyadmin/config-db.php"
$dbuser='root';
$dbpass='***';
Where '***' is your password for user "root" of MySQL.
ii.
The mcrypt extension is missing. Please check your PHP configuration.
Solving method:
sudo php5enmod mcrypt
sudo service apache2 restart
6. Thanks:
http://www.bubuko.com/infodetail-329492.html
http://jingyan.baidu.com/article/425e69e6bbc6c7be14fc1640.html