Arez Posted November 16, 2007 Share Posted November 16, 2007 I've been trying to rename a DB, but haven't found out how. The best I know of is to go into the directory the databases are stored, and rename the folder itself. They say that you should restart MySQL after that process though. So, is there another way to rename the DB, and how do I restart MySQL?? Quote Link to comment https://forums.phpfreaks.com/topic/77664-solved-renaming-a-db-and-restarting-mysql/ Share on other sites More sharing options...
pocobueno1388 Posted November 16, 2007 Share Posted November 16, 2007 Not sure if this will help or not Stop the MySQL Server. Find the data directory that stores the database. If you don't know where that is, try: $ mysqladmin variables | grep datadir Rename the directory that stores the database to the new name you want to use for the database. Now restart the MySQL server. You will have to check any grant permissions for the database... They still might contain references to the old databse name !! WINDOWS XP Stop the MySQL Server: - Open Control panel / administration tools / services - Select Mysql, and press stop Find the data directory that stores the database. In a default install, it will most likely be in C:\Program Files\MySQL\MySQL Server 4.1\data Rename the directory that stores the database to the new name you want to use for the database. Now restart the MySQL server: - Use Control panel / administration tools / services - Select Mysql, and press start You will have to check any grant permissions for the database... They still might contain references to the old databse name !! Source: http://www.faqts.com/knowledge_base/view.phtml/aid/1262 Quote Link to comment https://forums.phpfreaks.com/topic/77664-solved-renaming-a-db-and-restarting-mysql/#findComment-393213 Share on other sites More sharing options...
Arez Posted November 17, 2007 Author Share Posted November 17, 2007 Worked wonderfully, thanks Quote Link to comment https://forums.phpfreaks.com/topic/77664-solved-renaming-a-db-and-restarting-mysql/#findComment-393556 Share on other sites More sharing options...
pocobueno1388 Posted November 17, 2007 Share Posted November 17, 2007 Please press solved =] Quote Link to comment https://forums.phpfreaks.com/topic/77664-solved-renaming-a-db-and-restarting-mysql/#findComment-393585 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.