Backup mysql users

oldserver$ mysqldump -u root --password={mysqlpassword} mysql > mysql.sql
newserver$ mysql -u root --password={mysqlpassword} mysql < mysql.sql

Restart mysql or flush priviledges.
You may have to re-do the debian-sys-maint password after this.
Get the password from /etc/mysql/debian.cnf

Update:

mysql -u root --password={mysqlpassword}
use mysql;
update user set password=PASSWORD("{debiansysmaintpassword}") where User='debian-sys-maint';

Or make new:

> mysql -u root --password={mysqlpassword}
> GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY '{debiansysmaintpassword}' WITH GRANT OPTION;

Leave a Reply

Your email address will not be published. Required fields are marked *