Home > Database > Mysql Tutorial > How to use CMD to connect to the local mysql database

How to use CMD to connect to the local mysql database

黄舟
Release: 2017-08-07 14:51:19
Original
2339 people have browsed it

Many IT personnel who are engaged in data work will deal with Mysql database. Because the MySQL database is an open source database, there are many people who use it to learn databases. Today, the author will share with you how to use CMD to connect to the local mysql database after installing mysql.

1. The first step is to install Mysql. After installation, we can go to our program to find this software. The author installed the Mysql5.7 version.

How to use CMD to connect to the local mysql database


#2. Next we will open CMD. Search for CMD as shown below and click Run.

How to use CMD to connect to the local mysql database


##3. After opening CMD, we need to Use this command "net start mysql57" to start the mysql service.

How to use CMD to connect to the local mysql database


##4. What we need to find next It is the installation directory of mysql. The author's installation directory is: "C:\mysql57\soft\bin". Then we will use this command: "cd C:\mysql57\soft\bin" to find this directory.

How to use CMD to connect to the local mysql database


##5. After finding this directory, we Now we can start connecting to our database. To connect to the local database, the command we need to use is: "mysql -u root -p". After pressing Enter here, we will be asked to enter the password.

How to use CMD to connect to the local mysql database

##6. Finally, we set up the Enter the password. Note that the password will not be displayed here. Once entered correctly, the connection will be successful.

How to use CMD to connect to the local mysql database##Notes

The author installed mysql57. The steps for connecting to other versions of mysql are the same. When installing the database, we will be prompted to set a password. After setting it, it is best to save it in a place to prevent forgetting it.

The above is the detailed content of How to use CMD to connect to the local mysql database. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template