When mysql is started, the following solution is displayed:/tmp/mysql. sock does not exist. mysqlmysql. sock

Source: Internet
Author: User
Tags localhost mysql

When mysql is started, the following solution is displayed:/tmp/mysql. sock does not exist. mysqlmysql. sock
When mysql is started, the following solution is displayed:/tmp/mysql. sock does not exist.



Troubleshooting when mysql is started (mysql 5.0.45 redhat as43) ========================================================== =========================== solve the problem returned when mysql is started (mysql 5.0.45 redhat as 43) author: lawzjf (http://lawzjf.itpub.net) published in: 2008.01.13 0classification: small penguin Source: http://lawzjf.itpub.net/post/417/451262 --------------------------------------------------------------- start mysql error:
Starting mysqld daemon with databases from/var/lib/mysqlSTOPPING server from pid file/var/run/mysqld. pid071112 00:22:06 mysqld ended view log: # less/var/log/mysqld. the log contains the following sections:

071112 0:22:06 [ERROR]/usr/local/mysql/bin/mysqld: Can 'tcreate/write to file'/var/run/mysqld. pid '(Errcode: 2) 071112 0:22:06 [ERROR] Can't start server: can't create PIDfile: no such file or directory071112 00:22:06 mysqld ended # cd/var/run/# ls

The mysqld directory does not exist. Create it:

# Mkdir/var/run/mysqld # cd/var/run/mysqld

Create the mysqld. pid file:

# Touch mysqld. pid # cd .. # chown-R mysql mysqld. # cd/usr/local/mysql/# bin/mysqld_safe -- user = mysql & nohup: ignoring input and redirecting stderr to stdoutStarting mysqld daemon with databases from/var/lib/mysql can be started normally # bin/mysqladmin-u root password root error again [root @ localhost mysql] # bin /mysqladmin-u root passwordrootbin/mysqladmin: connect to server at 'localhost' failederror: 'Can't connect to local MyS QL server through socket '/tmp/mysql. sock' (2) 'check that mysqld is running and that the socket: '/tmp/mysql. sock' exists! [Root @ localhost mysql] # bin/mysql-u root-pEnter password: ERROR 2002 (HY000): Can't connect to local MySQL serverthrough socket '/tmp/mysql. sock '(2) Analysis:/tmp/mysql. sock does not exist

# Cd/var/lib/mysql/because the default mysql. sock of mysql is in/var/lib/mysql. sock, create a symbolic connection:

# Ln-s/var/lib/mysql. sock/tmp/mysql. sock # bin/mysql-u rootWelcome to the MySQL monitor. commands end with; or g. your MySQL connection id is 1 Server version: 5.0.45 MySQL Community Server (GPL) Type 'help; 'or 'H' for help. type 'C' to clear thebuffer. mysql> modify the root password

# Cd/usr/local/mysql/# bin/mysqladmin-u root-p password yourpassword everything is OK.

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.