Tag Archives: Mysql

Mysql is database software that easy to use and widespread

InnoDB Slower Update Performance

Yesterday, i had locking table problem in myIsam table. The solution proposed is to change existing myIsam table into InnoDB table. So we changed the engine table as proposed. For information, my existing table had about 50000 rows. Atfer changing the table functionality test was performed and the program worked well. But we notice another problem when real load is applied to the application. we notice the reduced TPS.

From mysql command “show full processlist”, we saw UPDATE query in action.

So in default localhos mysql server i tried to run that run the same query againts +- 5000 rows innodb table & +-5000 rows myIsam table

UPDATE testisam SET sent = sent + 1 WHERE id = ‘5000’;

Table isam, 100 query update on particular row

Id            sent       startupdate                        endupdate
5000       99           2015-09-23 15:48:53        2015-09-23 15:48:53

execution time ~ 1 s

 

UPDATE testinno SET sent = sent + 1 WHERE id = ‘5000’;

Table inno, 100 query update on particular row

Id            sent       startupdate                        endupdate
5000       99           2015-09-23 15:47:07        2015-09-23 15:47:11

execution time ~5 s

From the result above, in default configuration, UPDATE query to single row on innodb table will take longer time than myIsam table. While it is true that InnoDB engine will prevent table locking, several tuning and changes in query should be made in order to work well with InnoDB table.

So because this “tuning & changes in query” will take sometime to learn/read. I decided to revert back to MyIsam table.. 😛

 

Error establishing a database connection

Some of the problems sometimes arise with Mysql database and WordPress. One problem that sometimes arises is the web displays the error Establish a database connection, this problem usually occurs because we haven’t started yet our mysql-server program, or already started but not run well. The solution is simply to check whether or not our mysql running and try to run it.

To view mysql process id
ps -ax | grep mysql

If this command return you no result, it means your mysql doesn’t run.

To start mysql-server

On FreeBSD enter this command
/usr/local/etc/rc.d/ mysql-server start

On Ubuntu/Centos enter this command
service mysql start

It should solve your problem.