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
I remember when I was interviewing for my current...
Introduction: When I looked at interview question...
Preface Excel is powerful and widely used. With t...
Table of contents 1. Use closures 2. Use ES6 clas...
Technical Background Latex is an indispensable to...
We know that in general, a function must be calle...
Vue3.0 has been out for a while, and it is necess...
This is a very important topic, not only for Linu...
The default scroll bar style in Windows is ugly, ...
error message: ERROR 2002 (HY000): Can't conn...
Preface In front-end programming, we often use th...
Method 1: SET GLOBAL general_log = 'OFF';...
If you need to use an image to implement the use ...
I once encountered an assignment where I was give...
1. Get the mysql image docker pull mysql:5.6 Note...