---
# System prepended metadata

title: MySQL 建立新使用者及更改權限
tags: [MySQL]

---

# MySQL 建立新使用者及更改權限
* 創建使用者及設定密碼
`mysql> CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';`

* 提供使用者權限
`mysql> GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';`

* 重新載入權限
`mysql> FLUSH PRIVILEGES;`

參考自 [How To Create a New User and Grant Permissions in MySQL](https://www.digitalocean.com/community/tutorials/how-to-create-a-new-user-and-grant-permissions-in-mysql)

###### tags: `MySQL`