Renaming a table in MySQL

Sometimes you need to rename a table in MySQL. You either run an SQL query to do this or do it with phpMyAdmin if you don’t want to bother remembering the SQL to do so. This post looks at how to rename a table  in MySQL either with a SQL query or using phpMyAdmin. The …

Read more

Listing MySQL tables with PHP

This post shows how to use the MySQL "SHOW TABLES FROM" SQL query to get a list of tables using PHP. This list could either be stored to an array or echoed out to web browser, command line etc.

Reset the auto increment value for a MySQL table

It is possible to reset the auto increment value of a MySQL auto incremental primary key to a new value, either higher or lower than what it would otherwise next be. This post looks at how to do this using a MySQL query and also with phpMyAdmin. The following example changes the auto increment value …

Read more

Show indexes for a table with MySQL

MySQL has a SQL query "SHOW INDEX FROM" which returns the indexes from a table. This post looks at some example usage of this query to get a list of indexes and a list of primary keys for a table with MySQL.