How to use the CMD command to open and enter the MySQL database under Windows? Let’s learn it with the editor.
Operation steps:
1. Open [Start]>>[Run], enter [cmd] and click [OK] A black window for the CMD command appears. 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
mysql -hlocalhost -uroot -p
in the CMD command window and press Enter (note that "-h", "-u", and "-p" here cannot be omitted) to enter the mysql database , where "-h" represents the server name, localhost represents the local area; "-u" is the database user name, and 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, the user has 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.
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!