MYSQL client has more new functions

The new functions in the client in MYSQL 8 make it easy to operate in the client of MYSQL without having to switch to the LINUX platform to operate some LINUX commands.

The scenario used is mainly the suitability of the commands for operating the database in MYSQL. At the same time, I want to monitor the current performance. Two windows may be opened before. After MYSQL 8, such things may be less.

What can we do

1 Execute system commands on the MYSQL client

2 Create and execute SQL files in the MYSQL client

3 Output the information output from the query to XML and HTML

4 Specify the maximum number of rows displayed by SELECT

Let’s log in first,

Then use the system command added in MYSQL 8.X to operate

system top

You can see that LINUX commands can be run directly inside MYSQL.

There is no problem with opening files directly inside mysql.

2 Batch function

Generally, most queries in the client are executed by a command, COMMIT unless you directly begin commit; type edit in the new MYSQL.

Then type the command to be executed into it in the file, and include the semicolon, and then save it directly: wq

Then after exiting, directly follow a; and then the related statements are executed in batches.

3 The result is output as an HTML statement

This is actually very useful for some students who want to write a report and show it directly. After such a sentence is output, it can be directly converted into an HTML page. Are you unhappy?

4 Provide safe update SQL statement function

The --safe-updates function is added to the MYSQL client to specifically correspond to those who write UPDATE statements who do not write the WHERE condition. If they do not write the where condition, the statement cannot be executed.

5 Control the number of rows displayed in the select statement. Of course, you can write limit 1 in the select statement, but in MYSQL 8 you can limit the number of rows displayed as a whole by --safe-update --select-limit =1 .

In MYSQL 8 the MYSQL client provides new functions to meet more diverse needs. Such MYSQL 8 can be upgraded and let MYSQL 5.7 be a BYE BYE completely.