天天看点

mysql用户及数据库的创建及权限的更改

创建数据库

create database discuz default character set utf8 collate utf8_general_ci;

创建用户

create user 'discuz'@'localhost' identified by 'discuz';

更改用户访问数据库的权限

grant all on discuz.* to 'discuz'@'localhost';

更改非本机使用数据库用户连接数据库的权限的更改

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

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

flush privileges;

本文转自ting2junshui51CTO博客,原文链接:http://blog.51cto.com/ting2junshui/1729670 ,如需转载请自行联系原作者