Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am in big trouble not able to access my mysql server.. after restarting

grep mysql /var/log/syslog is showing

Jul 30 14:30:23 of-desktop kernel: [ 4763.427066] type=1505 audit(1280480423.517:20):  operation="profile_replace" pid=11282 name="/usr/sbin/mysqld"
Jul 30 14:34:22 of-desktop kernel: [    8.780926] type=1505 audit(1280480662.866:5):  operation="profile_load" pid=803 name="/usr/sbin/mysqld"
Jul 30 14:34:24 of-desktop init: mysql main process (813) terminated with status 1
Jul 30 14:34:24 of-desktop init: mysql main process ended, respawning

while giving command

sudo service mysql start

it is hanging.

ctrl+c will end it. again giving the same command is

start: Job is already running: mysql

grep -v '^#" /etc/mysql/my.cnf

[client]
port        = 3306
socket      = /var/run/mysqld/mysqld.sock
[mysqld]
port        = 3306
socket      = /var/run/mysqld/mysqld.sock
skip-locking
key_buffer_size = 384M
max_allowed_packet = 1M
table_open_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size = 32M
thread_concurrency = 8
log-bin=mysql-bin
server-id   = 1
[mysqldump]
quick
max_allowed_packet = 16M
 [mysql]
no-auto-rehash
[myisamchk]
key_buffer_size = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M
 [mysqlhotcopy]
interactive-timeout

dpkg -l|grep mysql gives

ii  libdbd-mysql-perl                    4.012-1ubuntu1                                  A Perl5 database interface to the MySQL data
ii  libmysqlclient16                     5.1.41-3ubuntu12.3                              MySQL database client library
ii  libqt4-sql-mysql                     4:4.6.2-0ubuntu5                                Qt 4 MySQL database driver
ii  mysql-client                         5.1.41-3ubuntu12.3                              MySQL database client (metapackage depending
ii  mysql-client-5.1                     5.1.41-3ubuntu12.3                              MySQL database client binaries
ii  mysql-client-core-5.1                5.1.41-3ubuntu12.3                              MySQL database core client binaries
ii  mysql-common                         5.1.41-3ubuntu12.3                              MySQL database common files (e.g. /etc/mysql
ii  mysql-server                         5.1.41-3ubuntu12.3                              MySQL database server (metapackage depending
ii  mysql-server-5.1                     5.1.41-3ubuntu12.3                              MySQL database server binaries
ii  mysql-server-core-5.1                5.1.41-3ubuntu12.3                              MySQL database core server files
ii  php5-mysql                           5.3.2-1ubuntu4.2                                MySQL module for php5

grep mysql /var/log/daemon.log

Jul 30 14:30:23 of-desktop mysqld[11230]: 
Jul 30 14:30:23 of-desktop mysqld[11230]: PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
Jul 30 14:30:23 of-desktop mysqld[11230]: To do so, start the server, then issue the following commands:
Jul 30 14:30:23 of-desktop mysqld[11230]: 
Jul 30 14:30:23 of-desktop mysqld[11230]: /usr/bin/mysqladmin -u root password 'new-password'
Jul 30 14:30:23 of-desktop mysqld[11230]: /usr/bin/mysqladmin -u root -h of-desktop password 'new-password'
Jul 30 14:30:23 of-desktop mysqld[11230]: 
Jul 30 14:30:23 of-desktop mysqld[11230]: Alternatively you can run:
Jul 30 14:30:23 of-desktop mysqld[11230]: /usr/bin/mysql_secure_installation
Jul 30 14:30:23 of-desktop mysqld[11230]: 
Jul 30 14:30:23 of-desktop mysqld[11230]: which will also give you the option of removing the test
Jul 30 14:30:23 of-desktop mysqld[11230]: databases and anonymous user created by default.  This is
Jul 30 14:30:23 of-desktop mysqld[11230]: strongly recommended for production servers.
Jul 30 14:30:23 of-desktop mysqld[11230]: 
Jul 30 14:30:23 of-desktop mysqld[11230]: See the manual for more instructions.
Jul 30 14:30:23 of-desktop mysqld[11230]: 
Jul 30 14:30:23 of-desktop mysqld[11230]: Please report any problems with the /usr/bin/mysqlbug script!
Jul 30 14:30:23 of-desktop mysqld[11230]: 
Jul 30 14:30:23 of-desktop mysqld[11230]: The latest information about MySQL is available at http://www.mysql.com/
Jul 30 14:30:23 of-desktop mysqld[11230]: Support MySQL by buying support/licenses from http://shop.mysql.com/
Jul 30 14:30:23 of-desktop mysqld[11230]: 
Jul 30 14:30:23 of-desktop mysqld[11263]: #007/usr/sbin/mysqld: File './mysql-bin.index' not found (Errcode: 13)
Jul 30 14:30:23 of-desktop mysqld[11263]: 100730 14:30:23 [ERROR] Aborting
Jul 30 14:30:23 of-desktop mysqld[11263]: 
Jul 30 14:30:23 of-desktop mysqld[11263]: 100730 14:30:23 [Note] /usr/sbin/mysqld: Shutdown complete
Jul 30 14:30:23 of-desktop mysqld[11263]: 
Jul 30 14:30:23 of-desktop mysqld[11271]: #007/usr/sbin/mysqld: File './mysql-bin.index' not found (Errcode: 13)
Jul 30 14:30:23 of-desktop mysqld[11271]: 100730 14:30:23 [ERROR] Aborting
Jul 30 14:30:23 of-desktop mysqld[11271]: 
Jul 30 14:30:23 of-desktop mysqld[11271]: 100730 14:30:23 [Note] /usr/sbin/mysqld: Shutdown complete
Jul 30 14:30:23 of-desktop mysqld[11271]: 
Jul 30 14:30:23 of-desktop mysqld[11275]: #007/usr/sbin/mysqld: File './mysql-bin.index' not found (Errcode: 13)
Jul 30 14:30:23 of-desktop mysqld[11275]: 100730 14:30:23 [ERROR] Aborting
Jul 30 14:30:23 of-desktop mysqld[11275]: 
Jul 30 14:30:23 of-desktop mysqld[11275]: 100730 14:30:23 [Note] /usr/sbin/mysqld: Shutdown complete
Jul 30 14:30:23 of-desktop mysqld[11275]: 
Jul 30 14:30:23 of-desktop mysqld[11279]: #007/usr/sbin/mysqld: File './mysql-bin.index' not found (Errcode: 13)
Jul 30 14:30:23 of-desktop mysqld[11279]: 100730 14:30:23 [ERROR] Aborting
Jul 30 14:30:23 of-desktop mysqld[11279]: 
Jul 30 14:30:23 of-desktop mysqld[11279]: 100730 14:30:23 [Note] /usr/sbin/mysqld: Shutdown complete
Jul 30 14:30:23 of-desktop mysqld[11279]: 
Jul 30 14:34:24 of-desktop init: mysql main process (813) terminated with status 1
Jul 30 14:34:24 of-desktop init: mysql main process ended, respawning

what may be the problem? thanks ...

share|improve this question
    
Check mysql logs. –  lg. Jul 30 '10 at 9:27
    
/var/log/mysql folder is empty. any other places? –  Kumar Jul 30 '10 at 9:35
    
Check in the mysql datadir (/var/lib/mysql) and as Jasper suggested in /var/log/daemon.log. –  lg. Jul 30 '10 at 9:38
    
ls /var/lib/mysql debian-5.1.flag ibdata1 ib_logfile0 ib_logfile1 mysql mysql-bin.000001 mysql-bin.000002 mysql-bin.inde these are the files. –  Kumar Jul 30 '10 at 9:50
    
mysql-bin.inde or mysql-bin.index? The last is the file mysqld don't find. –  lg. Jul 30 '10 at 9:52

4 Answers 4

Have you checked /var/log/daemon.log? Maybe it is busy rebuilding/checking corrupt tables, might take a while if it crashed recently.

You could also try top, to see whether the mysql processes are not going zombie or being stalled waiting for I/O (Symbol D, in stead of S), in which case you might have a harddisk problem.

share|improve this answer
    
grep of /var/log/daemon.log added, but in top mysql is not there. –  Kumar Jul 30 '10 at 9:43

Did you change MySQL settings before restart? By restart, do you mean "Oops, my server crashed and during reboot MySQL failed to start up" or "I just tried to restart MySQL".

Two things you might like to check:

  • Are file permissions under /var/lib/mysql OK? Is MySQL user able to get there? Here's my /var/lib/mysql in Ubuntu 10.04:

    drwx------  4 mysql mysql 4.0K 2010-07-28 20:42 .
    drwxr-xr-x 68 root  root  4.0K 2010-07-28 15:13 ..
    -rw-r--r--  1 root  root     0 2010-07-28 13:04 debian-5.1.flag
    -rw-rw----  1 mysql mysql  10M 2010-07-28 20:42 ibdata1
    -rw-rw----  1 mysql mysql 5.0M 2010-07-28 20:42 ib_logfile0
    -rw-rw----  1 mysql mysql 5.0M 2010-07-28 13:04 ib_logfile1
    drwx------  2 mysql root  4.0K 2010-07-28 13:04 mysql
    
  • Did you change in paths under /etc/mysql/my.cnf? Perhaps MySQL is looking for mysql-bin.index from the wrong place?

share|improve this answer
    
the same dir i am also having.but some where it is getting strucked –  Kumar Jul 30 '10 at 10:02

Try to set datadir in your my.cnf, usually datadir=/var/lib/mysql.

share|improve this answer
    
modified, but no effect. –  Kumar Jul 30 '10 at 10:10
    
There is the mysql-bin.index file in datadir? Does logs tell always the same? –  lg. Jul 30 '10 at 10:13
    
file is there. In both syslog,and daemon.log last 2 lines repeating. –  Kumar Jul 30 '10 at 10:19

I found the problem. Yesterday i installed squid after that i disabled it.so no problem. when i restarting squid enabled automatically,and blocking mysql (i think). now i totally remove it, and now mysql working. I dont know why. But the problem is due to squid. Thanks for helping me. with love kumar.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.