MySQL & quot; Can & #39; tconnecttolocalmysqlserver

Source: Internet
Author: User
Today, the community milestone version of MySQL5.5 is installed. in order, I first uninstalled the previous version 5.0, and then installed the servers and clients (rpm version) respectively ). When executing mysql commands, the system always prompts: Cantconnecttolocalmysqlserverthroughsocketvarlibmysqlmysql. sock. Me score

Today, I installed MySQL 5.5 community milestone edition. in order, I first uninstalled the previous version 5.0, and then installed the servers and clients (rpm version) respectively ). When executing mysql commands, the system always prompts: "Can't connect to local mysql server through socket '/var/lib/mysql. sock '. Me score

Today, I installed MySQL 5.5 community milestone edition. in order, I first uninstalled the previous version 5.0, and then installed the servers and clients (rpm version) respectively ).

When executing mysql commands, the system always prompts: "Can't connect to local mysql server through socket '/var/lib/mysql. sock '.

I found this method on google, but it doesn't work either. I tried this method, and then I tried N different methods, I even manually wrote my in the/etc/directory. cnf file (the configuration file manually written will not help but mislead mysql service startup, and the problem will be solved after it is deleted )......

Here, I finally solved my problem through a more violent method. The record is as follows:

1. Use ps-aux | grep mysql to find the mysql-related process pid.

2. Run the kill command to conclude mysql-related processes.

3. start service mysql-start.

Finally, enter the mysql command, and the "Welcome to the MySQL monitor. Commands end with; or/g.
Your MySQL connection id is 1
Server version: 5.5.0-m2-community for MySQL Community Server (GPL )"

Several key points in the problem search process:

1. First, find the mysql. sock file (find/-name mysql. sock) mentioned in the error prompt and find that it cannot be found (this file is special ).

2. If the file cannot be found, you need to restart the mysql service (service mysql restart ).

3. But restarting the service depends on mysql. sock. This is an endless loop. What should I do?

4. Use brute force kill to kill mysql-related processes.

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.