Mysql. sock cannot be found when mysql is installed in yum mode.

Source: Internet
Author: User
Installing mysql using yum saves many steps for installing the source code package, but sometimes the mysql service cannot be started after mysqlyum is packaged and started,

Installing mysql using yum saves many steps for installing the source code package, but sometimes the problem that mysql cannot be started when mysql service is started after mysql yum is packaged,

Installing mysql using yum saves many steps for installing the source code package, but sometimes the problem that mysql cannot be started when mysql service is started after yum is packaged with mysql is reported as follows: can't connect to local MySQL server through socket '/tmp/mysql. sock '(2), mysql cannot be found. sock file, mysql. the sock file appears after mysql is installed and the database is initialized. Therefore, after installing the package, perform the following steps:

Add the mysqld service.

/Sbin/chkconfig -- add mysqld [add mysql service to service list]

Start mysql.

Service mysqld start; (that is,/etc/init. d/mysqld start. You can also set it to boot automatically:/sbin/chkconfig mysqld on)

Then, the amount... What if "MySQL Daemon failed to start" is displayed? This is the solution.

1. initialize the database

/Usr/bin/mysql_install_db -- user = mysql

Cp/usr/share/mysql/my-small.cnf/etc/my. cnf (optional)

2. log on to mysql in safe Mode

Cd/usr;

/Usr/bin/mysqld_safe &

3. Restart the mysqld service.

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.