新建数据库用户及数据库,并且赋予权限。


create user ‘wordpress’@’localhost’ identified by ‘wordpress';

create database wordpress default character set utf8 collate utf8_general_ci;

grant all on wordpress.* to ‘wordpress’@’localhost';


 


更改数据库的访问权限,允许哪些主机使用哪个用户名访问哪个数据库。

update mysql.user set host=’%’ where host=’localhost';

grant all privileges on *.* to ‘root’@’%’ with grant option;

flush privileges;