MySQL add user with authorization (dbforge studio MySQL) text detailed, remote access

Source: Internet
Author: User

Win7 32-bit system that operates MySQL through the dbforge Studio MySQL toolmysql Add user, new database, user authorization, delete user, change password (note that each line followed by A; indicates that a command statement ends):

1. Create a connection

1.1 Login MySQL: Log in with Root


Test the state.


 1.2 Create User:

GRANT USAGE on *. * to ' User01 ' @ ' localhost ' identified by ' 123456 ' with GRANT OPTION;

The red part above is a non-existent user, execute the above statement, create a user is: username, password: password user.

1.3 Then log in:

 

Test it.


2. Authorizing the user

Log in with the root user, after the login interface

 

With the root login mode, the authorization format: Grant permissions on the database. * To username @ Login host identified by "password";


 2.1 If you want to specify Partial permissions to a user, you can write:

Grant Select,update on testdb.* to [e-mail protected] identified by ' 123456 ';

Flush privileges; Refresh System Permissions Table

2.2 Authorize this database to telnet to the User01 user Permissions:

For example, if you want to myuser use MyPassword to connect to a MySQL server from any host.
GRAN T all privileges on * * to ' myuser ' @ '% ' identified by ' MyPassword ' with GRANT OPTION;
        FLUSH   privileges;
          If you want to allow users to connect to a MySQL server from a host myuser IP 192.168.1.9 and use MyPassword as the password
           
GRANT all privileges on *. * to ' myuser ' @ ' 192.168.1.3 ' identified by ' MYP Assword ' with GRANT OPTION;
          FLUSH   privileges;
          If you want to allow users to connect to the MySQL server's DK database myuser from the IP-192.168.1.9 host, and use MyPassword as the password
         
GRANT all privileges the dk.* to ' myuser ' @ ' 192.168.1.3 ' identified by ' MyPassword ' with GRANT OPTION;
          FLUSH   privileges;

2.3 Authorized User01 users have some permissions for all databases:

Mysql>grant Select,delete,update,create,drop on * * to User01@ "%" identified by "123456";

User01 users have Select,delete,update,create,drop permissions on all databases.

@ "%" indicates authorization for all non-local hosts, excluding localhost. (The localhost address is set to 127.0.0.1, if set to the real local address, do not know whether it can, no authentication.) )

Authorization to localhost: plus a grant all privileges on testdb.* to [email protected] identified by ' 1234 ';


MySQL add user with authorization (dbforge studio MySQL) text detailed, remote access

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.