Access to MySQL under Windows has encountered some problems:
This is caused by not configuring local environment variables. Added methods: Computer Right-click Properties, advanced system settings, environment variables, find user variable path to edit, add ; F:\xampp\mysql\bin After the point is determined. Restart cmd, enter MySQL again to enter MySQL,
Resolves the environment variable problem, usually in the DOS command window input mysql-hlocalhost-uroot-p Enter the MySQL database, where- h indicates the server name, localhost indicates local; -U is the database user name, root is the MySQL default user name,-p is the password, if the password is set, can be directly after- p link input, such as:-p123456, Because no password is set by default when you install XAMPP, enter password is displayed and you can enter it directly.
This means that you have entered the MySQL database and can perform related operations. Enter show databases; you can display the database (the commands in the MySQL database must end with a semicolon)
If you want to exit the MySQL database, enter exit; Enter.
Password is empty, is not very good, so want to change the password is 123456, connect MySQL database, input command set password for [email protected] = password (' 123456 ');
To view the changes, enter Select User.password from Mysql.user;
The first non-empty password is a password 123456 that has just been reset by the root user, and this is done with a certain amount of encryption.
Enter Mysql-hlocalhost-uroot-p login again after exiting login,
The first direct return, the result error, the second input 123456 after the return, successfully entered MySQL.
CMD access for MySQL