[Mysql/MariaDB]終端機操作指令~

List of all client commands:
Note that all text commands must be first on line and end with ';'
?         (\?) Synonym for `help'.
clear     (\c) Clear the current input statement.
connect   (\r) Reconnect to the server. Optional arguments are db and host.
delimiter (\d) Set statement delimiter.
ego       (\G) Send command to MariaDB server, display result vertically.
exit      (\q) Exit mysql. Same as quit.
go        (\g) Send command to MariaDB server.
help      (\h) Display this help.
notee     (\t) Don't write into outfile.
print     (\p) Print current command.
prompt    (\R) Change your mysql prompt.
quit      (\q) Quit mysql.
rehash    (\#) Rebuild completion hash.
source    (\.) Execute an SQL script file. Takes a file name as an argument.
status    (\s) Get status information from the server.
tee       (\T) Set outfile [to_outfile]. Append everything into given outfile.
use       (\u) Use another database. Takes database name as argument.
charset   (\C) Switch to another charset. Might be needed for processing binlog with multi-byte charsets.
warnings  (\W) Show warnings after every statement.
nowarning (\w) Don't show warnings after every statement.

For server side help, type 'help contents'

登入mysql

PS C:\wamp\bin\mariadb\mariadb10.4.10\bin> .\mysql -uroot
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 1251
Server version: 10.4.10-MariaDB mariadb.org binary distribution

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)]>

select 使用者 table

MariaDB [(none)]> SELECT USER();
+----------------+
| USER()         |
+----------------+
| root@localhost |
+----------------+
1 row in set (0.002 sec)

MariaDB [(none)]>

show 出目前的執行清單

MariaDB [(none)]> show processlist;
+------+-------------+-----------------+------------+---------+------+--------------------------+-----------------------
----------------------------------------------------------------------+----------+
| Id   | User        | Host            | db         | Command | Time | State                    | Info
                                                                      | Progress |
+------+-------------+-----------------+------------+---------+------+--------------------------+-----------------------
----------------------------------------------------------------------+----------+
|    1 | system user |                 | NULL       | Daemon  | NULL | InnoDB purge worker      | NULL
                                                                      |    0.000 |
|    2 | system user |                 | NULL       | Daemon  | NULL | InnoDB purge worker      | NULL
                                                                      |    0.000 |
|    3 | system user |                 | NULL       | Daemon  | NULL | InnoDB purge coordinator | NULL
                                                                      |    0.000 |
|    4 | system user |                 | NULL       | Daemon  | NULL | InnoDB purge worker      | NULL
                                                                      |    0.000 |
|    5 | system user |                 | NULL       | Daemon  | NULL | InnoDB shutdown handler  | NULL
                                                                      |    0.000 |
| 1251 | root        | localhost:49205 | NULL       | Query   |    0 | Init                     | show processlist
                                                                      |    0.000 |
| 1269 | root        | localhost:49226 | cit01_site | Sleep   |    0 |                          | NULL
                                                                      |    0.000 |
| 1270 | root        | localhost:49227 | cit01_site | Query   |    0 | Writing to net           | SELECT option_value FR
OM cit02_options WHERE option_name = 'elementor_custom_tasks' LIMIT 1 |    0.000 |
| 1271 | root        | localhost:49228 | cit01_site | Sleep   |    1 |                          | NULL
                                                                      |    0.000 |
+------+-------------+-----------------+------------+---------+------+--------------------------+-----------------------
----------------------------------------------------------------------+----------+
9 rows in set (0.001 sec)

MariaDB [(none)]>

show 出目前的完整執行清單

MariaDB [(none)]> show full processlist;
+------+-------------+-----------------+------------+---------+------+--------------------------+-----------------------
------------------------------------------------------------------------------+----------+
| Id   | User        | Host            | db         | Command | Time | State                    | Info
                                                                              | Progress |
+------+-------------+-----------------+------------+---------+------+--------------------------+-----------------------
------------------------------------------------------------------------------+----------+
|    1 | system user |                 | NULL       | Daemon  | NULL | InnoDB purge worker      | NULL
                                                                              |    0.000 |
|    2 | system user |                 | NULL       | Daemon  | NULL | InnoDB purge worker      | NULL
                                                                              |    0.000 |
|    3 | system user |                 | NULL       | Daemon  | NULL | InnoDB purge coordinator | NULL
                                                                              |    0.000 |
|    4 | system user |                 | NULL       | Daemon  | NULL | InnoDB purge worker      | NULL
                                                                              |    0.000 |
|    5 | system user |                 | NULL       | Daemon  | NULL | InnoDB shutdown handler  | NULL
                                                                              |    0.000 |
| 1251 | root        | localhost:49205 | NULL       | Query   |    0 | Init                     | show full processlist
                                                                              |    0.000 |
| 1415 | root        | localhost:49398 | cit01_site | Query   |    0 | Writing to net           | SELECT meta_id FROM ci
t01_postmeta WHERE meta_key = 'pen_sidebar_bottom_display' AND post_id = 1822 |    0.000 |
+------+-------------+-----------------+------------+---------+------+--------------------------+-----------------------
------------------------------------------------------------------------------+----------+
7 rows in set (0.000 sec)

MariaDB [(none)]>
MariaDB [(none)]> show full processlist;
+------+-------------+-----------------+------------+---------+------+--------------------------+-----------------------
-----------------------------------------------------------------+----------+
| Id   | User        | Host            | db         | Command | Time | State                    | Info
                                                                 | Progress |
+------+-------------+-----------------+------------+---------+------+--------------------------+-----------------------
-----------------------------------------------------------------+----------+
|    1 | system user |                 | NULL       | Daemon  | NULL | InnoDB purge worker      | NULL
                                                                 |    0.000 |
|    2 | system user |                 | NULL       | Daemon  | NULL | InnoDB purge worker      | NULL
                                                                 |    0.000 |
|    3 | system user |                 | NULL       | Daemon  | NULL | InnoDB purge coordinator | NULL
                                                                 |    0.000 |
|    4 | system user |                 | NULL       | Daemon  | NULL | InnoDB purge worker      | NULL
                                                                 |    0.000 |
|    5 | system user |                 | NULL       | Daemon  | NULL | InnoDB shutdown handler  | NULL
                                                                 |    0.000 |
| 1251 | root        | localhost:49205 | NULL       | Query   |    0 | Init                     | show full processlist
                                                                 |    0.000 |
| 1445 | root        | localhost:49435 | cit01_site | Query   |    0 | Writing to net           | SELECT option_value FR
OM cit01_options WHERE option_name = 'WpFastestCacheCDN' LIMIT 1 |    0.000 |
+------+-------------+-----------------+------------+---------+------+--------------------------+-----------------------
-----------------------------------------------------------------+----------+
7 rows in set (0.001 sec)
期待您的留言

Comments

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *