MySQL set remote login and new user

Source: Internet
Author: User

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

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.