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

JS realizes automatic playback of timeline

Recently, I have implemented such an effect: clic...

Using Vue3 (Part 1) Creating a Vue CLI Project

Table of contents 1. Official Documentation 2. Cr...

Solution to MySQL connection exception and error 10061

MySQL is a relational database management system ...

How to quickly build an FTP file service using FileZilla

In order to facilitate the storage and access of ...

W3C Tutorial (15): W3C SMIL Activities

SMIL adds support for timing and media synchroniz...

How to change the encoding of MySQL database to utf8mb4

The utf8mb4 encoding is a superset of the utf8 en...

Mysql5.7.14 Linux version password forgotten perfect solution

In the /etc/my.conf file, add the following line ...

Detailed steps to configure MySQL remote connection under Alibaba Cloud

Preface As we all know, by default, the MySQL ins...

Detailed steps to delete environment variables in Linux

How to delete environment variables in Linux? Use...

Component design specifications for WeChat mini-program development

WeChat Mini Program Component Design Specificatio...

Web page html special symbols html special characters comparison table

Special symbols Named Entities Decimal encoding S...