Can't connect to local MySQL server rhrough socket Solution

Source: Internet
Author: User

Can't connect to local MySQL server rhrough socket Solution

When I log on to mysql today, the error "Can't connect to localmysqlserverrhrough socket" is displayed. The problem Can be solved based on two posts.

My system is centos

First:
Cp/usr/share/doc/MySQL-server-5.5.24/my-medium.cnf/etc/my. cnf
Second:
Touch/var/lib/mysql. scok

View the database running status

/Etc/init. d/mysql status
Prompt
ERROR! MySQL is running but PID file cocould not be found
Print the MYSQL process first
Ps aux | grep mysql
Then KILL the process
Kill-9 pid1 pid2...
Start MYSQL again
/Etc/init. d/mysql start
Check the mysql running status.
/Etc/init. d/mysql status

Because I cannot find my in/etc at the beginning. cnf this file,/usr/share/doc/MySQL-server-5.5.24/There Is A my-default.cnf under this file, looked at, feeling and my-medium.cnf almost, copy to the etc directory, to act as my. cnf,

Mysql can be started in either of the following ways: tcp or socket. Generally, it is okay to start tcp. This problem occurs only when the socket is started.

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.