Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [root@db1 ~]# mysql -uroot -pfoobar
- Welcome to the MySQL monitor. Commands end with ; or \g.
- Your MySQL connection id is 3
- Server version: 5.1.61 Source distribution
- Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
- Oracle is a registered trademark of Oracle Corporation and/or its
- affiliates. Other names may be trademarks of their respective
- owners.
- Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
- mysql> use mysql
- Reading table information for completion of table and column names
- You can turn off this feature to get a quicker startup with -A
- Database changed
- mysql> select User from user;
- +------+
- | User |
- +------+
- | root |
- | |
- | root |
- | |
- | root |
- +------+
- 5 rows in set (0.00 sec)
- mysql> CREATE USER '123'@'%' IDENTIFIED BY '123';
- Query OK, 0 rows affected (0.00 sec)
- mysql> show databases;
- +--------------------+
- | Database |
- +--------------------+
- | information_schema |
- | mysql |
- | test |
- +--------------------+
- 3 rows in set (0.00 sec)
- mysql> create database 123;
- Query OK, 1 row affected (0.00 sec)
- mysql> GRANT ALL ON 123.* to '123'@'%' WITH GRANT OPTION;
- Query OK, 0 rows affected (0.00 sec)
- mysql> FLUSH PRIVILEGES;
- Query OK, 0 rows affected (0.00 sec)
- mysql> quit
- Bye
- [root@db1 ~]# mysql -u123 -p123
- ERROR 1045 (28000): Access denied for user '123'@'localhost' (using password: YES)
- mysql> use mysql
- Database changed
- mysql> select * from user where User='123' \G
- *************************** 1. row ***************************
- Host: %
- User: 123
- Password: *08FA77CAB469297F05D9CA01BAA5529DDBC5265B
- Select_priv: N
- Insert_priv: N
- Update_priv: N
- Delete_priv: N
- Create_priv: N
- Drop_priv: N
- Reload_priv: N
- Shutdown_priv: N
- Process_priv: N
- File_priv: N
- Grant_priv: N
- References_priv: N
- Index_priv: N
- Alter_priv: N
- Show_db_priv: N
- Super_priv: N
- Create_tmp_table_priv: N
- Lock_tables_priv: N
- Execute_priv: N
- Repl_slave_priv: N
- Repl_client_priv: N
- Create_view_priv: N
- Show_view_priv: N
- Create_routine_priv: N
- Alter_routine_priv: N
- Create_user_priv: N
- Event_priv: N
- Trigger_priv: N
- ssl_type:
- ssl_cipher:
- x509_issuer:
- x509_subject:
- max_questions: 0
- max_updates: 0
- max_connections: 0
- max_user_connections: 0
- 1 row in set (0.00 sec)
Add Comment
Please, Sign In to add comment