First, the MySQL connection local database, the user name "root", the password "123456": d:\>mysql-h localhost-u root-p123456 Note: "-P" and "123456" can not have space between two, MySQL Connect the data specified in the local database, the database name is "Db_test", the user name is "root", the password is "123456": D:\>mysql-h 127.0.0.1-u root-p123456-d db_test Third, MySQL connection local Database, the user name "root", the password is "123456", you can not enter the password, and then follow the prompts to enter the password: d:\>mysql-h localhost-u root-p Enter password: The above hint appears Then enter the password and return. Iv. MySQL Connection remote Database (192.168.1.10), port "3306", username "root", password "123456" d:\>mysql-h 192.168.1.10-p 3306-u root-p123456 Note: This is the uppercase "P" indicating the port number.
Several ways MySQL connects to the server