Database Design & Management Project using MySQL

Connect to MySQL Server

If this site saves you hours of work, please whitelist it in your ad blocker or

donate now

to support us creating more free content in the future.

Summary: in this tutorial, you will learn how to connect to MySQL Server using mysql command-line client and MySQL Workbench.
Once you have the
MySQL Server installed
, you can connect to it using any client program such as mysql command-line client and MySQL workbench.

Connect to MySQL Using mysql command-line client

mysql is a command-line client program that allows you to interact with MySQL in the interactive and non-interactive mode.
The mysql command-line client is typically located in the bin directory of the MySQL’s installation folder.
To invoke the mysql program, you just simply navigate to the bin directory of the MySQL’s installation folder and type:



If the mysql program is already in the PATH, you can simply invoke it using mysql command.
To connect to the MySQL Server, you use this command:


shell>mysql -u root -p

-u root means that you connect to the MySQL Server using the user account root.
-p instructs mysql to prompt for a password.
You type the password for the user account root and press Enter:


Enter password: ********

If everything is OK, you will connect to the MySQL Server with the following command:



To display the databases in the current server, you use the


mysql> show databases;

Here is the output:


| Database           |
| information_schema |
| mysql              |
| performance_schema |
| sys                |
4 rows in set (0.01 sec)

Connect to MySQL Using MySQL Workbench

Step 1. Launch the MySQL Workbench.

You can connect to a MySQL Server using the Database > Connect to Database… menu or click the + button that locates next to the MySQL Connections.
Just click the + button in next to the MySQL Connections to continue.
Step 2. Enter the connection name e.g., Localhost. You can name it whatever makes sense to you. By default, the username is root. If you use a different user account, you can change it in the Username textbox.

Step 3. Click the Store in Vault … button to enter the password for the provided user account. A window will display. You enter the password and click the OK button.

Step 4. Click the Test Connection button to test if the connection to the MySQL Server is successful or not. Then click the OK button if the connection is established successfully.

Step 5. Click the OK button to save the connection.

Step 6. Click the newly created connection under MySQL Connections to connect to the MySQL Server:

Step 7. MySQL Workbench display with the current schemas and a pane for entering queries:

In this tutorial, you have learned how to connect to the MySQL Server using mysql command-line client and MySQL Workbench.

Place your order
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
The price is based on these factors:
Academic level
Number of pages
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more
error: Content is protected !!
Open chat
You can contact our live agent via WhatsApp! Via + 1 929 473-0077

Feel free to ask questions, clarifications, or discounts available when placing an order.

Order your essay today and save 30% with the discount code GURUH