Thesql high cpu usage (no have slow queries)

MySQL

I have a problem with mysql. MYSQL High CPU Usage (300%-400%). But I cannot find solution to handle it. I optimized config mysql.
I think maybe my server has a problem, but What do I need to do to find the problem and how to fix it.

Infomation:

  • Server not have slow queries
  • SHOW FULL PROCESSLIST; => Only 7 connection (not lock).
  • show engine innodb status => ROW OPERATIONS
0 queries inside InnoDB, 0 queries in queue
5 read views open inside InnoDB
Process ID=25898, Main thread ID=140213805094656, state: sleeping
Number of rows inserted 16646, updated 89843, deleted 48, read 45381116563
0.50 inserts/s, 0.00 updates/s, 0.00 deletes/s, 2140759.81 reads/s
  • mysqld.log have so many line as (it happens continuously once every second):
Access denied for user 'test'@'139.198.168.221' (using password: YES)
Access denied for user 'root'@'139.198.168.221' (using password: YES)
Access denied for user 'ODBC'@'218.59.174.83' (using password: YES)
Access denied for user 'mysqld'@'218.59.174.83' (using password: NO)
Access denied for user 'root'@'180.215.129.37' (using password: NO)
Access denied for user 'server'@'112.121.189.218' (using password: NO)
[Warning] Host name 'zg-0416b-112.stretchoid.com' could not be resolved: Name or service not known
[Warning] Host name 'zg-0416a-245.stretchoid.com' could not be resolved: Name or service not known

Best Answer

Somebody is trying to hack your server using bots (all these log entries are login attempts). To be honest I see the same atempts in my logs all the time. To check if this is the source of your server overload (I am not sure...) try to restrict network connections to mySQL: uncomment this line in your mysqld.cnf

bind-address    = 127.0.0.1

Then restart your mySQL and check the load.