1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | #连接mysql mysql -u root -p #创建用户 create USER "adam" @ "localhost" identified by '你的密码' ; #查看用户列表 select CONCAT( 'User:' , user , '@' ,host) from mysql. user ; 输出 + -------------------------------+ | CONCAT( 'User:' , user , '@' ,host) | + -------------------------------+ | User :adam@localhost | | User :mysql.session@localhost | | User :mysql.sys@localhost | | User :root@localhost | + -------------------------------+ 4 rows in set (0.00 sec) #分配权限 grant all privileges on wohuanicai.* to 'adam' @ 'localhost' identified by '你的密码' ; #Over |
本文为Adamin90原创文章,转载无需和我联系,但请注明来自http://www.lixiaopeng.top