1. 关闭 MySQL
$ systemctl stop mysql
2. 开启 MySQL 安全模式
$ mysqld_safe --skip-grant-tables &
3. 修改密码
MariaDB [(none)]> use mysql;
MariaDB [mysql]> UPDATE user SET password=PASSWORD("新密码") WHERE User='root';
MariaDB [mysql]> FLUSH PRIVILEGES;
MariaDB [mysql]> quit;
4. 开启与连接 MySQL
$ systemctl start mysql
$ mysql -h member.dlinkddns.com -u root -p
没有评论:
发表评论