Connect to MySQL: Format: mysql-h host address-u user name-p User Password 1, Example 1: connect to MYSQL on the local machine to find the mysql installation directory, generally you can directly type
Connect to MySQL: Format: mysql-h host address-u user name-p User Password 1, Example 1: connect to MYSQL on the local machine to find the mysql installation directory, generally you can directly type
Connect to MySQL:
Format: mysql-h host address-u user name-p User Password
1. Example 1: connect to MYSQL on the local machine
Find the installation directory of mysql. Generally, you can directly enter the mysql-uroot-p command, and press enter to prompt you to enter the password. If you have just installed MYSQL, the Super User root has no password, so press enter to enter MYSQL. The MYSQL prompt is: mysql>
2. Connect to MySQL on the remote host
Assume that the IP address of the remote host is 10.0.0.1, the user name is root, and the password is 123. Enter the following command:
Mysql-h10.0.0.1-uroot-p123
(Note: you do not need to add spaces for u and root. The same applies to others)
3. Exit MySQL Command
Exit (Press ENTER)