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.
#2. Next we will open CMD. Search for CMD as shown below and click Run.
##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.
##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.
##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.
##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!