My experience is: After MYSQL is successfully installed, you must first set a password for it. This step is indispensable. (In the beginning, the installation fails due to greed.) this article only represents my personal opinions and experiences, and may be one-sided and incorrect. Please criticize and correct it, if you have any questions, come together... information &
My experience is: After MYSQL is successfully installed, you must first set a password for it. This step is indispensable. (In the beginning, the installation fails due to the lazy figure)
This article only represents my personal opinions and experiences. it may be one-sided and incorrect. Please criticize and correct the article and discuss it with you if you have any questions !!
1. to use apt-get for installation, it is best, or you must first run the following command to upgrade your system. Instead, you can install mysql5 + Apache2 + PHP5 only after the upgrade.
It is useless to run sudo apt-get install apache2 php5 mysql-server before the upgrade. If the source you are looking for is poor or your network is unstable, you may not be able to upgrade it. In this case, you may not be able to install some software using apt-get.
Sudo apt-get update
Sudo apt-get dist-upgrade
2. installation:
Sudo apt-get install mysql-server
Install mysql5
Sudo apt-get install apache2
Install apache2
Sudo apt-get install php5
Install php5
Sudo apt-get install php5-mysql
Install the mysql module of php
Sudo apt-get install php5-gd
Install the GD Library
When running the above command, you can pay attention to the libapache2-mod-auth-mysql (installation of apache2 may be installed on) and libapache2-mod-php5, if you see installed on it, no need to install it separately.
3. configuration:
The MYSQL We just installed has only one default root user, and there is no password. at this time, we must set a password for MYSQL. I personally think it is necessary. This is because I did not take this step during the first installation. I think it is the same as that in win, but you do not need to set it first. However, when I log in with the root account without a password at http: // 127.0.0.1/phpmyadmin, it will not succeed!
Terminal input:
Mysql-u root
Mysql> grant all privileges on *. * TO root @ localhost identified by "123456 ";
'123' is the root password and can be set as needed, but it is best to set a security point.
Mysql> \ q exit mysql
Mysql configuration file-my. cnf :( path:/etc/mysql/my. cnf)
Run the command: sudo gedit/etc/mysql/my. cnf to edit it.
Apache2 configuration file-apache2.conf (path:/etc/apache2/apache2.conf)
Run sudo gedit/etc/apache2.conf to edit
PHP configuration file-php. ini :( path:/etc/php5/apache2/php. ini)
Run the command: sudo gedit/etc/php5/apache2/php. ini to edit it.
At this time, these three files do not need to be edited. for security reasons and optimization, you must edit them. For more details, visit other materials !!
4. install phpmyadmin
Sudo apt-get install phpmyadmin
After the installation is complete, you can test: http: // 127.0.0.1/phpmyadmin. when the page is displayed, do not log on. wait until you change the PHPMYADMIN configuration file (config. inc. php.
Terminal input: sudo gedit/etc/phpmyadmin/config. inc. php
Find $ cfg ['servers'] [$ I] ['password'] = '';
Change to: $ cfg ['servers'] [$ I] ['password'] = '20140901 ';
'123' is the mysql password just set.
5. at this time, it is best to restart the computer. (someone said this on the Internet, because this is the second installation.) open the browser http: // localhost/phpmyadmin/
Enter the root user name, enter the new password, and then execute
We can see the amiable phpmyadmin appearance under win.
Summary:
Operation Command of apache2:
Start: sudo/etc/init. d/apache2 start
Restart: sudo/etc/init. d/apache2 restart
Close: sudo/etc/init. d/apache2 stop
Default home directory of apache2:/var/www/
From the column andy1219111