CMD access for MySQL

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.