首页 > 代码库 > mysql 用户授权命令

mysql 用户授权命令

mysql> GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘your_root_password‘ WITH GRANT OPTION;

\\开启root远程登录
mysql> CREATE DATABASE DBNAME;  \\创建数据库
mysql> GRANT ALL PRIVILEGES ON DBNAME.* TO ‘USERNAME‘@‘localhost‘ IDENTIFIED BY ‘USERPASS‘;
\\创建用户名并赋予数据库权限

# mysql_secure_installation  \\初始化设置root密码等

  

mysql 用户授权命令