1. Press win + R and type cmd to enter the DOS window. 2. Switch to the installation directory of MySQL server, that is, the directory where mysql.exe is located. For example: cd C:\Program Files\MySQL\MySQL Server 5.5\bin 3. Execute the command to access the database: For example: mysql -hlocalhost -P3306 -uroot -p -h: server IP, localhost means local; -P: port number, the default is 3306, optional. -u: database connection user name -p: Password. If a password is set, you can add it directly after -p. If no password is set, you do not need to set it. 4. Access the database and use it. (1) Query the database instance: show databases; (2) Select the database: use + database name, for example: use my. If the prompt "Database changed" appears, it means that the database has been switched to. (3) Query all tables: show tables; (4) Query table column names, table data and other data operations. example: show columns from user; select uname,upass from user; More operations to be continued. . . This is the end of this article about entering the DOS window to access the MySQL database through cmd under Windows. For more relevant content about accessing MySQL from the Windows cmd window, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Vue implements the full selection function
>>: How to use CSS attribute selectors to splice HTML DNA
1. Introduction Recently I found that there are m...
Writing a Dockerfile Configure yum source cd /tmp...
Result:Implementation code: html <!-- Please h...
background During development, we may need some s...
Table of contents 1. Create objects by literal va...
Connections can be used to query, update, and est...
This article attempts to write a demo to simulate...
This article records the installation and configu...
Achieve results Implementation Code html <div ...
The best thing you can do for your data and compu...
1. Overall architecture diagram Compared to other...
Let's start with a description of the problem...
Table of contents Introduction: Installation of e...
async function and await keyword in JS function h...
Website, (100-1)% of the content is navigation 1....