Installed Ubuntu for a long time, did not go to use, the national day toss up the next, the configuration of some basic development environment, a hands-on feel like on the Ubuntu, can not say why. In order to get a local test PHP test environment and installed XAMPP, installation is very simple, but I found that it did not start. The solution is also simple, opening the resource file that was started by using the following command:
Copy Code code as follows:
x@zst:~$ CD/ETC/INIT.D
x@zst:/etc/init.d$ sudo gedit rc.local
Add a line of code to the startup file:
Copy Code code as follows:
So xampp can boot from the start, and then encountered another problem, when I use MySQL client to connect MySQL when the following error occurred:
Can ' t connect to the local MySQL server through socket '/var/lib/mysql/mysql.sock '
Obviously, this is not the directory where we install XAMPP, it's supposed to be
Copy Code code as follows:
/opt/lampp/var/mysql/mysql.sock
The way you see it online is to connect two files, as follows:
Copy Code code as follows:
sudo ln-s/opt/lampp/var/mysql/mysql.sock/var/run/mysqld/mysqld.sock
So I did, and I did solve the problem. When this has a disadvantage, this sock file is a MySQL connection only, after the reboot disappeared, I had to manually connect once, so I was very wretched to put this command in accordance with the previous start Xampp method after starting the XAMPP code to join this line command , problem solving.
In general, two lines of command were added to the rc.local:
Copy Code code as follows:
/opt/lampp/lampp start
sudo ln-s/opt/lampp/var/mysql/mysql.sock/var/run/mysqld/mysqld.sock