Solve xampp and Mysql.sock problems _linux

Source: Internet
Author: User
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:

/opt/lampp/lampp start

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.