修改mysql密码2021年3月23日 | 数据库文章目录方法一1 2 3 4 MariaDB [mysql]> set password for root@localhost=password('xxoo321'); Query OK, 0 rows affected (0.00 sec) MariaDB [mysql]> flush privileges; Query OK, 0 rows affected (0.00 sec) 方法二1 2 3 4 5 MariaDB [mysql]> update user set password=password('ooxx233')where user='root'and host='localhost'; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0 MariaDB [mysql]> flush privileges; Query OK, 0 rows affected (0.00 sec) 方法三1 mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '123456!'; 原文作者:徐同学的博客原文链接:https://blogs.xwnlearn.cn/post/2021/%E4%BF%AE%E6%94%B9mysql%E5%AF%86%E7%A0%81/版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 4.0 国际许可协议. 进行许可,非商业转载请注明出处(作者,原文链接),商业转载请联系作者获得授权。相关文章Mysql一主一从MySQL练习题MySQL基础整理mysql常见报错数据库