Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Solution to the failure of mysql start

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly shows you the "solution to mysql start failure", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn the "solution to mysql start failure" this article.

The solution to the failure of mysql start: 1, migrate the original data directory to the reformulated data directory; 2, execute "chown-R mysql:mysql / mydata/data/"; 3, execute "kill-9 process number"; 4, delete mysql-bin.

This article operating environment: Windows7 system, mysql5.5 version, Dell G3 computer.

What if mysql start fails?

Mysql database startup failed

Brief introduction:

After restarting the server-- > restart application service (Confluence)-- > error, database connection failure (mysql is set to boot)-- > View the status of mysql database:

[root@fisheye ~] # ps-ef | grep mysqlroot 25555 21974 0 11:28 pts/0 00:00:00 grep mysql

Start the mysql server

[root@fisheye data] # service mysql startMySQL server PID file could not be found! [failed] Starting MySQL. ERROR! The server quit without updating PID file (/ mydata/data/fisheye..pid). [failure]

View the error log:

[root@fisheye data] # tail-100 fisheye.errInnoDB: Last MySQL binlog file position 0 337403929, file name. / mysql-bin.000016141013 1:13:28 InnoDB: Waiting for the background threads to start141013 1:13:29 InnoDB: 5.5.33 started; log sequence number 100664715217 fisheye.errInnoDB 1329 UTC-mysqld got signal 11; This could be because you hit a bug. It is also possible that this binaryor one of the libraries it was linked against is corrupt, improperly built,or misconfigured. This error can also be caused by malfunctioning hardware.We will try our best to scrape up some info that will hopefully helpdi141013 01:13:29 mysqld_safe mysqld from pid file / mydata/data/fisheye.pid ended

No explicit error prompt was found, so try creating a pid file manually

[root@fisheye data] # touch / mydata/data/fisheye.pi

Then restart the service:

[root@fisheye data] # service mysql restartERROR 2002 (HY000): Can't connect to local MySQL server through socket'/ tmp/mysql.sock' (2)

It occurred to me that I had read this kind of error report before, and I remember that mysql could not start due to insufficient disk space.

[root@fisheye data] # df-h File system capacity available available Mount Point / dev/sda1 9.5G 9.5G 0100% / / dev/sda4 5.5G 1.3G 4.0G 24% / mnt/backup/dev/mapper/IhuilianVG-IhuilianLV00 22G 4.2G 17G 20% / var/www/apptmpfs 1.3G 0 1.3G 0% / dev/shm

Sure enough, here are some ideas for solving similar problems (unable to start):

1. Maybe the partition that exists in the datadir directory is full (df-h)

Solution: open the configuration file / etc/my.cnf, reassign the data directory (datadir) under the [mysqld] section, and migrate the original data directory to the redesigned data directory

On migration: (1), cp or tar must be taken with the permissions, but in order to prevent accidents, it is recommended to authorize again; (2), when the data is relatively large, you must first compress and then migrate, to ensure integrity, especially when scp to other machines may time out, so you must compress (tar.gz); (3) if you move to another server, you must ensure that the mysql version is consistent.

two。 It may be that / mydata/data/fisheye.pid file does not have write permission

Solution: give permission, execute "chown-R mysql:mysql / mydata/data/" and restart mysqld!

3. The mysql process may already exist in the process.

Solution: use the command "ps-ef | grep mysqld" to see if there are any mysqld processes, and if so, use the "kill-9 process number" to kill, and then restart mysqld!

4. This 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 mysql's data directory / data. If mysql-bin.index exists, delete it as soon as possible. It's the culprit.

5.skip-federated field problem (error message: [ERROR] / mydata/data/mysql/libexec/mysqld: unknown option'--skip-federated')

Solution: check the / etc/my.cnf file to see if there are any skip-federated fields that have not been commented out, and if so, comment them out immediately.

6.selinux caused the disaster. If it is centos system, selinux will be enabled by default.

Solution: close it, open / etc/selinux/config, change SELINUX=enforcing to SELINUX=disabled, then save and exit and restart the machine.

The above is all the content of this article "the solution to the failure of mysql start". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report