MySQL创建新用户代码实例
程序员文章站
2023-11-02 19:24:22
MySQL创建新用户代码实例
F:\develop\tools\editor\wampserver\wamp64\bin\mysql\mysql5.7.14\bin>m...
MySQL创建新用户代码实例
F:\develop\tools\editor\wampserver\wamp64\bin\mysql\mysql5.7.14\bin>mysql -u root -p Enter password: **** // 创建要分配使用的数据库 mysql> CREATE DATABASE HongChenTian; // 为该数据创建具有一定权限的用户名(数据库名称HongChenTian,用户名为bjjiudanmei,密码bjjiudanmei) mysql> GRANT SELECT, INSERT,UPDATE, DELETE -> ON HongChenTian.* TO -> 'bjjiudanmei'@'localhost' -> IDENTIFIED BY 'bjjiudanmei'; // 清空历史数据 mysql> FLUSH PRIVILEGES;
GRANT SELECT, INSERT, UPDATE, DELETE ON Diary.* TO 'username'@'localhost' IDENTIFIED BY 'userpassword';
Windows系统下设置mysql的根用户密码及添加新用户的操作