咨询热线:4006-75-4006

售前:9:00-23:30    备案:9:00-18:00    技术:7*24h

解决mysql创建数据库后出现:Access denied for user 'root'@'%' to database 'xxx'的问题

2018-02-05 17:21:53 16357次

错误代码:
Access denied for user 'root'@'%' to database 'xxx',通过查找相关的资料终于解决了这个问题

解决过程

1、创建数据库

create database mytest;

2.连接数据库,报以下错:

Access denied for user 'root'@'%' to database 'mytest'

原因:创建完数据库后,需要进行授权,在本地访问一般不会存在这个问题。

3.授权数据库操作

grant all on xxx.* to 'root'@'%' identified by 'password' with grant option;

其中:xxx代表创建的数据库; password为用户密码,在此为root的密码。


首页
最新活动
个人中心