If you want to learn how to run MySQL on command prompt, this is a quick tutorial that will guide you on how you can start MySQL running on command prompt and a accomplish lots of other database management tasks using the CLI.
If you are running WordPress, you can Create MySQL Database WordPress via Command Line as I explained and illustrated in that tutorial.
For WordPress users you can also learn how to connect MySQL to WordPress during WordPress installation as I explained on this guide – Connect WordPress to MySQL Database Step by Step
How to Run MySQL on Command Prompt
- First open Command prompt from the search bar on your Windows machine by typing CMD as shown on the screenshot below :
- After you open the command prompt you need to ensure MySQL is running in your local server. For example in the previous tutorial I used XAMMP to illustrate how you can access the folder where MySQL is located for you to run it. If you missed that tutorial, you can check it out here – Create MySQL Database WordPress via Command Line. Today, I am using a different localhost environment a lightweight server called laragon. So as you can see on the image above need to navigate to directory where the MySQL is located.
- Now you can start MySQL in Windows Command prompt using the following command:
mysql.exe –u<username> –p
- You should replace the -u and -p with the respective username and password of your MySql database. If you have followed all the steps in the right way you should successfully run MySQL on command prompt.
- In my case you can see that I added the username and the password and MySQL run successfully and you can now go ahead to user other MySQL command prompt commands to access the databases and manage the data.
Conclusion
In this tutorial, I have explained how to run MySQL on command prompt in Windows. The most important step that you should remember is the location of your MySQL installation. This in most cases its located inside a folder named Bin that is in you local server installation root. I hope this tutorial helps you learn more how to use MySQL on command prompt.
Joe is an experienced full-stack web developer with a decade of industry experience in the LAMP & MERN stacks, WordPress, WooCommerce, and JavaScript – (diverse portfolio). He has a passion for creating elegant and user-friendly solutions and thrives in collaborative environments. In his spare time, he enjoys exploring new tech trends, tinkering with new tools, and contributing to open-source projects. You can hire me here for your next project.
Similar Articles
- How to Move WooCommerce Checkout Field
- How to Get Order Details After Checkout In WooCommerce
- How to Create WooCommerce Login Logout Shortcode
- How to Check if User is Logged In WordPress
- Top 30+ Best WordPress Form Plugins » Best WordPress Form Plugin
- How to Remove Product Category Title WooCommerce
- 15+ Best WordPress Maintenance Services » WordPress Website Care
- 35+ Best Free Form Plugin WordPress
- Elementor Review 2021 » Features, Pros, Cons, Pricing & Tutorial
- How to Get Order ID In WooCommerce
- 30+ Best WordPress Backup Plugins to Protect Your Site
- How to Connect WordPress to MySQL Database Step by Step Complete Guide
- How to Create MySQL Database WordPress via Command Line
- How to Change Add to Cart Button Text In WooCommerce Shop Page
- 5+ Best WordPress Redirect Plugins for Better SEO
- How to Change WooCommerce Email Footer Text
- How to Make Divi Mobile Menu Scrollable Quick Fix Solution
- How to Change WooCommerce Storefront Layout
- 30+Best WordPress Blogs Plugins for Successful Blogging
- How to Hide Any Tab My Account Page WooCommerce
- How to Setup WooCommerce Storefront Blog