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. Use the df command to view the overall disk us...
Table of contents 1. Definition of stack 2. JS st...
First, download the diagram 1. First uninstall th...
Tomcat itself optimization Tomcat Memory Optimiza...
In the project (nodejs), multiple data need to be...
1. Introduction I recently worked on a project an...
Table of contents pom configuration Setting.xml c...
Table of contents Preface: 1. Understand lock wai...
Sometimes our pages will need some prompt boxes o...
Table of contents 1. Environment Introduction 2. ...
Table of contents introduction Why bother? Commun...
First, install openssh-server in docker. After th...
MySql Download 1. Open the official website and f...
Preface I encountered a situation at work: In the...
Overview One of the most powerful features of MyS...