What is Mysqld.exe & How to Fix its High CPU Usage

Adjust MySQL configuration or upgrade MySQL server

Reading time icon 5 min. read


Readers help support Windows Report. We may get a commission if you buy through our links. Tooltip Icon

Read our disclosure page to find out how can you help Windows Report sustain the editorial team Read more

Key notes

  • The mysqld.exe is part of the MySQL Server Software developed by Oracle software developer.
  • When you run the MySQL software on your computer, the tasks within mysqld.exe will be carried out on your PC.
  • High CPU usage by mysqld.exe indicates heavy load or performance issues in the MySQL server.
mysqld.exe

Sometimes, it is normal for certain programs like video editors or IDEs to be demanding and use a lot of CPU time and memory. However, if a program like mysqld.exe which used to be a lightweight program suddenly starts to consume CPU time and/or memory, it could be a sign of underlying issues.

In this guide, we will explain what mysqld.exe is, examine the factors causing high CPU usage in this MySQL process, and offer practical solutions to fix the issue.

What is Mysqld in Task Manager?

The mysqld.exe is a process associated with the MySQL database management tool. The process is responsible for running the MySQL server, which allows clients to connect to the database, execute queries, and perform various database operations.

When you install MySQL on your system, the mysqld.exe file is usually located in the MySQL installation folder, and it is launched when you start the MySQL server. Once the client connection is established, it handles the incoming requests, executes SQL commands, and manages the underlying data.

Why does mysqld.exe use so much CPU?

The mysqld.exe is a crucial component of MySQL and is responsible for the core functionality of the database server. The process runs in the background as long as the MySQL server is running, silently carrying out its tasks.

High CPU usage by mysqld.exe can be caused by various factors. Here are some common reasons:

  • Poorly optimized queries: Inefficient or poorly written queries can cause high CPU usage.
  • Increased simultaneous connections: A large number of simultaneous connections to the MySQL server can lead to increased CPU usage.
  • Insufficient hardware resources: Insufficient hardware resources, such as limited CPU cores or insufficient memory, can result in high CPU usage.
  • Server overload: If the MySQL server is handling a heavy load or experiencing a sudden surge in traffic, it can cause high CPU usage.
  • Bad indexing: Missing or improper indexes can lead to excessive CPU usage during query execution.
  • Software bugs or compatibility issues: Bugs or compatibility problems can cause abnormal CPU usage.

How do I fix mysqld.exe high CPU usage?

1. Use MySQL’s built-in monitoring tools

Note icon NOTE
Use MySQL’s built-in monitoring or third-party monitoring tools to check for specific queries or processes that consume a significant amount of CPU resources.
  1. First, connect to your MySQL server using a MySQL client (e.g., MySQL Workbench)
  2. Open the Start menu, type MySQL 8.0 command line client (for MySQL 8.0), and launch the tool.launch mysql client
  3. To access the Performance Schema tables, type the following command and press Enter:SELECT * FROM performance_schema.events_statements_summary_by_digest ORDER BY `SUM_TIMER_WAIT` DESC;performance schema
  4. By running this command, you can see the queries that take the longest time to execute, which can help you find out what might be causing the issue. Look at the results to find the queries or processes that are using a lot of CPU power.

2. Review and adjust MySQL configuration

  1. Open File Explorer and navigate to the following location:C:\ProgramData\MySQL\MySQL Server 8.0g to sql configuration file
  2. Right the file named my.ini and select Open with.my.ini
  3. Then, select Notepad and click Always.Notepad
  4. Find the parameter named innodb_buffer_pool_size and modify the value to an appropriate amount of memory for your server.
  5. Choose a value that suits the size of your server and database, like 1 for 1 gigabyte of memory.Set innob pool size
  6. Next, locate the parameter called max_connections and decrease its value to a lower number, such as 100.max connections
  7. By lowering this value, you can limit the workload and restrict the number of simultaneous connections allowed to the MySQL server.
  8. After making the necessary changes, click File and select Save to save the configuration file.Save the file
  9. Restart the MySQL server to apply the new configuration.
  10. Then, monitor the mysqld.exe process to see if it still uses a lot of CPU resources.

3. Upgrade MySQL

Note icon NOTE
Before you start the upgrade, it’s better to make backups of your databases to prevent losing any data. You can use tools like mysqldump or programs like MySQL Workbench to create backups of all your databases.
  1. Press the Windows key, type MySQL Installer and select the MySQL Installer – Community app from the search result.MySQL Installer
  2. In the MySQL Installer dashboard, click the Catalog button.Catalog
  3. Then, click on Execute to download the latest changes to the catalog. Execute
  4. Click Yes on the prompt box to download the most up-to-date information for the upgrade.Yes
  5. Then, click Next to review the update history.click Next
  6. Click Finish to get back to the MySQL Installer dashboard.Finish
  7. After that, click Upgrade to view will see a list of products with newer versions available.Upgrade
  8. Follow the installer instruction to update MySQL products.
  9. After upgrading, you may need to reconfigure the upgraded MySQL server. You will need to set up parameters such as port number, root password, and other configuration options.
  10. Lastly, restart your computer and launch MySQL again. Check if the mysqld.exe process is still using a lot of CPU

4. Upgrade your hardware

If your server always has high CPU usage, consider improving your server’s performance by upgrading the hardware or allocating more resources.

This means adding more things like CPU cores, memory (RAM), or storage. When the server doesn’t have enough resources, it can’t handle the workload properly, and that causes high CPU usage.

Data corruption and data loss are common problems in MySQL servers. If you’re experiencing these issues, let’s take a look at the steps required to repair a corrupted database in SQL Server.

Please feel free to share in the comments below the solution that worked for you in fixing this issue.

More about the topics: sql server, Windows 11