Mysql and System time diffrence

MySQL time zone different from system time zone the system time zone will be different than the one in MySQL, even though MySQL is set to use the system time zone. This normally means that a user has changed the system time zone, but they haven’t started MySQL to cause it to change as well. … Read more

Add federated to Mysql

I know the post is a little old, but it seems that many people are having issues with federated engines. When the mysql binaries are installed via yum, you already have the HA (High Availability) plugins. You simply need to load the plugins within the mysql CLI. Here is the basic process: Start mysqld if … Read more

MySQL’s wait_timeout and interactive_timeout Variables

Ever get these errors? Mysql reporting error when accessing plesk. Zend_Db_Adapter_Exception: SQLSTATE[08004] [1040] Too many connections. You can set-variable=max_connections=250 to /etc/my.cnf and restart and use mysql close statements for php code. Or, set up mysql to close sleeping processes. Mysql Config. (/etc/my.cnf) wait_timeout variable represents the amount of time that MySQL will wait before killing … Read more

MySQL InnoDB Recovery

Mysql Recovery. Error logs shows: When page in clustered key index is corrupted. It is worse compared to having data corrupted in secondary indexes, in which case simple OPTIMIZE TABLE could be enough to rebuild it, but it is much better compared to table dictionary corruption when it may be much harder to recover the … Read more

Migrate MySQL from Slaved Drive

Migrate MySQL from Slaved Drive 1. Mount the slave drive. We’ll assume you mounted it at /media/slave Find the drive: sdb is the drive – the slaved drive after the reinstall Check to see if it is ext3 or ext4 Mount according to ext3 or ext4 Add to fstab 2. Edit the MySQL config file … Read more

Optimize Mysql

Did you know that mysql comes with configuration files for better optimization? These files are located at: /usr/share/doc/mysql-server-5.1.71/my-huge.cnf /usr/share/doc/mysql-server-5.1.71/my-innodb-heavy-4G.cnf /usr/share/doc/mysql-server-5.1.71/my-large.cnf /usr/share/doc/mysql-server-5.1.71/my-medium.cnf /usr/share/doc/mysql-server-5.1.71/my-small.cnf /usr/share/man/man5/openssl.cnf.5ssl.gz Or /usr/share/mysql/my-huge.cnf /usr/share/mysql/my-innodb-heavy-4G.cnf /usr/share/mysql/my-large.cnf /usr/share/mysql/my-medium.cnf /usr/share/mysql/my-small.cnf Stop mysql # service mysqld stop Stopping mysqld: [ OK ] backup the original my.cnf file. # mv /etc/my.cnf /etc/my.cnf.original Move the new config file to … Read more

Mytop

Install the repository CentOS 5.x rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm CentOS 6.x 64 bit rpm -Uhv http://apt.sw.be/redhat/el6/en/i386/rpmforge/RPMS/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm Install mytop yum -y install mytop Configuration Odds are, you will get an error initially running this program unless you configure it first. whereis mytop Example: /usr/bin/mytop or /usr/local/bin/mytop nano /usr/bin/mytop or nano /usr/local/bin/mytop Locate the following lines: my %config … Read more

Debugging sleeping connections with MySQL

Have you ever seen connection in the SHOW PROCESSLIST output which is in “Sleep” state for a long time and you have no idea why this would happen ? I see if frequently with web applications and it is often indication of trouble. Not only it means you may run out of MySQL connections quicker … Read more