views:

53

answers:

4

How do you rename a MySQL table in PHPMyAdmin? (SQL command?)

Are MySQL table names case-sensitive when working with PHP?

+2  A: 

Hit the Operations tab when browsing a table to rename it. Names are case-sensitive in Linux, insensitive in Windows.

Calvin L
Thanks. It worked. I'll wait for the required 11 more minutes to select this answer.
Moshe
+2  A: 

You can use the RENAME TABLE syntax:

RENAME TABLE old_name TO new_name

...but the caveat is that no one can be accessing the table when you execute the statement.

Case sensitivity is dependent on the collation - collations ending with "_ci" means "Case Insensitive". The client, in your case PHPMyAdmin, can have it's collation which is different from the MySQL instance's collation... and tables can have their own collation. See the MySQL Collation documentation for more info.

OMG Ponies
A: 

In phpMyAdmin all you need to do is click on the table, and then click on the 'Operations' tab. Once there, you will see 'Rename Table To'. Change this field and your should be good to go.

judda
+2  A: 

The table name case sensitivity is controlled by lower_case_table_names server variable:

http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html#sysvar_lower_case_table_names

Mchl