Start MySQL Error

Source: Internet
Author: User
Tags mysql host unix domain socket

When the service mysqld start when starting MySQL services on a Linux system

Report: Another MySQL daemon already running with the same UNIX socket.

Solution.

Cause multiple MySQL processes use the same socket.

Two ways to solve:

The first one is to immediately shut down the machine using the command shutdown-h now shutdown, after shutting down the boot, the process stops.

The second one directly renamed the Mysql.sock file. can also be deleted, recommended renaming.

Method Mv/var/lib/mysql/mysql.sock/var/lib/mysql/mysql.sock.bak

Then you can start MySQL, and a mysql.sock file is recreated.

Mysql.sock file explanation on the Internet to find the following explanations, reproduced in this

This mysql.sock should be MySQL host and client on the same host, use UNIX domain socket as the carrier of communication protocol, it is faster than TCP. The common cause of this problem is that your MySQL server is not running.


There are two ways to connect MySQL:
(1), TCP/IP
(2), socket
For Mysql.sock, the function is that the program is in the same machine as the MySQLServer and is available when the local connection is initiated.
For example, you do not need to define a specific IP to connect to the host, as long as it is empty or localhost.
In this case, even if you change the external port of MySQL It is also possible to connect normally.
Since you changed the port in My.ini or MY.CNF, the Mysql.sock is generated with every MySQL server startup. The information has been changed since you restarted MySQL when you finished changing the my.cnf.

Then for an external connection, you must change the port to connect.



Linux under the installation of MySQL connection often back to say that the Mysql.sock file is not found, the solution is simple:

If it is a new installation of MySQL, the prompt cannot find the file, just search under, specify the correct location.

If the Mysql.sock file is mistakenly deleted, you will need to restart the MySQL service, if the restart is successful, will be generated under the DataDir directory Mysql.sock then specify.

If not, you can choose to connect with TCP connection, in fact, under Windows also support pipeline connection mode.

Start MySQL Error

Related Article

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.