linux - mysql 数据库经常报错挂掉
天蓬老师
天蓬老师 2017-04-17 16:12:33
0
3
608
Starting MySQL... ERROR! The server quit without updating PID file (/data/mysql/mysql.pid).

一天出现1-2次,不论怎么reset 都没用,只能重启服务器来解决问题.我觉得是数据库配置问题?

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(3)
PHPzhong

The database can only be started by restarting. After checking, it was found that the memory is full. In addition, the database memory is allocated too much.

洪涛

There are many possible reasons for the problem. The best way to determine the specific reason is to check the error log first:
1. It may be that the /usr/local/mysql/data/mysql.pid file does not have write permissions
Solution: Give permissions, execute "chown -R mysql:mysql /var/data" "chmod -R 755 /usr/local/mysql/data" and then restart mysqld!

2. The mysql process may already exist in the process
Solution: Use the command "ps -ef|grep mysqld" to check whether there is a mysqld process. If there is, use "kill -9 process number" to kill it, and then restart mysqld!

3. It may be the second time that mysql is installed on the machine, and there is residual data that affects the startup of the service.
Solution: Go to the mysql data directory/data and take a look. If mysql-bin.index exists, delete it quickly. It is the culprit. I solved it using the third method!

4. When mysql does not specify a configuration file when starting, 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.
Solution: Please set this line under [mysqld]: datadir = /usr/local/mysql/data

5. Skip-federated field problem
Solution: Check if there is an uncommented skip-federated field in the /etc/my.cnf file. If there is, comment it out immediately.

6. The error log directory does not exist
Solution: Use the "chown" "chmod" command to give mysql owner and permissions

7. The trouble caused by selinux. If it is a centos system, selinux will be enabled by default. Solution: close it, open /etc/selinux/config, change SELINUX=enforcing to SELINUX=disabled, save and exit, and try restarting the machine.

You can try the 7th method~~~

刘奇

On your side, innodb_pool_buffer_size is too large, and your server memory is too small, causing the system to oom. It is recommended to reduce this value and increase the server memory configuration.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!