Home>Article>Database> How to enter mysql in cmd?

How to enter mysql in cmd?

青灯夜游
青灯夜游 Original
2019-05-20 16:09:04 50615browse

How to enter mysql in cmd?

Steps to enter mysql in cmd:

1. Press win r to open, enter cmd, and quickly open Command line interface, and then enter cmd

How to enter mysql in cmd?

How to enter mysql in cmd?

#2. Start the MySQL service

Use the following command:

net start myql

How to enter mysql in cmd?

3. Enter the mysql database

Enter the following command:

mysql -hlocalhost -uroot -p

How to enter mysql in cmd?

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.

How to enter mysql in cmd?

#3. Enter "show databases" and press Enter to display the databases you own.

How to enter mysql in cmd?

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn