7

When I restart mysql server in Debian, I always have the below messages. How to make the messages disappear or fix the problem/corrupted tables?

debian:~# /etc/init.d/mysql restart
Stopping MySQL database server: mysqld.
Starting MySQL database server: mysqld.
Checking for corrupt, not cleanly closed and upgrade needing tables..

The linux /var/log/syslog shows

Jul 18 12:27:57 localhost mysqld: 140718 12:27:57 [Note] /usr/sbin/mysqld: Normal shutdown
Jul 18 12:27:57 localhost mysqld:
Jul 18 12:27:57 localhost mysqld: 140718 12:27:57 [Note] Event Scheduler: Purging the queue. 0 events
Jul 18 12:27:57 localhost mysqld: 140718 12:27:57  InnoDB: Starting shutdown...
Jul 18 12:27:58 localhost mysqld: 140718 12:27:58  InnoDB: Shutdown completed; log sequence number 0 44233
Jul 18 12:27:58 localhost mysqld: 140718 12:27:58 [Note] /usr/sbin/mysqld: Shutdown complete
Jul 18 12:27:58 localhost mysqld:
Jul 18 12:27:58 localhost mysqld_safe: mysqld from pid file /var/run/mysqld/mysqld.pid ended
Jul 18 12:28:00 localhost mysqld_safe: Starting mysqld daemon with databases from /mnt/user/mysql
Jul 18 12:28:00 localhost mysqld: 140718 12:28:00 [Note] Plugin 'FEDERATED' is disabled.
Jul 18 12:28:00 localhost mysqld: 140718 12:28:00  InnoDB: Started; log sequence number 0 44233
Jul 18 12:28:00 localhost mysqld: 140718 12:28:00 [Note] Event Scheduler: Loaded 0 events
Jul 18 12:28:00 localhost mysqld: 140718 12:28:00 [Note] /usr/sbin/mysqld: ready for connections.
Jul 18 12:28:00 localhost mysqld: Version: '5.1.49-3~bpo50+1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Debian)
Jul 18 12:28:01 localhost /etc/mysql/debian-start[11601]: Upgrading MySQL tables if necessary.
Jul 18 12:28:01 localhost /etc/mysql/debian-start[11605]: /usr/bin/mysql_upgrade: the '--basedir' option is always ignored
Jul 18 12:28:01 localhost /etc/mysql/debian-start[11605]: Looking for 'mysql' as: /usr/bin/mysql
Jul 18 12:28:01 localhost /etc/mysql/debian-start[11605]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck
Jul 18 12:28:01 localhost /etc/mysql/debian-start[11605]: This installation of MySQL is already upgraded to 5.1.49, use --force if you still need to run mysql_upgrade
Jul 18 12:28:01 localhost /etc/mysql/debian-start[11611]: Checking for insecure root accounts.
Jul 18 12:28:01 localhost /etc/mysql/debian-start[11615]: Triggering myisam-recover for all MyISAM tables
0

2 Answers 2

12

do not follow the 1st answer it's a very bad issue.

If you read the line correctly you will see there is NO problem cause not corrupt table or anything else can be found

"Checking for corrupt, not cleanly closed and upgrade needing tables" so everything is ok.

-1

Couple options which works for me. 1) find the all MySql processes running on your debian:

ps -A | grep mysql

And if is any running, kill it:

kill -9 <ps_number which is second column number>

2) other option is to start mysql with local host and typical port number for it

sudo mysql -h 127.0.0.1 -P 3306 -u root -p <database>

https://stackoverflow.com/a/11658142/2523431

3)The most savage one; uninstall mysql and reinstall (the solution found on some other post, however at the moment can't recall link to give credit): With the command:

sudo apt-get remove --purge mysql\*

you can delete anything related to packages named mysql. Those commands is only valid on debian / debian based linux distributions (for eg. ubuntu). You can list all mysql packages installed with:

sudo dpkg -l | grep -i mysql

For more cleanup for package cache you can:

sudo apt-get clean

Remember to:

sudo updatedb

Otherwise the "locate" command will display old data. To install mysql again, use the following command:

sudo apt-get install libmysqlclient-dev mysql-client

This will install mysql client, libmysql and its headers files. To install the server, run this one:

sudo apt-get install mysql-server

There are other options advised by other guys, like overwriting config file, but in my case (I'm running mysql on Kali Linux which is Debian based) didn't help.

Btw don't forget to shut system with command:

shutdown -h now

it should prevent you for further inconvenience in the future.

1
  • 1
    Never ever ever ever call "kill -9" as a first try. Try killing it "normally" with a typical kill thePID. Then, and only then, of nothing works and the process refuses to close, use kill -9. Using kill -9 prevents the process to ever close cleanly. Trying to solve an issue, you're likely to create new ones (corrupted data...). See unix.stackexchange.com/questions/8916/… for details. Commented Apr 28, 2015 at 11:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .