MariaDB的SQL语句基础
创建用户账号
[root@lab1 ~]# mysql -uroot -predhat
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 5
Server version: 5.5.60-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
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 'wpuser'@'%' IDENTIFIED BY 'wppass';
Query OK, 0 rows affected (0.00 sec)
MariaDB [mysql]> SELECT User,Host,Password FROM user;
+-----------+------------------+-------------------------------------------+
| User | Host | Password |
+-----------+------------------+-------------------------------------------+
| root | localhost | *84BB5DF4823DA319BBF86C99624479A198E6EEE9 |
| root | lab1.example.com | *84BB5DF4823DA319BBF86C99624479A198E6EEE9 |
| root | 127.0.0.1 | *84BB5DF4823DA319BBF86C99624479A198E6EEE9 |
| root | ::1 | *84BB5DF4823DA319BBF86C99624479A198E6EEE9 |
| | localhost | |
| | lab1.example.com | |
| wpuser | localhost | *7CD61EFBFDDDBD978EA9017F2A26A59DE4589025 |
| wpuser | 127.0.0.1 | *7CD61EFBFDDDBD978EA9017F2A26A59DE4589025 |
| wpuser-01 | 127.0.0.1 | *975DE697061445EBD4D43D41B20F9F54F768420A |
| wpuser | % | *C9B2DB1CA193280B971CA3602D5174A5D637D2BF |
+-----------+------------------+----------------------------