Use the mysql command to connect to the MySQL server. After the MySQL server is started, select "Start" → "Run" command, enter the "cmd" command in the pop-up "Run" window, press Enter to enter the DOS window, and enter the command prompt to connect to the MySQL server. Test website www.dc3688.com To connect to the MySQL server, you need to enter the username, password, and address of the MySQL server.
Disconnect After connecting to the MySQL server, you can disconnect from the MySQL connection by entering the "exit" or "quit" command at the MySQL prompt.
Supplementary knowledge: MySQL client commands and server commands There are two forms of executing commands in the mysql client. One is the client command and the other is the server command The client command does not need to end with ";", just write it directly, and can be abbreviated You can view client commands through the help command When we were learning awk, we learned the system function, which is to call Linux commands in awk. We can indirectly call other commands through the system command, for example: system hostname, so that we don't have to exit the Linux terminal and come back when we want to execute the command. It is more convenient. Many tools are very similar in some places. This is also very useful. This command is a prompt, it can change our prompt, similar to PS1, it can modify the prompt format In the script, we can use source to make the configuration file effective. We can also use this method in MySQL. For example, we write a test (vim test.sql). Note that the SQL command we are using now is generally a MySQL operation command. It is generally recommended that if you write MySQL operation commands in a file, you should add a sql suffix, just like we wrote the test.sh. This is the sql script. If the sql script is saved in the current directory, the current path can be omitted, but if it is not saved in the current directory, you can write its path, otherwise it will not know where to save it. The server-side command needs to be ended with; Press Enter to execute, and the semicolon must be added -A, --no-auto-rehash disable completion -u, --user=username, default is root -h, --host= server host, default is localhost -p, --passowrd= user password, it is recommended to use -p, the default is an empty password -P, --port=SERVER_PORT -S, --socket= specifies the connection socket file path -D, --database= Specify the default database -C, --compress enable compression -e "SQL" Execute SQL command -V, --version show version -v --verbose Show detailed information –print-defaults Get the default configuration used by the program The above article about mySQL server connection, disconnection and cmd usage is all the content that the editor shares with you. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Vue3 Vue Event Handling Guide
>>: How to build LNMP environment on Ubuntu 20.04
Table of contents Use of CURRENT_TIMESTAMP timest...
This article shares the specific code of Vue to a...
Rendering principle In the form element, there is...
Preface For file or directory permissions in Linu...
The temperament of a web front-end website is a fe...
Beginners who are exposed to HTML learn some HTML...
GreaseMokey (Chinese people call it Grease Monkey...
Table of contents HTTP hijacking, DNS hijacking a...
1. Why do packaging? Facilitates overall code cal...
Introduction to jQuery The jQuery library can be ...
IMG tag basic analysis In HTML5, the img tag has ...
<br />I have written two articles before, &q...
bgcolor="text color" background="ba...
I see many novice students doing front-end develop...
Table of contents Overview Front-end knowledge sy...