MySQL installation troubleshooting

Source: Internet
Author: User

MySQL installation troubleshooting

Mysql faults:

[Root @ MYSQL_M ~] #/Etc/init. d/mysqld restart

Starting MySQL... ERROR! Manager of pid-file quit without updating file.

[Root @ MYSQL_M ~] #

Possible one:

The basedir and datadir directories in the/etc/init. d/mysqld configuration file are not specified. The installation directory is used by default. You need to specify the datadir directory.

The above two directories should be the basic directories and Data Directories specified during database initialization. For example, my initialization directory is the following command.

/Application/mysql/bin/mysql_install_db -- basedir =/application/mysql -- datadir =/data -- user = mysql

So I changed it:

Vim/etc/init. d/mysqld

46 basedir =/application/mysql

47 datadir =/data

May 2

The data directory owner of mysqld is not MYSQL or the uid is incorrect. That is, the owner of the data directory above is incorrect. Modify it to the same owner.

Chown-R mysql. mysql/data

May 3

Is the tmp directory permission problem in mysql. The socket cannot be created.

The following error is reported in the log:

151105 13:42:49 InnoDB: Started; log sequence number 0 44233

151105 13:42:49 [ERROR] Can't start server: Bind on unix socket: Permission denied

151105 13:42:49 [ERROR] Do you already have another mysqld server running on socket:/application/mysql5.1.72/tmp/mysql. sock?

151105 13:42:49 [ERROR] Aborting

View/application/mysql/tmp Permissions

[Root @ MYSQL_S ~] # Ll/application/mysql/

Total 32

Drwxr-xr-x 2 root 4096 Nov 5 bin

Drwxr-xr-x 3 root 4096 Nov 4 23:55 include

Drwxr-xr-x 3 root 4096 Nov 4 23:55 lib

Drwxr-xr-x 2 root 4096 Nov 4 libexec

Drwxr-xr-x 10 root 4096 Nov 4 mysql-test

Drwxr-xr-x 6 root 4096 Nov 4 share

Drwxr-xr-x 5 root 4096 Nov 4 SQL-runtime

Drwxr-xr-x 2 root 4096 Nov 5 tmp

[Root @ MYSQL_S ~] #

The owner of the/application/mysql/tmp directory is root. However, the owner of this directory should be mysql, that is, the user name you specified when initializing the database using the following command.

/Application/mysql/bin/mysql_install_db -- basedir =/application/mysql -- datadir =/data -- user = mysql

So authorize mysql.

[Root @ MYSQL_S ~] # Chown mysql/application/mysql/tmp/

[Root @ MYSQL_S ~] #/Etc/init. d/mysqld start

Starting MySQL. SUCCESS!

[Root @ MYSQL_S ~] #

This article permanently updates the link address:

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.