Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Databases
  • SQL
  • MySQL
  • PostgreSQL
  • PL/SQL
  • MongoDB
  • SQL Cheat Sheet
  • SQL Interview Questions
  • MySQL Interview Questions
  • PL/SQL Interview Questions
  • Learn SQL and Database
Open In App
Next Article:
How to Stop MySQL Server on Windows and Linux?
Next article icon

How to Stop MySQL Server on Windows and Linux?

Last Updated : 27 Sep, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

MySQL is one of the most popular open-source relational database management systems. Whether we are managing a small development setup or a production environment knowing how to start and stop MySQL servers is essential.

In this guide, we will learn about the steps to start and stop MySQL servers on both Windows and Linux operating systems by using various methods such as command-line tools, services and MySQL Workbench.

How to Start and Stop MySQL on Windows?

Starting the Server:

There are three ways to start MySQL on Windows:

1.  With Services.msc

  • Step 1: Open the Services tab by typing services.msc in the Windows Run dialog.
  • Step 2: Search for the MySQL service in the list.
  • Step 3: Click on the "Start" or "Restart" button to start the MySQL daemon

2. Using Command Prompt:

  • Step 1: Open the Command Prompt.
  • Step 2: Type the command mysqld and hit Enter.

3. Using MySQL Workbench:

  • Step 1: Open MySQL Workbench, which is included in the MySQL complete package.
  • Step 2: Go to the "Administration" tab.
  • Step 3: Navigate to the "Startup/Shutdown" tab.
  • Step 4: You will find the option to start the server if it is not already running.

Stopping the Server

There are three ways to stop MySQL on Windows:

1. Using services.msc:

You can stop the MySQL service the same way you started it, by accessing the Services tab and clicking "Stop."

2. Using mysqladmin:

Execute the following command in the Command Prompt:

mysqladmin -u <username> shutdown

3. Using MySQL Workbench:

Go to the "Startup/Shutdown" tab under the Administration section in MySQL Workbench and click "Stop" to shut down the server.

How to Start and Stop MySQL on Linux?

Starting the Server:

1. Using the Command Line:

  • Step 1: Open the Linux terminal and navigate to the directory where mysqld is located.
  • Step 2: Type the command:
mysqld start

2. Using the service command (specific Linux distributions):

  • Step 1: Run the following command to start the MySQL service:
sudo service mysqld start

Stopping the Server:

1. Using the Command Line:

To stop the MySQL server, you can use either of the following commands:

mysqld stop

or

sudo service mysqld stop

2. Using mysqladmin:

You can also stop the server by running this command:

mysqladmin -u <username> shutdown

3. Using MySQL Workbench:

Go to the "Startup/Shutdown" tab in MySQL Workbench to stop the server.

Conclusion

Overall, learning how to start and stop MySQL servers is fundamental for database management across both Windows and Linux environments. Whether you're using command-line tools or graphical interfaces like MySQL Workbench, these methods ensure you can control your MySQL server with ease.


Next Article
How to Stop MySQL Server on Windows and Linux?

N

nikhilkalburgi
Improve
Article Tags :
  • SQL
  • Databases
  • Linux-basic-commands
  • SQL-Query

Similar Reads

    How to Install MySQL on Windows?
    Installing MySQL on Windows is a straightforward process that will allow you to utilize the power of one of the most popular relational database management systems (RDBMS). Whether you are working on a small project or scaling up for enterprise-level applications, MySQL is highly efficient, reliable
    6 min read
    How to Reset MySQL Root Password in Windows Using CMD?
    Ever locked yourself out of your own database? It happens to the best of us! If you’ve forgotten your MySQL root password on a Windows machine, don’t panic. MySQL is a powerful database management system, and the root user has complete control over it meaning losing access can feel like a nightmare.
    4 min read
    How to Start and Stop MongoDB Server?
    MongoDB, a popular NoSQL database, is used by numerous users for its flexibility, scalability, and performance. It is very important to know how to start and stop a server before deep diving into mongoDB. In this article, we'll provide a comprehensive guide on how to initiate and terminate MongoDB s
    2 min read
    How to Connect to MySQL Server
    MySQL is a widely utilized open-source relational database management system (RDBMS) known for its popularity and effectiveness in handling and structuring massive amounts of data. If you are a developer, data analyst, or someone who needs to store and manage data, MySQL is a highly adaptable and de
    5 min read
    How to Install SQL Workbench For MySQL on Windows?
    MySQL Workbench is a unified visual tool for database architects, developers & Database Administrators who need to design, manage, and maintain MySQL databases. It provides data modeling, SQL development & comprehensive administration tools for server configuration & user administration.
    5 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences