LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 05-14-2007, 08:06 AM   #1
duffmckagan
Senior Member
 
Registered: Feb 2005
Distribution: Cent OS 6.4
Posts: 1,163

Rep: Reputation: 49
MySQL problem - server cannot start


The following version is installed on my system:

Code:
mysql-server:
  Installed: 5.0.32-7etch1
  Candidate: 5.0.32-7etch1
  Version table:
 *** 5.0.32-7etch1 0
        500 ftp://ftp.iitm.ac.in stable/main Packages
        100 /var/lib/dpkg/status

After attempting to run "mysqld" it gives the following error:

Code:
070514 18:35:16  InnoDB: Started; log sequence number 0 43655
070514 18:35:16 [Note] Recovering after a crash using /var/log/mysql/mysql-bin
070514 18:35:16 [Note] Starting crash recovery...
070514 18:35:16 [Note] Crash recovery finished.
070514 18:35:16 [ERROR] mysqld: Table './mysql/user' is marked as crashed and should be repaired
070514 18:35:16 [ERROR] mysqld: Table './mysql/user' is marked as crashed and should be repaired
070514 18:35:16 [ERROR] Fatal error: Can't open and lock privilege tables: Table './mysql/user' is marked as crashed and should be repaired
Please help.

PS: Problems started only after I changed testing to etch and did a dist-upgrade
 
Old 05-15-2007, 01:49 AM   #2
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
try something like mysqld --skip-grant to have mysql start without the grant table. At least the server should start now. Then just to a repair of the tables and you should be set.
 
Old 05-28-2007, 12:13 PM   #3
canegames
Member
 
Registered: Mar 2006
Posts: 72

Rep: Reputation: 15
Exclamation How do you repair tables? Do you mean grant permision?

My Server started fine thanks. But how do I repair the tables. Is it the grant permissions?
 
Old 05-30-2007, 04:18 AM   #4
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
Now start the mysql console with

mysql

then select the database where the broken tables are and do

repair table tablename_to_repair

In your case it would be

use mysql;
repair table user;


If more then one table is broken you could write a php script that loops through all databases then loops through all tables and does a repair.

Pseudo code starts here
Code:
mysql_connect();
$DBs = mysql_query("Show databases");
foreach ($DBs as $DB){
  mysql_query("Use $DB");
  $Tables = mysql_query("Show tables");
  foreach ($Tables as $Table){
    mysql_query("Repair table $Table");
  }
}
Hope that helps. Else just check back and I help you out.

Edit:

By the way a dist-upgrade does a version upgrade to the newest version. Mosttimes this is the unstable developer version. If you just want to keep uptodate do a
apt-get upgrade

Last edited by zhjim; 05-30-2007 at 04:20 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
can't start mysql server vito_huang Linux - Server 1 03-10-2007 07:36 AM
how do I start mysql server? barrythai SUSE / openSUSE 4 04-05-2006 05:46 PM
mysql server does not start up prasanta Linux - Newbie 2 01-05-2006 01:07 PM
Trying to start Mysql server number11 Linux - Newbie 3 06-06-2005 01:59 PM
MySQL server doesn't want to start AJ_Cantos Linux - Software 7 11-29-2004 04:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 05:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration