当前位置:   article > 正文

MariaDB 设置远程访问_grant all privileges on wordpress

grant all privileges on wordpress

首先,第一次登陆

mysql -uroot -p

创建一个数据库,例如为了安装WordPress我先创一个库
 

create database wordpress

然后我想要创建一个新的用户叫fan,然后密码是123456,并授权访问WordPress库;当然root也一样

  1. grant all on wordpress.* to fan@'localhost' identified by '123';
  2. grant all on wordpress.* to root@'localhost' identified by '123';

mariadb设置远程访问

  1. GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123' WITH GRANT OPTION;
  2. GRANT ALL PRIVILEGES ON *.* TO 'fan'@'%' IDENTIFIED BY '123' WITH GRANT OPTION;

修改权限。%表示针对所有IP,password表示将用这个密码登录root用户

最后,别忘了

FLUSH PRIVILEGES;

 

还有一种方式:

 

https://blog.csdn.net/u011424614/article/details/105717680

mysql -uroot -p
create database wordpress
grant all on wordpress.* to fan@'127.0.0.1' identified by 'fjh950107';
grant all on wordpress.* to fan@'localhost' identified by 'fjh950107';
grant all on wordpress.* to root@'localhost' identified by 'fjh950107';

mariadb设置远程访问
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'fjh950107' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'fan'@'%' IDENTIFIED BY 'fjh950107' WITH GRANT OPTION;
修改权限。%表示针对所有IP,password表示将用这个密码登录root用户

FLUSH PRIVILEGES;

提示403怎么办
https://blog.csdn.net/mxl00z/article/details/83041266

本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/代码探险家/article/detail/786621
推荐阅读
相关标签
  

闽ICP备14008679号