> For the complete documentation index, see [llms.txt](https://zpliu.gitbook.io/booknote/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zpliu.gitbook.io/booknote/mysql/01-tian-jia-xin-yong-hu.md).

# 添加新用户

## 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' ;
```
