• No related posts.

      • No related posts.

        • No related posts.

          • No related posts.

              No related posts.

            Repair a Mysql database

            When we try to repair a MySQL database we can stop the service. If you are using the MyISAM engine I recommend using myisamchk. A basic repair sentence could be like this:

            myisamchk -r -q -p -v –sort_buffer_size=2000M /var/lib/mysql/database/table.MYI

            The used parameters are the following:

            * -r recovery mode
            * -q quick recovery, the most common one. If this mode does not work you will have to make some research on your own.
            * -p creates the keys to be repared in parallel threads.
            * -v verbose mode
            * –sort_buffer_size= use this to indicate the size of the buffer to sort the keys. If you do not specify this value, or the value you specify is too small, then you will see something like this myisamchk: error: myisam_sort_buffer_size is too small. To solve this just increment the size of the buffer to be used, if the error always appear then you have a extremely big table.

            Related posts:

            1. Error : Database Error: Unable to connect to the database:The MySQL adapter “mysql” is not available.
            2. How much disk space a database takes?
            3. How to upgrade MySQL 5.0 to MySQL 5.1 cPanel
            4. Change mysql password
            5. NX Client Keyboard shortcuts
            This entry was posted in Tips & Tricks and tagged , .

            Leave a Reply