创建用户,库及权限的分配

--建数据库 
create database zxlh default character set utf8;

--建用户,只访问zxlh数据库,%表示不限制任何ip
grant all PRIVILEGES on zxlh.* to 'zxlh'@'%' identified by 'zxlh';

--建用户,访问所有数据库
grant all PRIVILEGES on *.* to 'root'@'%' identified by '123456' WITH GRANT OPTION;

--刷新
flush privileges;

更细致的权限分配可以通过工具比如 navicte 

用户信息可以在MySQL.user中看到
use mysql
select host,user,passsword from user;


忘记密码:
service mysql55-mysqld stop
 
mysqld_safe --user=root --skip-grant-tables

mysql -u root
 
use mysql
 
update user set password=password("new_pass") where user="root";
 
flush privileges;  


分享标题:创建用户,库及权限的分配
网页地址:http://lszwz.com/article/ihjppg.html

其他资讯

售后响应及时

7×24小时客服热线

数据备份

更安全、更高效、更稳定

价格公道精准

项目经理精准报价不弄虚作假

合作无风险

重合同讲信誉,无效全额退款