MySQL cannot start Can 'tstartserver: Bindonunixsocket: Permissi

Source: Internet
Author: User
The MySQL Server suddenly cannot be started. Check the final startup log as follows: 08082509: 38: 04mysqldstarted0808259: 38: 04 [ERROR] Can

The MySQL Server suddenly cannot be started. Check the final startup log as follows: 080825 09:38:04 mysqld started080825 9:38:04 [ERROR] Can

The MySQL Server suddenly cannot be started. Check the final startup 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 have 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 configuration of my. cnf is 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

Check the running permission according to the log file, and then check/var/mysql. sock, found/var/mysql. the file does not exist in the sock directory. Is there no permission to write the/var directory? OK, run the safe_mysqld command as the root user and start it normally. When I use mysql to connect to the database, an error is prompted. The database server cannot be connected, and mysql is not found in the/tmp directory. here, the sock file shows the communication between the Mysql client and the server on the local machine. the sock file is used for initialization and communication. Therefore, the directory where the file is stored must be accessible by both parties, and the server needs to write the file when it is started. If my. if the two configurations in cnf are incorrect, similar errors such as Permission denied may occur. Modify the configuration file as follows.

[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 the problem persists, chmod 777/tmp is required.

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.