Mysql创建用户后,执行grant授权命令,提示can't find any matching row in the user table
来源:互联网 发布:淘宝创业项目 编辑:程序博客网 时间:2024/05/18 21:07
在给新项目做数据库配置的时候,发现一个奇怪的问题:
使用命令:
mysql> insert into mysql.user(Host,User,Password) values("1.1.1.1","test",password("pswd"));
创建用户后,执行权限配置命令:
mysql> grant all privileges on testDB.* to 'test'@'1.1.1.1'identified by 'pswd';
会提示can't find any matching row in the user table,意思是在user表里找不到这个用户,但是直接用select 查询user表,是可以查到的。
原因是我们创建用户后,只是写入了user表,但是并没有及时写入权限表(grant table)。
所以需要在insert之后,执行 FLUSH PRIVILEGES命令,更新grant table,此时grant table里有了我们刚插入的用户,才能对它进行权限修改:
mysql> FLUSH PRIVILEGES;
然后再次执行:
mysql> grant all privileges on testDB.* to 'test'@'1.1.1.1'identified by 'pswd';
这次提示执行成功,但别忘了再执行一下:
mysql> FLUSH PRIVILEGES; 把改动及时写入grant table
0 0
- Mysql创建用户后,执行grant授权命令,提示can't find any matching row in the user table
- MySQL中报1133错误"Can't find any matching row in the user table"
- mysql给新用授予权限Can't find any matching row in the user table
- 解决:whm搬站出现的mysql error message:Can't find any matching row in the user table
- ERROR 1133 (42000): Can't find any matching row in the user table解决方法
- 解决Error(1133): Can’t find any matching row in the user table
- ERROR 1133 (42000): Can't find any matching row in the user table
- 解决Error (1133): Can’t find any matching row in the user table
- mysql错误Error(1133): Can’t find any matching row in the use
- mysql 创建外键时 提示 [Err] 1022 - Can't write; duplicate key in table '***'
- Mysql grant用户授权
- MySql 授权命令Grant
- MYSQL数据库 Can't find FULLTEXT index matching the column list
- MySQL 创建用户的Grant命令用法
- mysql update语句问题:You can't specify target table 'user' for update in FROM clause
- grant命令给用户授权,使mysql实现远程连接
- (已解决)sublime text 写程序build后提示can't find '__main__' module in ' '
- sublime text 写程序build后提示can't find '__main__' module in ' '
- Android 查看SDK版本
- 处理java日期的一些操作
- JSON
- sql server 2008 R2启动失败
- 166. Fraction to Recurring Decimal
- Mysql创建用户后,执行grant授权命令,提示can't find any matching row in the user table
- Transactional Synchronization Extensions
- 点击空白处隐藏div
- WebAPP(H5)与原生APP的交互设计区别
- RxJS 4.0 介绍
- http响应状态码大全(转)
- Knumbers
- SQL中日期函数的应用
- 网络