If you are using MySQL Server and have to work through the command prompt, following are a few very handy statements: It shows the list of tables that exist in the database currently in use. Returns the structure of the table mentioned. Returns more information about the table. Returned information includes engine type, number of rows, data length, index length, checksum, creation time etc. Returns the CREATE statement that was used to create the table specified. It is useful in case we want to create the same table again -or with a slight modification. This statement shows the list privileges that the current user has. There are a number of other SHOW commands which you could see in1 MySQL Reference Manual Note: There is no SHOW command for displaying procedures. In order to see the list of procedures in the database, you can use following command: This command will extract the procedure name, database name, and list of parameters that these procedures operate on. Use the above statement to see the definitions of all the procedures/functions. It’s a useful command to dump the specified table into a text file. The above command, mysqldump, also dumps a table into a file but in addition it also includes the table drop and table creation statements in the file. If you want to execute a set of SQL commands in one go -then write them into a text file (called a SQL script file and is generally stored with a .sql extension) and use the above command to execute them all. If you are on the shell prompt you can use the following command to do the same: As I said this is a ready reference list for me, I keep on adding new statements to this list as I come across during my work. I hope these were useful for you. Please let me know if you have more such MySQL commands. We can grow this list together. Comment * Name * Email * Website
Δ