Page 1 of 1

Mysql database engine

Posted: Sat Nov 12, 2016 11:04 am
by Chester
Hi,

Can anyone suggest me a database engine to manage the MySQL repair .And also please let me know the commands to repair the tables for the corresponding engine.

Re: Mysql database engine

Posted: Sat Nov 12, 2016 11:32 am
by shaan N
Hello Chester,

MyISAM and InnoDB are most commonly used database engines.MyISAM is considered as the fastest engine when compared to InnoDB but due to the reason since MyISAM is not transacted and doesn't implement foreign key constraints InnoDB can be considered as the most common Engine used widely.

Commands to repair Database and Table through InnoDB,
-------------------
For checking the all database,

# mysqlcheck -c -u root -p --all-databases

To check a specific DATABASE

# mysqlcheck -c "DATABASE name" -u root -p

-Checks all the tables under the mentioned database name

#mysqlcheck -c "DATABASE name" "TABLE name" -u root -p

-Checks the mentioned tables under the DATABASE name

However if a mysql table passes the check it will display the "OK" for the table.

If the database table has displayed any error means we can repair the table by the following command,

# mysqlcheck -r "DATABASE name" "Table name" -u root -p

-Repair and optimization of tables for all databases

There's a simple command to automatically check, repair and optimize all tables in all databases when running a MySQL server on Linux/Unix/BSD.

# mysqlcheck -u root -p --auto-repair --check --optimize --all-databases

--------------------------