Home >Database >Mysql Tutorial >How to open mysql database from terminal
How to open the mysql database from the terminal: First, under the Windows operating system, click [Start-Run]; then enter cmd, and click [OK]; finally enter the login MySQL database command [mysql - in the DOS window h 127.0.0.1 -u root -p].
The operating environment of this tutorial: Windows 7 system, mysql version 8.0.22. This method is suitable for all brands of computers.
How to open the mysql database from the terminal:
Under the Windows operating system, start - run, open the "Run" dialog box, enter cmd, and click "OK" You can enter the DOS window.
Enter the command to log in to the MySQL database in the DOS window
mysql -h 127.0.0.1 -u root -p
Command parameter description:
mysql is the command to log in to the database,
-h
is followed by the IP of the server. Since the MySql server in this example is installed locally, the IP address is 127.0.0.1;
-u
Followed by the user name, this example uses the root user to log in;
-p
followed by the login password.
Enter the above command and press Enter, then enter the login password and press Enter to complete the login to the MySQL database service. Then you can run the use databaseName
statement to operate a certain database
Related free learning recommendations: mysql video tutorial
The above is the detailed content of How to open mysql database from terminal. For more information, please follow other related articles on the PHP Chinese website!