Get table or DB size im Megabyte

Sometimes it is really useful to know how large a certain database table has become. With the following SQL statement you get a list of all tables of the currently connected database with their rounded size in MB:

This query selects all tables from all connected databases. If you want to select a certain […]

Get current user, mysql version and other status information

To get information about the currently connected user and more MySQL status information, you can call the following command if you are already logged in:

This will give you an output like that:

As you can see, you got a lot more information like operation system data, MysSQL version or the number of slow […]

Check and optimize tables in MySQL

To check and optimize tables of a MySQL database:

To achieve the same for all databases of the respective MySQL server you can run the following command:

Further information about check and optimize tables in MySQL To get a few more facts about how to check and optimize tables in MySQL, you should […]

Find out where my.cnf is located

To find out where the MySQL configuration (my.cnf) is stored, you can use the strace command:

You will get an output showing all the paths the MySQL deamon searches for the my.cnf upon startup like that:

As you can see, the service searches the following files: /etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf /home/sheldon/.my.cnf But only the /etc/mysql/my.cnf is found […]