Repairing the MySQL database

Article:HOWTO59404  |  Created: 2011-10-04  |  Updated: 2011-10-04  |  Article URL http://www.symantec.com/docs/HOWTO59404
Article Type
How To


Subject


Repairing the MySQL database

Symantec Support may ask you to check the status of the MySQL database. If the check results in an error message, repair the database.

You must know the MySQL password to check or repair the database.

To repair the MySQL database on Windows

  1. On the Windows taskbar, click Start > Run.

  2. In the Open box, type the following text:

    cmd.exe

  3. Click OK.

  4. At the command prompt, type the following command:

    mysqlcheck --user=brightmailuser --host=127.0.0.1 --
    password=<password> brightmail --auto-repair > check.txt 
    C:\Program Files\Symantec\SMSSMTP\MySQL\Bin>mysqlcheck --
    user=brightmailuser --host=127.0.0.1 --password=PASSWORD 
    brightmail --auto-repair > check.txt

    This command repairs the corrupted tables and places the results in the file check.txt. The amount of time it takes to get results depends on the size of the MySQL database. The larger the database, the longer the time.

  5. Press Enter.

  6. After the MySQL check finishes, type the following command to see the results:

    notepad check.txt

    All tables should have the message of OK or Table is already up-to-date next to them. If they do not, you must repair them manually.

  7. To repair a specific table, log on to MySQL with the following command:

    mysql --host=127.0.0.1 --user=brightmailuser --
    password=<password> brightmail
  8. At the command prompt, type the following command:

    repair table <tablename>

    where <tablename> is the name of the corrupted table.

    After the repair finishes, a table appears. Check and ensure that the status field contains the words "OK."

    Repeat the command for each corrupted table.

  9. Close the command prompt.

To repair the MySQL database on Linux

  1. Open a command prompt.

  2. At the prompt, type the following command to change to the MySQL directory:

    cd /opt/symantec/sbas/ControlCenter/MySQL/ Mysql-pro-4.0.16
    -pc-linux-i686/bin cd /opt/Symantec/SMSSMTP/mysql/bin

    If your MySQL installation is in a different location, use that path.

  3. If the status check returns an error, type the following command:

    ./mysqlcheck --host=127.0.0.1 --user=brightmailuser --
    password=<password> brightmail --auto-repair > check.txt

    This repairs the corrupted tables and places the results in the file check.txt. The amount of time it takes to get results depends on the size of the MySQL database. The larger the database, the longer the time.

  4. After the MySQL check finishes, type the following command to see the results:

    vi check.txt

    All tables should display the message OK or Table is already up-to-date next to them. If they do not, you must repair them manually.

  5. To repair a specific table, log onto MySQL with the following command:

    ./mysql --host=127.0.0.1 --user=brightmailuser --
    password=<password> brightmail
  6. At the prompt, type the following:

    repair table <tablename>

    where <tablename> is the name of the corrupted table.

    After the repair of the table finishes, a table appears. Check that the status field contains the word "OK."

  7. Repeat the command for each corrupted table.

To repair the MySQL database on Solaris

  1. Open a command prompt.

  2. At the prompt, type the following command to change to the MySQL directory:

    cd /opt/symantec/sbas/ControlCenter/mysql-pro-4.0.16-
    sun-solaris2.8-sparc/bin cd /opt/Symantec/SMSSMTP/mysql/bin

    If your MySQL installation is in a different location, use that path.

  3. If the status check returns an error, type the following command:

    ./mysqlcheck --host=127.0.0.1 --user=brightmailuser --
    password=<password> brightmail --auto-repair > check.txt

    This repairs the corrupted tables and places the results in the file check.txt. The time to put the results in the file depends on the size of the MySQL database. The larger the database, the longer the time.

  4. After the MySQL check finishes, type the following command to see the results:

    vi check.txt

    All tables should have the message of OK or Table is already up-to-date next to them. If they do not, you must repair them manually.

  5. To repair a specific table, log onto MySQL using the following command:

    ./mysql --host=127.0.0.1 --user=brightmailuser --
    password=<password> brightmail
  6. At the prompt, type the following command:

    repair table <tablename>

    where <tablename> is the name of the corrupted table. After the repair finishes, a table appears. Check that the status field contains the word OK.

  7. Repeat the command for each corrupted table.


Legacy ID



v41520307_v64406064


Article URL http://www.symantec.com/docs/HOWTO59404


Terms of use for this information are found in Legal Notices