生产mysql设置账号密码及授权

mysql数据库安装完成

1、设置root账号密码

alter user ‘root‘@‘localhost‘ identified by "123456";

update mysql.user set authentication_string=password(‘123456‘) where user=‘root‘ and Host = ‘localhost‘;

2、MySQL创建数据库:

CREATE DATABASE xm_user CHARACTER SET utf8 COLLATE utf8_general_ci;

CREATE DATABASE xm_order CHARACTER SET utf8 COLLATE utf8_general_ci;

3、给数据库授权

grant all on xm_order.* to ‘user‘@‘%‘ identified by "u123456";

grant all on xm_user.* to ‘user‘@‘%‘ identified by "u123456";

 

生产mysql设置账号密码及授权

上一篇:MySQL 索引失效


下一篇:MySQL连接查询驱动表被驱动表以及性能优化