Set remote login and new users for mysql

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.