How to use the CMD command line to enter the MySQL database? Let’s learn how to operate it with the editor below.
Specific steps:
1. Open [Start]>>[Run] and enter [cmd] and click [OK]. A black window for the CMD command will appear. This is what we call the CMD command line, or use the shortcut Windows key (there is a key with the Windows logo on the keyboard) R. Enter cmd and press Enter.
2. Type the command in the CMD command window and press Enter to enter MySQL.
mysql -hlocalhost -uroot -p
(Note that "-h", "-u", and "-p" here cannot be omitted) Enter the mysql database, where "-h" represents the server name, localhost represents local; "-u" is Database user name, root is the MySQL default user name; "-p" is the password.
If a password is set, you can directly enter it in the link after -p, such as: -p888888. If the user does not set a password, when Enter password is displayed, just press Enter.
Note that if your MySQL is not installed on the C drive, first use the DOS command to enter the bin directory under the MySQL installation directory. The method is as follows: enter G: to enter the G drive), enter cd G:\phpstudy\mysql\bin to enter the MySQL bin directory, then enter mysql -hlocalhost -uroot -p and press the Enter key.
Recommended tutorial: MySQL video tutorial
The above is the detailed content of How to use cmd to enter mysql. For more information, please follow other related articles on the PHP Chinese website!