System Status
Buy Now
  • Email & Apps
  • Office 365
Login
  • MyRackspace Portal
  • Cloud Control Panel
  • Rackspace Webmail Login
  • Cloud Office Control Panel
  • Support Home
  • How-To
  • Developer Documentation
  •  Blogs 
    • Expert Insights Tech Blog
    • Rackspace Blog
    • Solve: Thought Leadership

Support Network

End-to-End Multicloud Solutions.   Solving Together.â„¢   Learn more at Rackspace.com

How–To Home

Cloud Servers

  • Introduction
  • FAQ
  • All Articles

How to resolve MySQL service starting and stopping unexpectedly

Last updated on:  2021-03-11

Authored by:  Uriel Amar


This article describes the process of resolving the following MySQL® for Windows® error:

MySQL service on local computer started and then stopped. Some services stop automatically if they are not in use by other services or programs.

The solution varies depending on your version of MySQL. Attempt the solutions in the order of the following sections.

Restart the service

Restart the MySQL service by running the following command:

mysqld --initialize

You need to log in as root or use sudo -i to run this command.

Reinstall the service

Log in as root and reinstall the MySQL service by running the following commands:

mysqld --install
mysqld --initialize 

Verify the my.ini config file

Certain versions of MySQL add invalid hex values at the beginning of the my.ini configuration file. Deleting the first three hex values using a hex editor should resolve this issue. This occurs because of an issue with a script line. The line specifies that each file must have a unique ID, which then appends the byte order to mark the text file.

If you have a backup of the original my.ini file, you can copy the contents of this file and manually paste them onto the current my.ini to resolve this issue.

Verify the Network Service permissions

You might need to verify that the Network Service has the proper permissions. Use the steps in this section to verify these permissions are correct:

  1. Right-click the Data folder.

  2. Select Properties.

  3. Select the Security tab.

  4. Click Advanced.

  5. Click Change Permissions….

  6. Click Add….

  7. Enter NETWORK SERVICE.

  8. Click Check Names.

  9. Click OK.

  10. Select Full Control.

Check for missing default files

It’s possible that default files are missing. Use the steps in this section to check for this missing default files:

  1. Open the command prompt.

  2. Go to the MySQL *bin* and run the following command:

    mysqld --defaults-file="C:\Program Files\MySQL\MySQL Server 5.0\my.ini" --standalone --console
    
  3. If it specifies a missing default folder, you should create a new default file.

Share this information:

©2020 Rackspace US, Inc.

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License

See license specifics and DISCLAIMER

About Rackspace
  • About
  • Customer Stories
  • Events
  • Programs
Blogs
  • The Rackspace Blog
  • Expert Insights Tech Blog
  • Solve: Thought Leadership
  • News
  • Contact Information
  • Legal
  • Careers
Site Information
  • Style Guide for Technical Content
  • Trademarks
  • Privacy Statement
  • Website Terms
Support Network
  • Support Network Home
  • Rackspace How-To
  • API Documentation
  • Developer Center
  • ©2020 Rackspace US, Inc.