rename_username.sh to dump/restore databases

Version 1.51

Bugfix
Finished

Previous method was proposed to use the RENAME TABLE syntax, but we ended up just using the full mysqldump followed by a mysql restore, as it's more reliable, and covers more things like SUPER PRIVILEGES functions, stored procedures, etc.. Affected files: /usr/local/directadmin/scripts/change_username.sh /usr/local/directadmin/scripts/change_database_username.php /usr/local/directadmin/scripts/rename_database.sh With the new rename_database.sh script, a database can be easily renamed, eg: ./rename_database.sh user_old user_new But it doesn't update the 'user' portion of user_new, so at the moment shouldn't be used to fully transfer a DB between Users without change the username, so if you try and run: ./rename_database.sh user1_db user2_db the DB will be moved, but it won't correct update the Users that need to access it. causing a bit of a cross-User mess. The change_database_username.php is only for moving all Database that belong to a User, and not to move single DBs between Users.

Interested to try DirectAdmin? Get a 30-day Free Trial!