The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

mysqld.log tweak

Discussion in 'General Discussion' started by cyanide, Jun 7, 2005.

  1. cyanide

    cyanide Well-Known Member

    Joined:
    Aug 11, 2003
    Messages:
    106
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Toronto, Canada
    Anyone know if mysqld.log can be tweaked to show the database name?
    Right now, errors show up, like this
    Code:
    050607 11:40:29 /usr/sbin/mysqld: Can't open file: 'some_table.MYI'. (errno: 145)
    Unfortunately, if I have many tables with the same name in different databases, I don't know which database it refers to

    Any suggestions ?
     
  2. amal

    amal Well-Known Member

    Joined:
    Nov 22, 2003
    Messages:
    155
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Are you receiving these errors when you start the MySQL. If so, it could be the main mysql database itself... To fix, just run

    cd /var/lib/mysql/mysql
    myisamchk -r some_table.MYI

    Hope, this fixes your issue.. :)
     
  3. cyanide

    cyanide Well-Known Member

    Joined:
    Aug 11, 2003
    Messages:
    106
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Toronto, Canada
    oh, hey... thanks alot for the response.

    actually, I know how to fix the error, but I'm wondering how can i have the log file show which database it is ?

    For example, I have 10 databases. And, all of them have the same table > some_table
    So, when this error comes up, how do I know which database it refers to ?

    make sense ?
     
  4. amal

    amal Well-Known Member

    Joined:
    Nov 22, 2003
    Messages:
    155
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    cPanel Access Level:
    Root Administrator
    I don't think, there is such an option.. :(

    And if you are getting this error when you start the mysql, and mysql doesn't start successfully, it could most probably be with the database - mysql.

    And if at all you want to check all the files with the same filename and see if there is a problem, you can use the command -

    find /var/lib/mysql -iname some_table.MYI | xargs myisamchk -c

    Pipe it with suitable error codes to get a more filtered output.. :)

    Note: myisamchk -c just checks and verifies whether a database is corrupted. It doesn't repair.

    Hope, this is enough.. :)
     
  5. cyanide

    cyanide Well-Known Member

    Joined:
    Aug 11, 2003
    Messages:
    106
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Toronto, Canada
    Thanks again for the response.

    I've got some pretty big databases and they crash/corrupt once in a while.
    So, I end up having to run mysqlcheck -r
     
Loading...

Share This Page