Steps to enter mysql in cmd:
1. Press win r to open, enter cmd, and quickly open Command line interface, and then enter cmd
#2. Start the MySQL service
Use the following command:
net start myql
3. Enter the mysql database
Enter the following command:
mysql -hlocalhost -uroot -p
After executing the above command, it will You will be prompted to enter the password. Enter the password and press Enter. When the following interface is displayed, it means that the mysql database is successfully connected.
#3. Enter "show databases" and press Enter to display the databases you own.
Note: -h represents the server name, localhost represents the local area; -u is the database user name, root is the mysql default user name; -p is the password, if set The password can be entered directly in the link after -p, such as: -p123456; if the user does not set a password, just press Enter when Enter password is displayed.
The above is the detailed content of How to enter mysql in cmd?. For more information, please follow other related articles on the PHP Chinese website!