关于mariadb(mysql)的授权

授权之前必须创建用户才能授权

create user '用户'@'主机或者%(所有主机)' identified by '密码';

create user 'root'@'%' identified by '123qwe'; 

GRANT ALL  ON *.* TO '已有的用户'@'主机' IDENTIFIED BY '密码';

GRANT ALL  ON *.* TO 'root'@'%' IDENTIFIED BY '123qwe';

如果远程不能查看需要的库需要在vim /etc/my.cnf 中进入授权

[mysqld]
skip-grant-tables

修改后需要停了再开

posted @ 2019-11-18 20:06  Le1543  阅读(381)  评论(0编辑  收藏  举报