添加新用户

1.添加新用户

create user 'zpliu'@'localhost' identified by '123456'
flush privileges

2.创建数据库

create database Bioinformatic default charset utf8 collate utf8_general_ci;

3.给用户赋予数据库权限

//老版本的做法
grant all privileges on `bioinformatic`.*  to 'zpliu'@'localhost' identified by '123456'
//mysql 8 之后的
 grant all privileges on `Bioinformatic`.* to 'zpliu'@'localhost'  with grant option;
 ## 密码设置太简单了
 alter user 'zpliu'@'localhost' identified by '123456' password expire never;
 alter user 'zpliu'@'localhost' identified with  mysql_native_password by '123456' ;

Last updated