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

Introduction to Vue life cycle and detailed explanation of hook functions

Table of contents Vue life cycle introduction and...

JavaScript mobile H5 image generation solution explanation

Now there are many WeChat public account operatio...

MySQL deadlock routine: inconsistent batch insertion order under unique index

Preface The essence of deadlock is resource compe...

In-depth study of MySQL composite index

A composite index (also called a joint index) is ...

Example tutorial on using the sum function in MySQL

Introduction Today I will share the use of the su...

How to assign default values ​​to fields when querying MySQL

need When querying a field, you need to give the ...

Mysql splits string into array through stored procedure

To split a string into an array, you need to use ...

Docker starts in Exited state

After docker run, the status is always Exited Sol...

Springboot+Vue-Cropper realizes the effect of avatar cutting and uploading

Use the Vue-Cropper component to upload avatars. ...

17 404 Pages You'll Want to Experience

How can we say that we should avoid 404? The reas...

A brief explanation of the reasonable application of table and div in page design

At the beginning of this article, I would like to ...

Solution to the conflict between Linux kernel and SVN versions

Phenomenon The system could compile the Linux sys...

javascript input image upload and preview, FileReader preview image

FileReader is an important API for front-end file...