To disconnect from the MySQL server, use the "mysql -u [username] -p [password] -h [hostname] -P [port number] -e "quit"" command. Among them: [username] is the MySQL user name, [password] is the user password, [hostname] is the host name or IP address of the MySQL server, [port number] is the port number of the MySQL server (default is 3306), "quit " is the disconnect command.
Command to disconnect the MySQL server
To disconnect the MySQL server, you can use the following command:
<code>mysql -u [用户名] -p [密码] -h [主机名] -P [端口号] -e "quit"</code>
Command explanation:
mysql
: MySQL client command. -u [username]
: Specifies the MySQL username to use. -p [Password]
: Specify the user's password. -h [hostname]
: Specify the hostname or IP address of the MySQL server. -P [port number]
: Specify the port number of the MySQL server (default value is 3306). -e "quit"
: Execute the "quit" command to disconnect from the server. Example:
The following example demonstrates how to disconnect from the MySQL server named "mydb" with the user name "root" and the password " mypass":
<code>mysql -u root -p mypass -h mydb.example.com -e "quit"</code>
After executing this command, you will disconnect from the MySQL server.
The above is the detailed content of What is the command to disconnect the mysql server?. For more information, please follow other related articles on the PHP Chinese website!