DelphiFAQ Home Search:

mysql: How can I rename a database

 

comments23 comments. Current rating: 4 stars (16 votes). Leave comments and/ or rate it.

Question:

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?

Answer:

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.


Comments:

You are on page 2 of 2, other pages: 1 [2]
2020-06-24, 10:11:20
Aurora from United Kingdom  
rating
Great blog here! Also your web site loads up very
fast! What host are you using? Can I get your affiliate link to your host?
I wish my site loaded up as quickly as yours lol
2020-06-27, 18:37:29
Candy  
rating
prednisone cost
2020-06-29, 09:25:15
Brooke  
rating
chloroquine phosphate aquarium
2020-06-30, 21:07:03
Lilliana  
rating
erectile dysfunction medicines viagra
2020-07-05, 01:04:38
Hong from Uzbekistan  
rating
canada cialis
2020-07-06, 01:16:52
Kelvin  
rating
cephalexin 250 mg for humans
2020-07-06, 21:17:21
Glenn from Germany  
rating
viagra alternatives
2020-07-09, 19:17:13
Florrie  
rating
gnc #1 male enhancement
You are on page 2 of 2, other pages: 1 [2]

 

 

NEW: Optional: Register   Login
Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option, or post under a registered account.
 

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity.
The owner of this web site reserves the right to delete such material.

photo Add a picture: