[root@kvm5 ~]# mysql -uroot -pqweqwe Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 13 Server version: 5.5.41-MariaDB MariaDB Server Copyright (c) 2000, 2014, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | +--------------------+ 3 rows in set (0.00 sec)
MariaDB [(none)]> 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
MariaDB [mysql]> create user dywang@'localhost' identified by 'qweqwe';
MariaDB [mysql]> grant select on Contacts.* to dywang@'localhost'; Query OK, 0 rows affected (0.01 sec)
MariaDB [mysql]> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec)
MariaDB [mysql]> show grants for 'dywang'@'localhost'\G *************************** 1. row *************************** Grants for dywang@localhost: GRANT USAGE ON *.* TO 'dywang'@'localhost' \ IDENTIFIED BY PASSWORD '*ABCDBDDA833FA5726A2C9AEC6690A696F5DB8969' *************************** 2. row *************************** Grants for dywang@localhost: GRANT SELECT ON `Contacts`.* TO 'dywang'@'localhost' 2 rows in set (0.00 sec)
MariaDB [mysql]> select * from mysql.user where user='dywang'\G
*************************** 1. row ***************************
Host: localhost
User: dywang
Password: *ABCDBDDA833FA5726A2C9AEC6690A696F5DB8969
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
Create_tablespace_priv: N
ssl_type:
ssl_cipher:
x509_issuer:
x509_subject:
max_questions: 0
max_updates: 0
max_connections: 0
max_user_connections: 0
plugin:
authentication_string:
1 row in set (0.00 sec)
MariaDB [mysql]> select * from mysql.db where db='Contacts'\G
*************************** 1. row ***************************
Host: localhost
Db: Contacts
User: dywang
Select_priv: Y
Insert_priv: N
Update_priv: N
Delete_priv: N
Create_priv: N
Drop_priv: N
Grant_priv: N
References_priv: N
Index_priv: N
Alter_priv: N
Create_tmp_table_priv: N
Lock_tables_priv: N
Create_view_priv: N
Show_view_priv: N
Create_routine_priv: N
Alter_routine_priv: N
Execute_priv: N
Event_priv: N
Trigger_priv: N
1 row in set (0.00 sec)
MariaDB [mysql]>
MariaDB [mysql]> exit Bye