mysql Simple admin command:
Start MySQL sudo start MySQL
Stop MySQL sudo stop MySQL
Settings to allow remote access:
sudo vi /etc/mysql/my.cnf注释掉 bind127.0.0.1
Add new users:
GRANT ALL PRIVILEGES ON *.* TO [email protected]‘%‘ IDENTIFIED BY "123456";
GRANTCommand Description: All Privilegesis to represent all permissions, you can also use theSelect、Updateand other permissions. onUsed to specify which libraries and tables the permissions are for. The * in front of * * is used to specify the database name, followed by the * number to specify the table name. toIndicates that a permission is assigned to a user. [Email protected]' localhost 'Represents the Jack user, the host after which the @ is followed by a limit, which can be IP, IP segment, domain name, and%,% representation anywhere. Note: There are some versions of this is not included in the local, previously encountered to a user set the% allowed to log anywhere, but not on the local login, this and the version has a relationship with this problem plus a localhost user can be. Identified bySpecifies the user's login password. with GRANT OPTIONThis option means that the user can delegate the permissions they own to others. Note: There are often people who do not specify when creating an operation user with GRANT OPTIONoption causes the user to later be unable to useGRANTcommand to create a user or authorize another user. Note: You can useGRANTRepeat to add permissions to the user, permissions overlay, for example, you first to add a userSelectpermissions, and then add aInsertPermissions, the user has the sameSelectAndInsertPermissions.
使用这个命令使权限生效,尤其是你对那些权限表user、db、host等做了update或者delete更新的时候。以前遇到过使用grant后权限没有更新的情况,只要对权限做了更改就使用FLUSH PRIVILEGES命令来刷新权限。flush privileges;
Permissions and a detailed explanation reference for setting up new users:
Http://www.cnblogs.com/Richardzhu/p/3318595.html
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
MySQL set remote login and new user