LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-01-2010, 03:02 AM   #1
perfectpol7
Member
 
Registered: Feb 2009
Posts: 84

Rep: Reputation: 15
Website database crashed


Hie guys out there. I am running ubuntu server for my website.When i logon to my website I am getting this database crashed with this error messages:
DB function failed with error number 145
Table './cmsmycompany/l2m_session' is marked as crashed and should be repaired SQL=SELECT session_id FROM l2m_session WHERE session_id=MD5('7fbe5d447d34103616a0c38c3212183f')
SQL =
SELECT session_id FROM l2m_session WHERE session_id=MD5('7fbe5d447d34103616a0c38c3212183f')

How do i repair the database and not all that good with sql but i can walk around easily.
 
Old 07-01-2010, 04:11 AM   #2
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
Hi

I've had the same problem, it can happen if you have a powerout or something. It usually means some index file is corrupt.

Stop mysql:
sudo /etc/init.d/mysql stop

Let myisamchk fix it:
sudo myisamchk --safe-recover /var/lib/mysql/databasename/tablename.MYI

(Change databasename and tablename to the proper names. From the error message, it looks like your database is cmsmycompany and your table is l2m_session)

Start mysql again:
sudo /etc/init.d/mysql start
 
Old 07-01-2010, 01:04 PM   #3
perfectpol7
Member
 
Registered: Feb 2009
Posts: 84

Original Poster
Rep: Reputation: 15
When I run myisamchk fix i get an error message that '/var/lib/mysql/databasename/tablename.MYI does not exist. When i restart the mysql I am getting not cleanly closed as follows:

sudo /etc/init.d/mysql start
* Starting MySQL database server mysqld [ OK ]
* Checking for corrupt, not cleanly closed and upgrade needing tables.

how do i clear this.
 
Old 07-01-2010, 05:03 PM   #4
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
The path to the file is wrong then. I would try to search for the file that needs fixing:

sudo locate l2m_session

If it outputs the .MYI a file, that's the filename to use for myisamchk. The message you get when restarting mysql is normal, but it doesn't always fix it automatically.
 
Old 07-03-2010, 07:33 AM   #5
perfectpol7
Member
 
Registered: Feb 2009
Posts: 84

Original Poster
Rep: Reputation: 15
Well after searching of the file I copy it and run the myisamchk and get the following output:-

perfectpol7:~$ sudo myisamchk --safe-recover /var/lib/mysql/cmsmycompany/l2m_session.MYI
- recovering (with keycache) MyISAM-table '/var/lib/mysql/cmsmycompany/l2m_session.MYI'
Data records: 31
Data records: 28
perfectpol7:~$ sudo /etc/init.d/mysql start
* Starting MySQL database server mysqld [ OK ]
* Checking for corrupt, not cleanly closed and upgrade needing tables.

But this seems not to repair, because I am still getting the same error. Is there anything should be done after running the myisamchk
 
  


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
seeking advice -total beginner- how to integrate website and membership database theduck70 Linux - Newbie 5 02-09-2009 03:18 AM
If I have public_html website for every user whereis MYSQL database for each user? RMLinux Linux - Newbie 1 12-02-2008 05:37 AM
Slow to browse MySQL database driven website on home server Broady Linux - Newbie 2 11-04-2007 06:47 PM
Database Programming (database to database transaction) johncsl82 Programming 7 02-02-2007 08:20 AM
Which database for Joomla website? LinuxSeeker Linux - Networking 2 07-09-2006 04:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:36 AM.

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