Two problems and workarounds for using MySQL under centos6.8

Source: Internet
Author: User

"Issue 1" installs MySQL directly on centos6.8 using Yum, and everything is installed properly. Show when MySQL starts:

ERROR 2002 (HY000): Can ' t connect to local MySQL server through socket '/var/lib/mysql/mysql.sock ' (2)

(1), cp/usr/share/mysql/my-medium.cnf//etc/my.cnf (Copy the default profile template in the past to overwrite the original configuration file);

(2),/etc/init.d/mysqld Status View MySQL running status, display normal;

(3), the solution:

vim/etc/my.conf, add a sentence below [mysqld]:

[Mysqld] (don't add the words)
Datadir=/usr/local/mysql/data

"Now directly enter MySQL directly into the MySQL command window"

"Issue 2" cannot be logged in with Mysql-u root-p, which shows:

ERROR 1045 (28000): Access denied for user ' mysql ' @ ' localhost ' (using Password:no)

Workaround:

In MySQL configuration file/etc/my.conf, in [Mysqld], add:

Pid-file=/var/lib/mysql/mysqlid.pid

reason:the MySQL user does not operate the/var/run directory permissions, so the PID file can not be created, resulting in the login can not establish process information files, the login process can not be opened, nature can not login.

。。。。。。。。。。 Continue to update ... ..... .... ... .... ..... ..... ..... ..... ..... .....................

Two problems and workarounds for using MySQL under centos6.8

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.