You are not logged in.

#1 2011-03-06 17:51:18

SkyTod
Member
Registered: 2009-09-01
Posts: 226

[Solved]Can't load mysql after long time of idle

Phpmyadmin:

#2002 Cannot log in to the MySQL server
/etc/rc.d/mysqld restart
:: Stopping MySQL Server                                                                                                                                              [FAIL] 
:: Starting MySQL Server                                                                                                                                              [FAIL]

Did everything in archwiki.
Webmin used to write:

SQL select * from tables_priv order by table_name failed : Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) 

Where can i find log file? There in no one in /var/log/

cat /var/lib/mysql/myhost.err
…
110306 18:53:22 mysqld_safe mysqld from pid file /var/lib/mysql/myhost.pid ended
110306 18:53:25 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
/usr/bin/mysqld: Table 'mysql.plugin' doesn't exist
110306 18:53:25 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
110306 18:53:25 InnoDB: The InnoDB memory heap is disabled
110306 18:53:25 InnoDB: Mutexes and rw_locks use GCC atomic builtins
110306 18:53:25 InnoDB: Compressed tables use zlib 1.2.5
110306 18:53:25 InnoDB: Initializing buffer pool, size = 128.0M
110306 18:53:25 InnoDB: Completed initialization of buffer pool
110306 18:53:25 InnoDB: highest supported file format is Barracuda.
110306 18:53:25  InnoDB: Waiting for the background threads to start
110306 18:53:26 InnoDB: 1.1.5 started; log sequence number 1589359
110306 18:53:26 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
110306 18:53:26 mysqld_safe mysqld from pid file /var/lib/mysql/myhost.pid ended
110306 18:54:26 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
110306 18:54:26 InnoDB: The InnoDB memory heap is disabled
110306 18:54:26 InnoDB: Mutexes and rw_locks use GCC atomic builtins
110306 18:54:26 InnoDB: Compressed tables use zlib 1.2.5
110306 18:54:26 InnoDB: Initializing buffer pool, size = 128.0M
110306 18:54:26 InnoDB: Completed initialization of buffer pool
110306 18:54:26 InnoDB: highest supported file format is Barracuda.
110306 18:54:26  InnoDB: Waiting for the background threads to start
110306 18:54:27 InnoDB: 1.1.5 started; log sequence number 1589359
110306 18:54:27 [Note] Recovering after a crash using mysql-bin
110306 18:54:27 [Note] Starting crash recovery...
110306 18:54:27 [Note] Crash recovery finished.
110306 18:54:27 [Warning] Can't open and lock time zone table: Table 'mysql.time_zone_leap_second' doesn't exist trying to live without them
110306 18:54:27 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
110306 18:54:27 [ERROR] Native table 'performance_schema'.'events_waits_current' has the wrong structure
110306 18:54:27 [ERROR] Native table 'performance_schema'.'events_waits_history' has the wrong structure
110306 18:54:27 [ERROR] Native table 'performance_schema'.'events_waits_history_long' has the wrong structure
110306 18:54:27 [ERROR] Native table 'performance_schema'.'setup_consumers' has the wrong structure
110306 18:54:27 [ERROR] Native table 'performance_schema'.'setup_instruments' has the wrong structure
110306 18:54:27 [ERROR] Native table 'performance_schema'.'setup_timers' has the wrong structure
110306 18:54:27 [ERROR] Native table 'performance_schema'.'performance_timers' has the wrong structure
110306 18:54:27 [ERROR] Native table 'performance_schema'.'threads' has the wrong structure
110306 18:54:27 [ERROR] Native table 'performance_schema'.'events_waits_summary_by_thread_by_event_name' has the wrong structure
110306 18:54:27 [ERROR] Native table 'performance_schema'.'events_waits_summary_by_instance' has the wrong structure
110306 18:54:27 [ERROR] Native table 'performance_schema'.'events_waits_summary_global_by_event_name' has the wrong structure
110306 18:54:27 [ERROR] Native table 'performance_schema'.'file_summary_by_event_name' has the wrong structure
110306 18:54:27 [ERROR] Native table 'performance_schema'.'file_summary_by_instance' has the wrong structure
110306 18:54:27 [ERROR] Native table 'performance_schema'.'mutex_instances' has the wrong structure
110306 18:54:27 [ERROR] Native table 'performance_schema'.'rwlock_instances' has the wrong structure
110306 18:54:27 [ERROR] Native table 'performance_schema'.'cond_instances' has the wrong structure
110306 18:54:27 [ERROR] Native table 'performance_schema'.'file_instances' has the wrong structure
110306 18:54:27 [Note] /usr/bin/mysqld: ready for connections.
Version: '5.5.9-log'  socket: '/var/run/mysqld/mysqld.sock'  port: 0  Source distribution
110306 19:11:24 [Note] /usr/bin/mysqld: Normal shutdown

110306 19:11:26 [Warning] /usr/bin/mysqld: Forcing close of thread 1  user: 'root'

110306 19:11:26  InnoDB: Starting shutdown...
110306 19:11:26  InnoDB: Shutdown completed; log sequence number 1589359
110306 19:11:26 [Note] /usr/bin/mysqld: Shutdown complete
mysql_upgrade
Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/var/run/mysqld/mysqld.sock' '--port=3306' '--socket=/var/run/mysqld/mysqld.sock' 
mysqlcheck: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) when trying to connect
FATAL ERROR: Upgrade failed

What can I do now, huh?
Thanks in advance!

P.S. How can I delete (not drop) all datebase in /var/lib/mysql ?

Last edited by SkyTod (2011-03-11 09:32:16)

Offline

#2 2011-03-07 08:32:07

Spider.007
Member
Registered: 2004-06-20
Posts: 1,176

Re: [Solved]Can't load mysql after long time of idle

Well, it seems your db is fubar, therefore it can't check privileges and you cannot login. I guess starting all-over again is your only option. I would `sudo rm -R /var/lib/mysql` completely, and re-install mysql. That way a new structure will get created and you should be able to use mysql normally again. It might also be a good idea to find out what caused this corruption, did you run out of space, or reboot at the wrong moment?

Offline

#3 2011-03-07 12:03:01

SkyTod
Member
Registered: 2009-09-01
Posts: 226

Re: [Solved]Can't load mysql after long time of idle

rm -R /var/lib/mysql
pacman -S mysql

And the same:

/etc/rc.d/mysqld restart
:: Stopping MySQL Server                                                                                                                                              [FAIL] 
:: Starting MySQL Server                                                                                                                                              [FAIL]
Spider.007 wrote:

It might also be a good idea to find out what caused this corruption, did you run out of space, or reboot at the wrong moment?

Sorry I can't remember. Maybe light was turned off during some important transaction. I can't be sure. I didn't use mysql for a long time till now.

Some mistake of settings, I guess. But how can I find out where without logs?

Offline

#4 2011-03-07 14:22:22

Spider.007
Member
Registered: 2004-06-20
Posts: 1,176

Re: [Solved]Can't load mysql after long time of idle

Did you remove the mysql package before installing it again? I suspect the re-creation of /var/lib/mysql is only done on installation, not upgrading or re-installing

Offline

#5 2011-03-07 17:00:53

SkyTod
Member
Registered: 2009-09-01
Posts: 226

Re: [Solved]Can't load mysql after long time of idle

It doesn't depend.  Any ideas?

Offline

#6 2011-03-09 15:03:37

Spider.007
Member
Registered: 2004-06-20
Posts: 1,176

Re: [Solved]Can't load mysql after long time of idle

is the error in myhost.err the same after a reinstall? What are the contents of /var/lib/mysql?

You might try the installation commands as described here

Offline

#7 2011-03-09 19:07:49

SkyTod
Member
Registered: 2009-09-01
Posts: 226

Re: [Solved]Can't load mysql after long time of idle

cat /var/lib/mysql/myhost.err
110307 19:12:05 mysqld_safe mysqld from pid file /var/lib/mysql/myhost.pid ended
110308 08:55:24 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
110308  8:55:25 InnoDB: The InnoDB memory heap is disabled
110308  8:55:25 InnoDB: Mutexes and rw_locks use GCC atomic builtins
110308  8:55:25 InnoDB: Compressed tables use zlib 1.2.5
110308  8:55:25 InnoDB: Initializing buffer pool, size = 128.0M
110308  8:55:25 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
110308  8:55:25  InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
110308  8:55:26  InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
110308  8:55:27  InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: 127 rollback segment(s) active.
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
110308  8:55:29  InnoDB: Waiting for the background threads to start
110308  8:55:30 InnoDB: 1.1.5 started; log sequence number 0
110308  8:55:32 [Note] Event Scheduler: Loaded 0 events
110308  8:55:32 [Note] /usr/bin/mysqld: ready for connections.
Version: '5.5.9-log'  socket: '/var/run/mysqld/mysqld.sock'  port: 0  Source distribution
110308 23:46:42 [Note] /usr/bin/mysqld: Normal shutdown

110308 23:46:42 [Note] Event Scheduler: Purging the queue. 0 events
110308 23:46:42  InnoDB: Starting shutdown...
110308 23:46:43  InnoDB: Shutdown completed; log sequence number 1595675
110308 23:46:43 [Note] /usr/bin/mysqld: Shutdown complete                                                                                                                    
                                                                                                                                                                             
110308 23:46:43 mysqld_safe mysqld from pid file /var/lib/mysql/myhost.pid ended                                                                                             
110309 09:52:34 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql                                                                                        
110309  9:52:35 InnoDB: The InnoDB memory heap is disabled                                                                                                                   
110309  9:52:35 InnoDB: Mutexes and rw_locks use GCC atomic builtins                                                                                                         
110309  9:52:35 InnoDB: Compressed tables use zlib 1.2.5                                                                                                                     
110309  9:52:35 InnoDB: Initializing buffer pool, size = 128.0M                                                                                                              
110309  9:52:35 InnoDB: Completed initialization of buffer pool                                                                                                              
110309  9:52:35 InnoDB: highest supported file format is Barracuda.                                                                                                          
110309  9:52:36  InnoDB: Waiting for the background threads to start                                                                                                         
110309  9:52:37 InnoDB: 1.1.5 started; log sequence number 1595675                                                                                                           
110309  9:52:37 [Note] Event Scheduler: Loaded 0 events                                                                                                                      
110309  9:52:37 [Note] /usr/bin/mysqld: ready for connections.                                                                                                               
Version: '5.5.9-log'  socket: '/var/run/mysqld/mysqld.sock'  port: 0  Source distribution
ls /var/lib/mysql                                                                                                                                           
ibdata1      ib_logfile1  myhost.pid  mysql-bin.000001  mysql-bin.000003  mysql-bin.index     test                                                                           
ib_logfile0  myhost.err   mysql       mysql-bin.000002  mysql-bin.000004  performance_schema      

Offline

#8 2011-03-11 08:16:48

Spider.007
Member
Registered: 2004-06-20
Posts: 1,176

Re: [Solved]Can't load mysql after long time of idle

Well, it seems to run just fine now; can you connect using mysql-client?

Offline

#9 2011-03-11 09:31:41

SkyTod
Member
Registered: 2009-09-01
Posts: 226

Re: [Solved]Can't load mysql after long time of idle

Yeah. Thanks. It works. I hope it's not for only this time.

Offline

Board footer

Powered by FluxBB