- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Connecting to MySQL database from the command line?
To connect MySQL from the command line, firstly open command prompt. You can do this with the help of shortcut key “Windows + R”. On clicking, a panel will open and you need to type CMD and need to press OK button as shown below −
After pressing the OK button, you will get command line window.
Reach the MySQL Server “bin” directory as shown in the following screenshot −
Now you have reached the bin directory. Type the following statement in order to connect with MySQL.
mysql -u yourUserName -p
Apply the above statement to connect with MySQL. The snapshot is as follows with username “Manish” and password −
- Related Articles
- Connect to MySQL database from command line
- After connecting to MySQL server how can we select a database from command prompt?
- Command Options for Connecting to the MySQL Server
- Connecting to the MySQL Server Using Command Options
- How to create a database on command line in MySQL?
- How can we analyze the tables of a particular database from MySQL Server command line?
- How to repair MySQL tables from the command line?
- Connecting to a MySQL database with Java
- How to upgrade MySQL server from command line?
- How do I drop a MongoDB database from the command line?
- MySQL query to discover current default database collation (via command line client)?
- How can we get the list of tables in a particular database from MySQL Server command line?
- How can we return to windows command shell from MySQL command line tool?
- The MySQL Command-Line Client
- How to find the MySQL data directory from command line in Windows?

Advertisements