MySQL: new user methods: ALTER USER, DROP USER, etc. (SCRIPTS)

Version 1.56.0


TODO: Known bug: MySQL 8.0 does not allow "IDENTIFIED BY" with GRANT, so that also needs to be changed. Relating to the forum request: We've added an internal option: mysql_use_new_user_methods=0 where if you set it to 1 in the directadmin.conf and restart directadmin: mysql_use_new_user_methods=1 DirectAdmin will use the newer methods for controlling accounts, such as: ALTER USER DROP USER RENAME USER GRANT/REVOKE USER .... Users are still added to DBs as before, using the GRANT option. Listings of accounts will continue to use the SELECT method, local retrieval shouldn't affect saving to a cluster. T12523 =================== SCRIPTS change_database_username.php removed the old UPDATE mysql.user and UPDATE mysql.db methods, in favor of the RENAME USER for the system account name. Had to loop through each access host for it to apply to all entries, but it simplies this in that is covers both mysql.user and mysql.db in one call. ==================== MAJOR CODE REWRITE There was a massive number of query lines touched, and new function calls created to handle this alteration (the "diff" output has 20 pages of line changes) The main issue was that the previuos UPDATE calls handled all "host" entries by simply omitting them. The ALTER/DROP/RENAME, etc.. all require the specific host to be used (cannot specify %, as that's also a literal value), so functions with loops to query all hosts, and update every entry one by one were needed. As such, during the BETA release phase, this would be a key point for testing, backup/restore, as well as db/user creation, password changing, access host adding/removing, and privilege changing. Also, the new GRANT/REVOKE method (also requires calling once per host), but if you set all privileges to "No" ('N'), the REVOKE call will actually fully delete the line from the mysql.db, which is not what we want. So DA now blocks anytime you try to set N for every privilege, only for the mysql_user_new_user_methods=1 (0 still allows it)

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