# centos access denied for user root

> [root@VM_0_5_centos ~]# mysql -u root -p Enter password:（输入您的密码） mysql> grant all privileges on *.* to root@'%' identifi…

- 原文：https://www.l2qq.com/article/84
- 发布：2019-10-21T07:10:22Z
- 更新：2020-06-12T09:51:01Z
- 作者：l2qq

---

[root@VM_0_5_centos ~]# mysql -u root -p
Enter password:（输入您的密码）
mysql> grant all privileges on *.* to root@'%' identified by '（密码）';

mysql> flush privileges;
mysql> quit
即可实现远程root登录，最好建议修改数据库端口
