Just after installing mysql, the following error will be reported at startup:
StartingMySQL.Managerofpid-filequitwithoutupdatingfile.[FAILED]
Solve the starting mysql.manager of PID file quit without updating file. [failed]
Try various methods found from Google in turn, and find that you can solve the problem by executing the following MySQL initialization command:
/usr/local/mysql/bin/mysql_install_db--user=mysql
The following is a collection of solutions to this problem found from Google. Maybe the causes of the problems encountered by everyone will be different for reference:
1、 View error log
The error log is the direction light for us to solve the problem. Without the direction light, we have no direction
I had an error in the installation log once, and there was such an error:
/usr/local/mysql/bin/mysqld:errorwhileloadingsharedlibraries:libstdc++.so.5:cannotopensharedobjectfile:Nosuchfileordirectory
Obviously, the library file libstdc + +. So. 5 is missing. At this time, we can search for the package installation related to libstdc
2、 Maybe it’s SELinux
If it is a CentOS system, SELinux will be turned on by default. At this time, you can turn it off first, open/etc/SELinux/config, change SELinux = enforcing to SELinux = disabled, save the disk, exit and restart the machine
3、 Residual data
It may also be the second time that MySQL is installed on the machine, and some residual data affects the startup of the service. Go to the data directory/data of MySQL, and if there is mysql-bin.index, delete it as soon as possible. It is the culprit
4、 Determine the permissions of the data directory
The data directory is generally & lt; prefix>/ Data, check its ownership. If it is not the owner of MySQL, users and groups of MySQL will be created when installing mysql. At this time, users and groups should be modified
chown-Rmysql:mysql/var/data
5、 No data directory specified
When MySQL does not specify a configuration file, it will use the/etc/my.cnf configuration file. Please open this file to see if there is a specified data directory (dataDir) under the [mysqld] section. If not, set this line under [mysqld]:
datadir=/usr/local/mysql/data
6、 And the MySQL process is running
If this is the second time to install MySQL on the machine, it is very likely that this situation will occur. At this time, there is likely to be a MySQL process running on the system. You can execute the following commands to view the data:
ps-ef|grepmysql
If the result is more than one line, kill it as soon as possible
7、 What’s wrong with the skip federated field
You can check the/etc/my.cnf file to see if there are any skip federated fields that have not been commented out. If so, comment them out immediately
8、 The error log directory does not exist
Maybe you don’t know where the MySQL error log is right now?At this time, you can execute the command to view:
cdmysql/bin
./mysql_safe
At this time, an error will be reported, and the error will be displayed in the error, and the error will be written in the file of the directory. Here, check whether the directory and the file are in, and then solve it according to the log instructions. If not, create the directory and modify the permissions and ownership. Generally, it will be/var/lib/MySQL/MySQL. Error. Note that mysql. Error does not need to be created
cd/var/lib
mkdirmysql
chmod777mysql
chownmysql:mysqlmysql
Now try again. If you still can’t, leave a message for you to see
9、 Maybe it’s data/mysql-bin.index
Antecedent: because the hard disk is full, MySQL can’t start. Log in to have a look and find out why. Delete the log file of MySQL, restart mysql, and find an error: starting mysql.manager of PID file quit without updating file. [failed]
There are many explanations for this reason on the Internet, but none of them are what I want to say. The reason I want to say is actually idiotic: data/mysql-bin.index is not deleted. Data/mysql-bin.index is the file where the index of log file is stored. It is obviously impossible to delete the log file without processing the index file of log file
Delete the data/mysql-bin.index file, and then service mysqld start
Similar Posts:
- Solution to error reporting in starting MySQL
- MySQL Error: The server quit without updating PID file [How to Solve]
- MySQL: Starting MySQL….. ERROR! The server quit without updating PID file
- MySQL Changes the configuration file (my.ini) Error [How to Solve]
- How to Solve MySQL Startup error: mysql-bin.index not found (Errcode: 13)
- How to Solve MYSQL Error: Can’t create test file xxx lower-test
- Docker Run Mysql Container Error: [ERROR] InnoDB: redo log file ‘./ib_logfile0’ exists
- [Solved] MySQL Error: ERROR! The server quit without updating PID file
- Docker Run MYSQL Container Error: [ERROR] –initialize specified but the data directory has files in it. Aborting.
- MySQL [ERROR] Table ‘mysql.user’ doesn’t exist