We often encounter inexplicable mysql startup failure errors when using MYSQL. Below I summarize the common causes and solutions for MYSQL startup failure.
We often encounter inexplicable mysql startup failure errors when using MYSQL. Below I summarize the common causes and solutions for MYSQL startup failure.
Question 1
111217 23:23:57 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the. ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Last MySQL binlog file position 0 406839588, file name./mysql-bin.000012
111217 23:23:58 InnoDB: Waiting for the background threads to start
111217 23:23:59 InnoDB: 1.1.8 started; log sequence number 3430959679
Handlersocket: not listening for reads
Handlersocket: not listening for writes
Handlersocket: initialized
111217 23:23:59 [Note] Recovering after a crash using mysql-bin
111217 23:24:04 [ERROR] Error in Log_event: read_log_event (): 'read error', data_len: 749, event_type: 23
111217 23:24:04 [Note] Starting crash recovery...
111217 23:24:04 [Note] Crash recovery finished.
/Opt/yq/mysql/bin/mysqld: Disk is full writing './mysql-bin .~ Rec ~ '(Errcode: 28). Waiting for someone to free space... (Keep CT up to 60 secs delay for server to continue after freeing disk space)
Set mysql. in the server, $ bindir/mysqld_safe -- datadir = $ datadir -- pid-file = $ server_pid_file>/dev/null 2> & 1 is run after the output redirection is removed. An error is returned: file size limit exceedednohup ......
In this case, the file is too large. However, you can view the database files and log files in the mysql data directory. the maximum size is several hundred megabytes. Ulimit-a does not limit the file size.
After N minutes of being depressed, I decided to use find/-size + 2048000 k to find the suspicious files on the entire hard disk. The result is: the large file/var/log/pacct is larger than 2 GB. Obviously, this is the log file generated after SA activates accton and is not rolled back. Otherwise, clear/var/log/pacct and start MySQL again. everything is back to normal!
Linux mysql service startup failed
Error: starting mysql .... Error manager of pid file quit without updating file
Permission issues ., Copy it to you!
1. First Run
For example, I installed mysql under/opt/mysql.
# Cd/opt/mysql
# Scripts/mysql_install_db -- user = mysql (confirm that you have a mysql user)
If not, check whether there is a data directory under your/opt/mysql (this is my). The correct method is to first start it once if OK, and then move the data directory to another place.
Two solutions
1. If you have not modified the my. cnf file, modify it and add datadir
[Mysqld]
Port = 3306
Socket =/tmp/mysql. sock
Datadir =/data/mysql/data
At this time, you create a soft link under/opt/mysql to/etc/my. cnf
# Cd/opt/mysql
# Ln-sf/etc/my. cnf my. cnf
2. Alternatively, you can create a soft link for data under/opt/mysql.
# Cd/opt/mysql
# Ln-sf/data/mysql/data
If not, you have to check the mysqld you have registered as a service.
# Cd/etc/init. d/
# Vim mysqld
Generally, the directory is installed under/usr/local by default, so you need to modify the directory name and point to it.
No, you have to check it.
The/opt/mysql/data/localhost. err file reports an error.
Solve the problem by mistake.
I used to missing a libstdc ++. so.5 library, and I copied one from other places.
The correct process is as follows:
# Cd/opt/mysql
# Scripts/mysql_install_db -- user = mysql
Successful
# Cd ..;./bin/mysqld_safe & // This is a demo
Check the process tree
# Ps aux | grep mysql // you can run it if any.
/Opt/mysql/support-files/mysql. server start // modify mysql. server File. The script file is actually init. d/mysqld file. The default path is under/usr/local.
You can use it once the operation is successful.
/Opt/mysql/bin/mysql
I hope you can solve some problems as soon as possible.
Remember the permission issue, -- user = mysql to start creating the initialization table. Your data DIRECTORY must have the write permission.
Error 3
[ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql. host' doesn' t exist
Follow the mysql installation steps:
Shell> groupadd mysql
Shell> useradd-g mysql
Shell> gunzip | mysql-VERSION.tar.gz | tar-xvf-
Shell> cd mysql-VERSION
Shell>./configure -- prefix =/usr/local/mysql
Shell> make
Shell> make install
Shell> scripts/mysql_install_db -- user = mysql
Shell> chown-R root/usr/local/mysql
Shell> chown-R mysql/usr/local/mysql/var
Shell> chgrp-R mysql/usr/local/mysql
Shells> cp support-files/my-medium.cnf/etc/my. cnf
Shell>/usr/local/mysql/bin/mysqld_safe -- user = mysql &
There is no problem with this standard, but when I start mysql in the last step, I want to put the database data file under another directory and change the startup command:
Shell>/usr/local/mysql/bin/mysqld_safe -- user = mysql -- log-error =/u01/mysql/mysql_error/error -- datadir =/u01/mysql/data
This problem occurs because the permission table created by default is under the default directory/usr/local/mysql/var when initializing the database permission table, this leads to the failure to find the permission Table: Can't open and lock privilege tables: Table 'mysql. host 'doesn' t exist
Solution: When you run the initialization permission table, add the parameter datadir. The command format is as follows:
Shell> scripts/mysql_install_db -- user = mysql -- datadir =/u01/mysql/data
This solves the problem.
This problem also occurs when you change the data files of your database to another directory, because you have not created a database permission table in the corresponding directory, the solution is to re-run the mysql_install_db file to regenerate the database permission table, but you also need to re-create the user and Set permissions; the second method should be to copy the files in the old permission table to the corresponding database table directory first, but the second method I did not use is just based on my own imagination. If you have a master, check whether it is correct.
Green MYSQL startup failed
Because the hard disk of the computer is broken, all the software on the computer is re-installed, and it gets stuck when installing mysql.
To configure a green version of mysql, follow these steps:
1. First open my_small.ini In the extracted mysql master folder and add the following configuration under the node of [mysqld ].
# Mysql main directory
Basedir = F:/db/mysql/mysql5
# Database data storage directory
Datadir = F:/db/mysql/mysql5/data
Default-storage-engine = MyISAM
Default-character-set = gbk
Save the file as my. ini.
2. Install the mysql service.
First, add the mysql main directory to the path of the environment variable, and then create the mysql Service
> Mysqld-nt -- install
Start mysql Service
> Net start mysql
The error was reported to me.
System Error 2.
The system cannot find the specified file.
I am confused. I have never encountered this problem before. Then I keep deleting the Service (SC delete mysql) and creating the service, but it still does not solve the problem, fix the problem and add the solution.
Bytes ------------------------------------------------------------------------------------
Problem solved
Cause:
The error message says that the specified file cannot be found and it refers to the mysql.exe file, so it cannot be started.
Find the problem:
Due to a service startup error, right-click my computer and choose manage. Find the mysql service and check that the executable file path in the service is c:/mysql.exe, the error is due to the installation of the service.
I previously put the local path/mysql/bin in the path, so the mysqld -- install installation service command can also be run in the default directory of cmd, however, when installing the service
The executable file path of the service is also specified to the default path of cmd.
Finally, delete the mysql Service (SC delete mysql), then cd it to the mysql/bin directory in cmd, mysqld -- install installation directory, and net start mysql starts the service successfully. The problem is solved.