Set remote login and new users for mysql
Simple mysql management commands:
Start mysql sudo start mysql
Stop mysql sudo stop mysql
Remote access settings:
Sudo vi/etc/mysql/my. cnf comment out bind-address = 127.0.0.1
Add new users:
GRANT ALL PRIVILEGES ON *.* TO gino@'%' IDENTIFIED BY "123456";
GRANT command Description: all privileges indicates ALL permissions. You can also use select, update, and other permissions. ON is used to specify which databases and tables the Permission applies. *. * Indicates the database name, and * indicates the table name. TO: grant permissions TO a user. Jack @ 'localhost' indicates the jack user. @ the host followed by the restriction can be an IP address, IP address segment, domain name, and %. % indicates any location. Note: Here % Some versions do not include the local version. I have previously set % to allow a user to log on anywhere, but cannot log on locally. This is related to the version, if this problem occurs, add a localhost user. Identified by specifies the user's logon password. With grant option indicates that the user can GRANT permissions to others. Note: Some users often do not specify the with grant option when creating operation users. As a result, this user cannot use the GRANT command to create users or GRANT permissions to other users. Note: You can use GRANT to repeatedly add permissions to users. For example, you can add a select permission to the user first and then add an insert permission to the user, then the user has both select and insert permissions.
Use this command to make the permission take effect, especially when you update or delete the permission table user, db, host, and so on. In the past, the permission has not been updated after grant is used. If the permission is changed, use the flush privileges command to refresh the permission. Flush privileges;
For more information about permissions and setting new users, see:
Http://www.cnblogs.com/Richardzhu/p/3318595.html
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.