Experience of mysql remote data connection _ MySQL

Source: Internet
Author: User
Experiences of mysql remote data connection bitsCN.com

Experiences of mysql remote data connection

[SQL]

1. add a user

[SQL]

Mysql> insert into mysql. user (Host, User, Password) values ("localhost", "lionbule", password ("hello1234 "));

Mysql> flush privileges;

2. modify the user password www.bitsCN.com

[SQL]

Mysql> update mysql. user set password = password ('New password') where User = "lionbule" and Host = "localhost ";

Mysql> flush privileges;

3. delete a user

[SQL]

Mysql> delete from user WHERE User = "lionbule" and Host = "localhost ";

Mysql> flush privileges;

4. Permission Assignment

4.1. grant usage

Grant permission on database. * to username @ 'login host' identified by 'password'

[SQL]

Permission:

Common Summary: ALL/ALTER/CREATE/DROP/SELECT/UPDATE/DELETE

Database:

*. * Indicates all tables in all databases.

Test. * indicates all tables in the test database.

Test. test_table indicates the test_table table of the test database.

User name:

Mysql account name

Login host: www.bitsCN.com

Client ip addresses allowed to log on to mysql server

'%' Indicates all ip addresses

'Localhost' indicates the local machine

'1970. 168.10.2 'specific IP address

Password:

Logon password for the account

Example:

[SQL]

Mysql> grant all on test. * to lionbule @ '%' identified by 'hello1234 ';

Mysql> flush privileges;

BitsCN.com

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.