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";

 

posted @ 2020-06-15 10:55  钱哥的博客  阅读(509)  评论(0编辑  收藏  举报