Find duplicate entries in a MySQL Table

You can use the following query to get all duplicated records of a MySQL table having equal values for the respective field:

This query will give you a list of all the entries having the same value for fieldname. It also will show the amount of duplicates.

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 […]