MySQL Admin user

Source: Internet
Author: User
Tags reserved

[Email protected] ~]# mysql-uroot-p

Enter Password:

Welcome to the MySQL Monitor. Commands End With; or \g.

Your MySQL Connection ID is 2317

Server Version:5.6.30-log Source Distribution


Copyright (c) and/or, Oracle, its affiliates. All rights reserved.


Oracle is a registered trademark of the Oracle Corporation and/or its

Affiliates. Other names trademarks of their respective

Owners.


Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.


Mysql> select User,host,password from Mysql.user;

+---------+------------+-------------------------------------------+

| user | Host | password |

+---------+------------+-------------------------------------------+

| Root | localhost | *225AF6FA78393CB66A2CF30F85001B643546ED44 |

| Root |                                           zampdmp-02 | |

| Root |                                           127.0.0.1 | |

| Root |                                           :: 1 | |

| |                                           localhost | |

| |                                           zampdmp-02 | |

| Hivedb | localhost | *1f4a2e1e0471ec60934cc4896b8b03bc64e80b58 |

| Hivedb | %          | *1f4a2e1e0471ec60934cc4896b8b03bc64e80b58 |

| Root | %          | *225AF6FA78393CB66A2CF30F85001B643546ED44 |

| Etler | %          | *8C377BBE4E13B4FA9AB2727937F3FEF047DB0AAF |

| Exposer | %          | *1b5955820d31f633b073d0a326801133a15de967 |

+---------+------------+-------------------------------------------+

Rows in Set (0.00 sec)


Mysql> Select User,host,password from Mysql.user where password= ';

+------+------------+----------+

| user | Host | password |

+------+------------+----------+

| Root |          zampdmp-02 | |

| Root |          127.0.0.1 | |

| Root |          :: 1 | |

| |          localhost | |

| |          zampdmp-02 | |

+------+------------+----------+

5 rows in Set (0.00 sec)


Mysql> GRANT All privileges on * * to ' root ' @ ' zampdmp-02 ' identified by PASSWORD ' *225af6fa78393cb66a2cf30f85001b64354 6ed44 ' with GRANT OPTION

;

Query OK, 0 rows affected, 1 Warning (0.00 sec)


Mysql> GRANT All privileges on * * to ' root ' @ ' 127.0.0.1 ' identified by PASSWORD ' *225af6fa78393cb66a2cf30f85001b643546 ED44 ' with GRANT OPTION;

Query OK, 0 rows Affected (0.00 sec)


Mysql> Select User,host,password from Mysql.user where password= ';

+------+------------+----------+

| user | Host | password |

+------+------------+----------+

| Root |          :: 1 | |

| |          localhost | |

| |          zampdmp-02 | |

+------+------------+----------+

3 Rows in Set (0.00 sec)


Mysql> select User,host,password from Mysql.user;

+---------+------------+-------------------------------------------+

| user | Host | password |

+---------+------------+-------------------------------------------+

| Root | localhost | *225AF6FA78393CB66A2CF30F85001B643546ED44 |

| Root | zampdmp-02 | *225AF6FA78393CB66A2CF30F85001B643546ED44 |

| Root | 127.0.0.1 | *225AF6FA78393CB66A2CF30F85001B643546ED44 |

| Root |                                           :: 1 | |

| |                                           localhost | |

| |                                           zampdmp-02 | |

| Hivedb | localhost | *1f4a2e1e0471ec60934cc4896b8b03bc64e80b58 |

| Hivedb | %          | *1f4a2e1e0471ec60934cc4896b8b03bc64e80b58 |

| Root | %          | *225AF6FA78393CB66A2CF30F85001B643546ED44 |

| Etler | %          | *8C377BBE4E13B4FA9AB2727937F3FEF047DB0AAF |

| Exposer | %          | *1b5955820d31f633b073d0a326801133a15de967 |

+---------+------------+-------------------------------------------+

Rows in Set (0.00 sec)


Mysql> Select User,host,password from mysql.user where password = ';

+------+------------+----------+

| user | Host | password |

+------+------------+----------+

| Root |          :: 1 | |

| |          localhost | |

| |          zampdmp-02 | |

+------+------------+----------+

3 Rows in Set (0.00 sec)


Mysql> Delete from mysql.user where password= ';

Query OK, 3 Rows Affected (0.00 sec)


Mysql> Select User,host,password from mysql.user where password = ';

Empty Set (0.00 sec)


Mysql> select User,host,password from Mysql.user;

+---------+------------+-------------------------------------------+

| user | Host | password |

+---------+------------+-------------------------------------------+

| Root | localhost | *225AF6FA78393CB66A2CF30F85001B643546ED44 |

| Root | zampdmp-02 | *225AF6FA78393CB66A2CF30F85001B643546ED44 |

| Root | 127.0.0.1 | *225AF6FA78393CB66A2CF30F85001B643546ED44 |

| Hivedb | localhost | *1f4a2e1e0471ec60934cc4896b8b03bc64e80b58 |

| Hivedb | %          | *1f4a2e1e0471ec60934cc4896b8b03bc64e80b58 |

| Root | %          | *225AF6FA78393CB66A2CF30F85001B643546ED44 |

| Etler | %          | *8C377BBE4E13B4FA9AB2727937F3FEF047DB0AAF |

| Exposer | %          | *1b5955820d31f633b073d0a326801133a15de967 |

+---------+------------+-------------------------------------------+

8 rows in Set (0.00 sec)


mysql> flush Privileges;

Query OK, 0 rows Affected (0.00 sec)


Mysql> Grant all privileges on * * to ' hivedb ' @ ' zampdmp-02 ' identified by ' *1f4a2e1e0471ec60934cc4896b8b03bc64e80b58 ' with grant options;

Error 1064 (42000): You have a error in your SQL syntax; Check the manual-corresponds to your MySQL server version for the right syntax-to-use near ' options ' on line 1

Mysql> Grant all privileges on * * to ' hivedb ' @ ' zampdmp-02 ' identified by ' *1f4a2e1e0471ec60934cc4896b8b03bc64e80b58 ' with GRANT option;

Query OK, 0 rows affected, 1 Warning (0.00 sec)


Mysql> select User,host,password from Mysql.user;

+---------+------------+-------------------------------------------+

| user | Host | password |

+---------+------------+-------------------------------------------+

| Root | localhost | *225AF6FA78393CB66A2CF30F85001B643546ED44 |

| Root | zampdmp-02 | *225AF6FA78393CB66A2CF30F85001B643546ED44 |

| Root | 127.0.0.1 | *225AF6FA78393CB66A2CF30F85001B643546ED44 |

| Hivedb | zampdmp-02 | *9ae5587facba2ee66d40ce18bac51361fd134b42 |

| Hivedb | localhost | *1f4a2e1e0471ec60934cc4896b8b03bc64e80b58 |

| Hivedb | %          | *1f4a2e1e0471ec60934cc4896b8b03bc64e80b58 |

| Root | %          | *225AF6FA78393CB66A2CF30F85001B643546ED44 |

| Etler | %          | *8C377BBE4E13B4FA9AB2727937F3FEF047DB0AAF |

| Exposer | %          | *1b5955820d31f633b073d0a326801133a15de967 |

+---------+------------+-------------------------------------------+

9 Rows in Set (0.00 sec)


Mysql> Grant all privileges on * * to ' hivedb ' @ ' 127.0.0.1 ' identified by ' *1f4a2e1e0471ec60934cc4896b8b03bc64e80b58 ' W ITH grant OPTION;

Query OK, 0 rows Affected (0.00 sec)


mysql> flush Privileges;

Query OK, 0 rows Affected (0.00 sec)


Mysql> select User,host,password from Mysql.user;

+---------+------------+-------------------------------------------+

| user | Host | password |

+---------+------------+-------------------------------------------+

| Root | localhost | *225AF6FA78393CB66A2CF30F85001B643546ED44 |

| Root | zampdmp-02 | *225AF6FA78393CB66A2CF30F85001B643546ED44 |

| Root | 127.0.0.1 | *225AF6FA78393CB66A2CF30F85001B643546ED44 |

| Hivedb | 127.0.0.1 | *9ae5587facba2ee66d40ce18bac51361fd134b42 |

| Hivedb | zampdmp-02 | *9ae5587facba2ee66d40ce18bac51361fd134b42 |

| Hivedb | localhost | *1f4a2e1e0471ec60934cc4896b8b03bc64e80b58 |

| Hivedb | %          | *1f4a2e1e0471ec60934cc4896b8b03bc64e80b58 |

| Root | %          | *225AF6FA78393CB66A2CF30F85001B643546ED44 |

| Etler | %          | *8C377BBE4E13B4FA9AB2727937F3FEF047DB0AAF |

| Exposer | %          | *1b5955820d31f633b073d0a326801133a15de967 |

+---------+------------+-------------------------------------------+

Rows in Set (0.00 sec)


Mysql> Delete from Mysql.user where User=root and host=zampdmp-02;

ERROR 1054 (42S22): Unknown column ' root ' in ' WHERE clause '

Mysql> Delete from mysql.user where user= ' root ' and host= ' zampdmp-02 ';

Query OK, 1 row Affected (0.00 sec)


Mysql> Delete from Mysql.user where user= ' hivedb ' and host= ' zampdmp-02 ';

Query OK, 1 row Affected (0.00 sec)


Mysql> select User,host,password from Mysql.user;

+---------+-----------+-------------------------------------------+

| user | Host | password |

+---------+-----------+-------------------------------------------+

| Root | localhost | *225AF6FA78393CB66A2CF30F85001B643546ED44 |

| Root | 127.0.0.1 | *225AF6FA78393CB66A2CF30F85001B643546ED44 |

| Hivedb | 127.0.0.1 | *9ae5587facba2ee66d40ce18bac51361fd134b42 |

| Hivedb | localhost | *1f4a2e1e0471ec60934cc4896b8b03bc64e80b58 |

| Hivedb | %         | *1f4a2e1e0471ec60934cc4896b8b03bc64e80b58 |

| Root | %         | *225AF6FA78393CB66A2CF30F85001B643546ED44 |

| Etler | %         | *8C377BBE4E13B4FA9AB2727937F3FEF047DB0AAF |

| Exposer | %         | *1b5955820d31f633b073d0a326801133a15de967 |

+---------+-----------+-------------------------------------------+

8 rows in Set (0.00 sec)


mysql> flush Privileges;

Query OK, 0 rows Affected (0.00 sec)


Mysql> exit

Bye

[Email protected] ~]# mysql-uroot-p-hzampdmp-02

Enter Password:

Welcome to the MySQL Monitor. Commands End With; or \g.

Your MySQL Connection ID is 2336

Server Version:5.6.30-log Source Distribution


Copyright (c) and/or, Oracle, its affiliates. All rights reserved.


Oracle is a registered trademark of the Oracle Corporation and/or its

Affiliates. Other names trademarks of their respective

Owners.


Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.


mysql> show databases;

+--------------------+

| Database |

+--------------------+

| Information_schema |

| David |

| Elita |

| Exp |

| Hivedb |

| MySQL |

| OLAP |

| Performance_schema |

| Pub |

| Test |

| TMP |

+--------------------+

Rows in Set (0.00 sec)


mysql> use TMP

Database changed

Mysql> Show tables;

Empty Set (0.00 sec)


Mysql> Use EXP

Reading table information for completion of table and column names

Can turn off this feature to get a quicker startup with-a


Database changed

Mysql> Show tables;

+--------------------+

| Tables_in_exp |

+--------------------+

| Export_segment_day |

| Segment_status |

| Segment_total |

| segment_trait |

+--------------------+

4 rows in Set (0.00 sec)


This article comes from "Plum blossom fragrance from bitter cold!" "Blog, be sure to keep this provenance http://daixuan.blog.51cto.com/5426657/1840383

MySQL Admin 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.