Description:
the mysql command client -q option have a problem
How to repeat:
without -q option
/usr/local/mysql/bin/mysql -S /tmp/mysql3306.sock -uroot -p --prompt "\u@\p>[\d]>" --database employees
[root@yejr mysql_shell]# /usr/local/mysql/bin/mysql -S /tmp/mysql3306.sock -uroot -poracle --prompt "\u@\p>[\d]>" --database employees
mysql: [Warning] Using a password on the command line interface can be insecure.
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 84
Server version: 8.0.25 MySQL Community Server - GPL
Copyright (c) 2000, 2021, Oracle and/or its affiliates.
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.
root@mysql3306.sock>[employees]>select '123456789987654321' +0 a ;
+-----------------------+
| a |
+-----------------------+
| 1.2345678998765432e17 |
+-----------------------+
1 row in set (0.00 sec)
root@mysql3306.sock>[employees]>desc select '123456789987654321' +0 a ;
+----+-------------+-------+------------+------+---------------+------+---------+------+------+----------+----------------+
| id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
+----+-------------+-------+------------+------+---------------+------+---------+------+------+----------+----------------+
| 1 | SIMPLE | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | No tables used |
+----+-------------+-------+------------+------+---------------+------+---------+------+------+----------+----------------+
1 row in set, 1 warning (0.00 sec)
root@mysql3306.sock>[employees]>desc select '123456789987654321' +0 a \G
*************************** 1. row ***************************
id: 1
select_type: SIMPLE
table: NULL
partitions: NULL
type: NULL
possible_keys: NULL
key: NULL
key_len: NULL
ref: NULL
rows: NULL
filtered: NULL
Extra: No tables used
1 row in set, 1 warning (0.00 sec)
with -q option
[root@yejr mysql_shell]# /usr/local/mysql/bin/mysql -S /tmp/mysql3306.sock -uroot -p -q --prompt "\u@\p>[\d]>" --database employees
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 85
Server version: 8.0.25 MySQL Community Server - GPL
Copyright (c) 2000, 2021, Oracle and/or its affiliates.
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.
root@mysql3306.sock>[employees]>select '123456789987654321' +0 a ;
+-------------------------+
| a |
+-------------------------+
| 1.2345678998765432e17 |
+-------------------------+
1 row in set (0.00 sec)
root@mysql3306.sock>[employees]>desc select '123456789987654321' +0 a \G
*************************** 1. row ***************************
id: 1
select_type: SIMPLE
table: NULL
partitions: NULL
type: NULL
possible_keys: NULL
key: NULL
key_len: NULL
ref: NULL
rows: NULL
filtered: NULL
Extra: No tables used
1 row in set, 1 warning (0.00 sec)
root@mysql3306.sock>[employees]>desc select '123456789987654321' +0 a ;
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
^Z[2]+ Stopped /usr/local/mysql/bin/mysql -S /tmp/mysql3306.sock -uroot -p -q --prompt "\u@\p>[\d]>" --database employees