How to run MySQL command || Run MySQL queries on PC

  How to run MySQL command




What is MySQL

MySQL is a relational database management system.

MySQL was first released in 1995.
It is open source and free to all.
MySQL is developed, distributed, and supported by Oracle Corporation.

How to run MySQL

To run MySQL in your system you need to follow these steps written below:

1] First install MySQL or you can also install the xampp.

2] I suggest you install XAMPP so that you can also use it for other works like running PHP programs or tracking the database.

3] To install XAMPP you can follow this link

https://www.apachefriends.org/download.html

4]Now go to the Command Prompt in your system.

5]Open this directory in cmd :

C:\xampp\mysql\bin

by changing directories.

6]Now your terminal will look like this-



7] Now write this command:-

mysql -u root -p

8] Now it will ask for a password. Just click enter, there is no need to enter a password.



9] You can get an error like below if you haven't started the MySQL from xampp control panel.

ERROR 2002 (HY000): Can't connect to MySQL server on 'localhost' (10061)

10] Go to Xampp control panel and start MySQL.

11]Now run the previous command again. It Shows like this



 Now you can write MySQL queries.

12] Write a command like

SHOW DATABASES;

13] It will show all databases which are in the system.

If you have any problem, you can contact me.

You can learn the MySQL commands in my next blogs.












Post a Comment

0 Comments