内容目录
直接改root报错
MariaDB [mysql]> update user set host="%" where User="root";
ERROR 1356 (HY000): View 'mysql.user' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
新建用户解决
CREATE USER 'new_username'@'%' IDENTIFIED BY 'new_password';
# 创建用户,'%'表示允许从任何主机连接
GRANT ALL PRIVILEGES ON *.* TO 'new_username'@'%' WITH GRANT OPTION;
# 授予所有数据库的权限,*.*就是所有数据库,如果是某个数据库,则是"db_name.*"
FLUSH PRIVILEGES;
# 刷新权限
近期评论