change_database_username.php to use RENAME TABLE

Version 1.542


The php script is done: but not yet incorporated into script (a few changes needed there) Will need testing before release. -------------------------- Related to: The existing implementation of change_database_username.php is to rename the /var/lib/mysql/user_db folder to the new name. This method is flawed in that newer versions of MySQL can use special characters in the user_db folder name, which do not match the actual database name. Correct implementation is to get the list of databases from mysql itself, eg: SELECT Db from mysql.db WHERE Db LIKE '${username}\\_%' For each databse, create a new one with the new username. Then rename all tables from the old db to the new one. Important part will be checking and matching all settings on that database.. which will be where it may get messy (charset, etc..)

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