1 2 | [mysqld] skip-grant-tables |
1 | sudo service mysql restart |
1 2 | UPDATE mysql.user SET authentication_string=PASSWORD("123") WHERE user="root"; flush privileges; |
1 | CREATE USER 'user2'@'localhost' IDENTIFIED BY '123'; |
1 | create database test; |
1 | grant all privileges on test.* to user2@'%' identified by '123'; |
1 | flush privileges; |
1 | show grants for 'user2'@'%'; |
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) | 黑马程序员IT技术论坛 X3.2 |