DelphiFAQ Home Search:
General :: Databases :: mysql
General information about mysql - how to get around the differences between version 3.33 an 4, how to do stuff that you think you need a nested query for etc.


This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.

Featured Article

mysql: How can I rename a database


I want to rename my database from 'TEST' to something more meaningful. Do I have to make a backup, modify the SQL script and then restore it?


While that would work, there is an easier way. Shutdown the mysql server, rename the directory that stores the database from 'TEST' to your desired name. This 'TEST' directory is below the data directory. If you don't know where that is, try:

$ mysqladmin variables | grep datadir

After renaming, restart the MySQL server and check the grants - they might still contain references to the old database name.

You can also use a tool like phpMyAdmin (web interface to mysql) which has an option to rename a database.

Generated 16:01:01 on Oct 18, 2018