As you may know, I started working with high load MySQL servers in 2010 (and then there are several entries that were noted in 2012 after I purchased back this domain :-D) and I mostly go with multi-slaves replications. These might be true in many practical cases where most of […]
MySQL
Recently I often faced problems with MariaDB Galera Cluster, so I decided to give Percona XtraDB Cluster a try. I write here necessary steps to setup a PHP Stack with Percona XtraDB Cluster on CentOS 7. To avoid problems, be sure that SELinux is not enabled in the server. Guide can be found […]
In this quick tutorial I will list out some necessary steps to setting up mariadb galera cluster on CentOS. The selected CentOS version is 6.5 and the MariaDB is running with the 10.0 version. Preparation We will need to install required softwares as regular: Disable SELinux: [bash]setenforce 0[/bash] Add MariaDB repo […]
In most recent mysql-based applications today, InnoDB is used as the database engine due to its great supported features such as transaction, foreign key, etc. But if the DB server is not configured properly, it might cause significant impact on the application performance. This quick article summarize some suggested tweaks for […]
Some rules we should remember when doing MySQL index query: Index uses B-TREE, so be sure we understand how B-Tree works. Index is left-most, so if there is (c1, c2, c3) index, then query WHERE c1 = 1 AND c2 = 2 does use index, but not WHERE c2 = 2 When […]
Upgrading from MySQL 5.1 to MySQL 5.5 / 5.6 when there is existing data is quite head-cache and scary story. Some notes might also help you when do upgrading: After upgrading, we need to run mysql_upgrade. In order to do that, we must have the mysql service running[bash]mysqld –skip-grant-tables –user=mysql mysql_upgrade […]
Every developers might also understand how important index is when performing query but not of all do really care about how MySQL Query Optimization works. In the most cases, developers will think that index will work as it is and do not check in detail how index really work for […]
In your development work, there are sometimes you forgot the mysql root password so you cannot make any system-level change to the mysql server. This quick tutorial tells you how to reset mysql root password in CentOS. First, need to stop MySQL:[bash]root# service mysqld stop[/bash] Then, start MySQL in safe […]
Normally MySQL replication will stop whenever there is an error running a query on the slave. This happens in order for us to be able to identify the problem and fix it, and keep the data consistent with the mater that has sent the query. You can skip such errors, even if […]
When working with replication on very big table, we may face problem when update table structure (such as adding an index, removing an index, adding a field, etc.). There are few cases (such as changing indexes) running a local sql is better than having it goes with replication, since the […]