Solution to MySQL failure to start

Solution to MySQL failure to start

Solution to MySQL failure to start

MySQL cannot start

After stopping mysql, I performed some operations (such as changing the host name) and restarted mysql, but found that it could not start.

[root@www ~]$ service mysql start 
Starting MySQL..^[[A.................................................................................................. ERROR! The server quit without updating PID file (/disk/mysql/www.pid).
[root@www ~]$ service mysql stop 
 ERROR! MySQL server PID file could not be found!
[root@www ~]$ service mysql stop 
 ERROR! MySQL server PID file could not be found!
[root@www ~]$ service mysql start 
Starting MySQL..................
It's still the same as before, so I have to press Ctrl+C to cancel it.
[root@www ~]$
 

It really can't start, take a look at the log: /disk/mysql/www.err

120608 09:56:17 mysqld_safe Starting mysqld daemon with databases from /disk/mysql
120608 9:56:17 [Note] Plugin 'FEDERATED' is disabled.
120608 9:56:17 InnoDB: The InnoDB memory heap is disabled
120608 9:56:17 InnoDB: Mutexes and rw_locks use InnoDB's own implementation
120608 9:56:17 InnoDB: Compressed tables use zlib 1.2.3
120608 9:56:17 InnoDB: Using Linux native AIO
120608 9:56:17 InnoDB: Initializing buffer pool, size = 128.0M
120608 9:56:17 InnoDB: Completed initialization of buffer pool
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
120608 9:56:17 InnoDB: Retrying to lock the first data file
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
InnoDB: Unable to lock ./ibdata1, error: 11
...

It seems that the original mysqld has not stopped.

Force terminating mysqld

[root@www ~]$ ps -ef|grep mysql 
root 4769 1 0 Jun06 ? 00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/disk/mysql --pid-file=/disk/mysql/localhost.pid
mysql 4874 4769 0 Jun06 ? 00:04:04 /usr/sbin/mysqld --basedir=/usr --datadir=/disk/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --log-error=/disk/mysql/localhost.err --pid-file=/disk/mysql/localhost.pid --socket=/disk/mysql/mysql.sock
root 17947 1 0 09:56 pts/1 00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/disk/mysql --pid-file=/disk/mysql/www.pid
mysql 18052 17947 0 09:56 pts/1 00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/disk/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --log-error=/disk/mysql/www.err --pid-file=/disk/mysql/www.pid --socket=/disk/mysql/mysql.sock
root 18099 17514 0 09:56 pts/1 00:00:00 grep mysql
[root@www ~]$ killall mysqld 
[root@www ~]$ killall mysqld 
[root@www ~]$ ps -ef|grep mysql 
root 18116 17514 0 09:57 pts/1 00:00:00 grep mysql
[root@www ~]$

Start mysqld. Now there is no problem in executing the startup command multiple times.

[root@www ~]$ service mysql start 
Starting MySQL. SUCCESS! 
[root@www ~]$ 
[root@www ~]$ 
[root@www ~]$ 
[root@www ~]$ 
[root@www ~]$ service mysql start 
Starting MySQL SUCCESS! 
[root@www ~]$
 

What exactly is the error: 11 shown in the www.err file above? Let’s take a look at:

[root@www ~]$ perror 11 
OS error code 11: Resource temporarily unavailable
[root@www ~]$ 
[root@www ~]$

If you have any questions, please leave a message or come to the community to discuss. Thank you for reading and I hope it can help you. Thank you for your support of this site!

You may also be interested in:
  • How to install the mysqldb module in python under windows
  • Detailed steps to configure Apache + PHP + MySQL operating environment in Mac OS X
  • MySQL 5.7 installation-free configuration graphic tutorial
  • Detailed explanation of the implementation process of dual-master synchronization of partial tables in MySQL 5.7
  • Batch files for stopping and starting oracle and mysql databases
  • Detailed explanation of the role of static variables in MySQL

<<:  Two solutions for Vue package upload server refresh 404 problem

>>:  Connector configuration in Tomcat

Recommend

JavaScript canvas to achieve raindrop effects

This article example shares the specific code of ...

Perfect solution for JavaScript front-end timeout asynchronous operation

Table of contents What happens if a piece of code...

WeChat applet + ECharts to achieve dynamic refresh process record

Preface Recently I encountered a requirement, whi...

SSM VUE Axios Detailed Explanation

Table of contents How to display SQL log? ? Descr...

Example of setting up a whitelist in Nginx using the geo module

Original configuration: http { ...... limit_conn_...

About React Native unable to link to the simulator

React Native can develop iOS and Android native a...

Getting Started: A brief introduction to HTML's basic tags and attributes

HTML is made up of tags and attributes, which are...

HTML table tag tutorial (20): row background color attribute BGCOLOR

The BGCOLOR attribute can be used to set the back...

Detailed explanation of the data responsiveness principle of Vue

This article is mainly for those who do not under...

Vue3 Documentation Quick Start

Table of contents 1. Setup 1. The first parameter...

Sqoop export map100% reduce0% stuck in various reasons and solutions

I call this kind of bug a typical "Hamlet&qu...