MySQL connection in Linux could not find the Mysql.sock file

Source: Internet
Author: User
Tags mysql import

Encountered a Linux system boot cannot find the Mysql.sock problem

Cause Analysis:

Because the data is large, the storage large file of MySQL is stored directly under the root directory file, causing the Mysql.sock file under Tem to be deleted, so it can't connect to MySQL.

Solution:

1. Stop the MySQL service

Service mysqld stop;

2. Move large files to a directory with larger remaining space

MV Mysql_data/xxx

3. Make a soft connection to the Mysql_data folder

Ln-s/home/xxx/mysql_data

Command parsing: Make a soft connection to the/mysql_data at the post-move XXX location (personal understanding of Windows-like shortcuts)

4. Restart the MySQL service

Service mysqld Restart

The command to use:

View MySQL Import data path

After logging in to MySQL:

Show variables like '%dir% ';

Results:

, DataDir is the path where the data is imported.

If you do not need to make a soft connection mysql.cnf to make changes,

MySQL connection in Linux could not find the Mysql.sock file

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.