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
Overview This article begins to introduce content...
The following CSS class names starting with a num...
When compiling and installing Nginx, some modules...
Some time ago, I needed to use pip downloads freq...
At the very beginning, let's talk about what ...
A process is a program code that runs in the CPU ...
Table of contents 1. Memory model and runtime dat...
Professional web design is complex and time-consu...
Table of contents 1. Vue life cycle 2. Hook funct...
Usually, there are two options when we develop Li...
need Configuring DingTalk alarms in Zabbix is s...
Table of contents 01 Container consistency 02 Con...
Preface Semicolons in JavaScript are optional, an...
Table of contents pom configuration Setting.xml c...
Prepare the bags Install Check if Apache is alrea...