mysql创建数据库后出现Access denied for user 'root'@'%' to database ‘xxxx’

摘自网络

create database test1;  

1create database test1;


 
  创建完数据库后,通过远程连接提示

 

Access denied for user 'root'@'%' to database ‘xxxx’  

1Access denied for user 'root'@'%' to database ‘xxxx’




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


  解决办法:

 
  执行授权
 

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

  1.   
  2. xxxx代表创建的数据库;   
  3. password为用户密码,在此为root的密码  
1grant all on xxxx.* to 'root'@'%' identified by 'password' with grant option;
2 
3xxxx代表创建的数据库;
4password为用户密码,在此为root的密码




完成后即可11111

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值