使用mysql命令登录root用户[ root @ izwz 91 h 49 n3 mj8r 232 GQ wez~~ ] # MySQL-uroot-penter password : welcometothemysqlmonion g.yourmysqlconnectionidis 36 server version :5.6.42-logmysqlcommunityserver (GPL ) Copyright (c ) 2000, 2018 Oracle and/oritsaffiliates.all rights reserved.oracleisaregisteredtrademarkoforaclecorporationand/oritsaffiliates.ord C ' toclearthecurrentinputstatement.MySQL2.创建新用户2.1 .方法从linux命令行创建MySQL新用户createuser'mindoc_ (备注中@后的指令解释
“%”-“localhost”-本机访问“111.222.33.44‘ -在所有情况下,必须指定ip才能访问此类创建命令。 缺省情况下,显示以下两个库,而不显示其他数据库:
2.2 .方法2创建一种使用heidisql root用户登录MySQL数据库的方法
2.2.1单击角色用户头像
2.2.2 .添加
点击保存即可
3 .授权用户grant all on数据库名称.数据库表中的to用户名@“%”“identified by”密码“; 备注
all可以替换为select、delete、update、create和drop数据库名称所有用*所有数据库表的用* example1
向mindoc_db_read用户授予对mindoc_db中所有表的查询权限
mysqlgrantselectonmindoc _ db.* tomi ndoc _ db _ read @ ' % ' identified by ' mindoc _ db _ read @ 123 '; Query OK,0Rowsaffected(0.01sec ) mysql