MySQL cannot start can ' t start server:bind on UNIX Socke

Source: Internet
Author: User
Tags mysql client

The MySQL server suddenly fails to start, looking at the last boot log as follows:

080825 09:38:04 Mysqld started
080825 9:38:04 [ERROR] Can ' t start server:bind on Unix socket:permission denied
080825 9:38:04 [ERROR] Do you already has another MYSQLD server running on socket:/var/mysql.sock?
080825 9:38:04 [ERROR] Aborting

080825 9:38:04 [Note]/usr/local/mysql/bin/mysqld:shutdown complete

080825 09:38:04 Mysqld Ended

The f is configured as follows:
[Mysqld]
Datadir=/usr/local/mysql/data
Socket=/var/mysql.sock

[MySQL]
Socket=/tmp/mysql.sock
[Mysql.server]
User=mysql
Basedir=/usr/local/mysql

[Safe_mysqld]
Err-log=/usr/local/mysql/mysqld.log
Pid-file=/usr/local/mysql/mysqld.pid

According to the log file display, first check the operation permissions, and then look at/var/mysql.sock, found that the/var/mysql.sock directory does not have the file, is not the right to write the/var directory? OK, then use the root user to run the safe_mysqld, start normal. Use MySQL connection database, prompt error, connect not to the database server,/tmp directory without mysql.sock this file, to here, basically clear the MySQL client and server in the local communication mode, through a named Mysql.sock File to initialize the communication, so the directory in which the file is stored must have access to both parties, and the server needs to write the file at startup, if the two items in F are incorrectly configured, there will be similar errors such as permission denied. Modify the configuration file as follows, there is no problem.

[Mysqld]
Datadir=/usr/local/mysql/data
Socket=/tmp/mysql.sock

[MySQL]
Socket=/tmp/mysql.sock
[MySQL. Server]
User=mysql
Basedir=/usr/local/mysql

[Safe_mysqld]
Err-log=/usr/local/mysql/mysqld.log
pid-file=/usr/local/Mysql/mysqld.pid
If it doesn't work, then you need chmod 777/tmp

MySQL cannot start can ' t start server:bind on UNIX Socke

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.