Mysql安装使用报错

195 阅读1分钟
  •  ERROR 1410 (42000): You are not allowed to create a user with GRANT

注释:host='%'代表任何客户机可以连接;host='localhost'仅本地连接;

用root登录,先重新设置root的权限,再设置test用户
use mysql;
update user set host='%' where user='root';
flush privileges;
grant all privileges on *.* to 'root'@'%'
flush privileges;
update set set host='%' where user='test';
grant all privileges on *.* to 'test'@'%';
  • 删除批量表
select concat('drop table ', TABLE_NAME, ';') from information_schema.TABLES
where TABLE_SCHEMA = 'test' and TABLE_NAME LIKE 'A_%';
  • 执行sql脚本后,show tables能查看数据,使用数据库连接工具查不到 执行sql记得切换用户为test,不用用root执行