How to use mysql through cmd

1.First open the cmd/terminal and go to the root directory by using this command :

cd /
2.Aftet root directroy  go inside  xampp/mysql/bin directory by using the following commands :
cd xampp // inside xampp directory
cd mysql //inside mysql directory
cd bin   // inside bin directory
3.Now access your mysql by mysql username and password :
mysql -u root -p // here root is the mysql user name.
When you run the above command you will get the screen given below if your root user has any password then enter the password and if root has no password press enter. After this you will enter in the mysql Now use the command   show databases;  you will get all databases if you use a particular database use this command
use database_name;
after this you can perform select, insert,update,delete operation on the tables available in this database. If you want to see all available table inside a database use this command :
show tables;

Recommended Tutorials for you


Anuj kumar

This is Anuj Kumar. I’m a professional web developer with 5+ years of experience. I write blogs in my free time. I love to learn new technologies and share with others. I founded PHPGurukul in September 2015. The main aim of this website to provide PHP, Jquery, MySQL, PHP Oops and other web development tutorials. .

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Check Also
Back to top button