How to move MySQL to another drive in CentOS

Published on Author JFLeave a comment

This article covers the basic steps of moving a database to a new folder. It includes moving the db, as well as resetting SELinux/Apparmor policies. Depending on the OS configuration, MySQL may be running the /root mount where it is installed by default. There may be more drive space available in the /home directory. In… Continue reading How to move MySQL to another drive in CentOS

PDOException: SQLSTATE[HY000]: General error: 2006 MySQL

Published on Author JFLeave a comment

MySQL server has gone away. But where did it go? PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: This can be a tear your hair out kind of error, especially in Drupal. The solution, however, is often pretty simple: MySQL is out of connections. Or, more appropriately, max_allowed_packet is probably set too low… Continue reading PDOException: SQLSTATE[HY000]: General error: 2006 MySQL

HeidiSQL – Problem Migrating Databases

Published on Author JFLeave a comment

You’ve got a database you want to move or copy from, say, staging to production. You’ve had HeidiSQL open for a while and now it’s time to go live. You check your database in the left pane, then right click > Export database as SQL You check off “drop” to make sure all the tables… Continue reading HeidiSQL – Problem Migrating Databases

MySQL Performance Tuning Scripts

Published on Author JFLeave a comment

A couple handy scripts to help tune MySQL https://answers.launchpad.net/mysql-tuning-primer/+question/166577https://launchpad.net/mysqltuner https://answers.launchpad.net/mysql-tuning-primer/+question/166577 Update: not worth using these as the actually end being self-defeating. They use the very same resources that they suggest modifying and can skew the results. Apparently, tuning your db should be more about configuring your db for your purposes. http://dba.stackexchange.com/questions/45551/how-to-optimize-table-cache

View MySQL Char Set encoding for your database

Published on Author JFLeave a comment

Quick reference: For Schemas: SELECT default_character_set_name FROM information_schema.SCHEMATA S WHERE schema_name = “schemaname”; For Tables: SELECT CCSA.character_set_name FROM information_schema.`TABLES` T, information_schema.`COLLATION_CHARACTER_SET_APPLICABILITY` CCSA WHERE CCSA.collation_name = T.table_collation AND T.table_schema = “schemaname” AND T.table_name = “tablename”; For Columns: SELECT character_set_name FROM information_schema.`COLUMNS` C WHERE table_schema = “schemaname” AND table_name = “tablename” AND column_name = “columnname”; Thanks, as… Continue reading View MySQL Char Set encoding for your database