Category Archives: MySQL

MySQL Indexing Stuff

#Determine whether a table is indexed show index from [table name] #Display a table’s index mysql> show index from mysql.user; +——-+————+———-+————–+————-+———–+————-+———-+——–+——+————+———+—————+ | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | … Continue reading

Posted in Linux, MySQL | Comments Off on MySQL Indexing Stuff

MySQL Replication Tools

If replication stops and the slave status shows: Last_Errno: 1580 Last_Error: Error ‘You cannot ‘ALTER’ a log table if logging is enabled’ on query. Default database: ‘mysql’. You need to skip over a bad query as follows: mysql> SET GLOBAL … Continue reading

Posted in Linux, MySQL | Comments Off on MySQL Replication Tools

MySQL went away errors

This means that the server timed out and closed the connection. Two most common reasons (and fixes) for the MySQL server has gone away (error 2006) are: Your wait_timeout variable in your MySQL my.cnf configuration file is not large enough. … Continue reading

Posted in Linux, MySQL | Comments Off on MySQL went away errors

MySQL bin logs

To create bin-logs enable log-bin, set that to a directory (/var/lib/mysql) Restart mysql To read them out: mysqlbinlog /var/lib/mysql/bin-log.000001 > /root/textform

Posted in Linux, MySQL | Comments Off on MySQL bin logs

How to Index For Joins in MySQL

http://hackmysql.com/case

Posted in Linux, MySQL | Comments Off on How to Index For Joins in MySQL

ReSync MySQL Master Slave

At the master: RESET MASTER; FLUSH TABLES WITH READ LOCK; SHOW MASTER STATUS; And copy the values of the result of the last command somewhere. Wihtout closing the connection to the client (because it would release the read lock) issue … Continue reading

Posted in Linux, MySQL | Comments Off on ReSync MySQL Master Slave