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

HTML4.0 element default style arrangement

Copy code The code is as follows: html, address, ...

Talking about the practical application of html mailto (email)

As we all know, mailto is a very practical HTML ta...

JS, CSS and HTML to implement the registration page

A registration page template implemented with HTM...

How to create, start, and stop a Docker container

1. A container is an independently running applic...

Docker installs and runs the rabbitmq example code

Pull the image: [mall@VM_0_7_centos ~]$ sudo dock...

A brief discussion on HTML doctype and encoding

DOCTYPE Doctype is used to tell the browser which...

Detailed explanation of some settings for Table adaptation and overflow

1. Two properties of table reset: ①border-collaps...

Detailed explanation of Vue project packaging

Table of contents 1. Related configuration Case 1...

Detailed explanation of JavaScript data types

Table of contents 1. Literals 1.1 Numeric literal...

How to use Docker container to access host network

Recently, a system was deployed, using nginx as a...

Detailed explanation of zabbix executing scripts or instructions on remote hosts

Scenario Requirements 1. We can use the script fu...

How to set underline in HTML? How to underline text in HTML

Underlining in HTML used to be a matter of enclos...