After playing a little bit with MySQL 5.6 (RC), and following closely on Giuseppe's MySQL 5.6 replication gotchas (and bugs), I was having some thoughts. These are shared for a few reasons: Maybe I didn't understand it well, and someone could correct me Or I understood it well, and my input could be of service [...]
Listing some useful sed / awk liners to use with MySQL. I use these on occasion. sed, awk & grep have many overlapping features. Some simple tasks can be performed by either. For example, stripping empty lines can be performed by either: grep '.' awk '/./' sed '/./!d' grep -v '^$' awk '!/^$/' sed '/^$/d' [...]
Have just read Darren Cassar's Recovering a MySQL `root` password – Three solutions. There's a fourth solution: using an init-file, which leads to just one restart of the database instead of two. It also avoids the security issue involved with using skip-grant-tables. I've written all about it before on Dangers of skip-grant-tables. Darren's 1st advice [...]
You have old_passwords=1 in your my.cnf. I'm guessing this is because you used one of the my-small.cnf, my-large.cnf etc. templates provided with your MySQL distribution. These files can easily win the "most outdated sample configuration file contest". Usually it's no big deal: if some parameter isn't right, you just go and change it. Some variables, [...]
Some of this is old stuff, but more people are now converting to InnoDB plugin, so as to enjoy table compression, performance boosts. Same holds for people converting to Percona's XtraDB. InnoDB plugin requires innodb_file_per_table. No more shared tablespace file. So your ibdata1 file is some 150GB, and it won't reduce. Really, it won't reduce. [...]
So you have a running MySQL server, it's working well and everyone's happy. You want to make a minor change to the configuration file, so you edit the file, restart MySQL - but the change doesn't catch! Or maybe you want to check that some global variable has not been dynamically changed without an update [...]
There's some confusion in the MySQL terminology for processes, threads & connections, which I will try to resolve. I can't explain the full nature of what processes and threads are; please see Wikipedia [1] [2] for that. But here's some basics with regard to MySQL: MySQL server is a single process application. It is multithreaded. [...]
The standard documentation and tutorials on MMM for MySQL, for master-master replication setup, suggest one Virtual IP for the writer role, and two Virtual IPs for the reader role. It can be desired to only have a single virtual IP for the reader role, as explained below. The two IPs for the reader role A [...]
I have a case where I must know if group_concat_max_len is at its default value (1024), which means there are some operation I cannot work out. I've ranted on this here. Normally, I would simply: However, I am using views, where session variables are not allowed. Using a stored function can do the trick, but [...]
Some mysqld parameters are far from having reasonable defaults. Most notable are the engine-specific values, and in particular the InnoDB parameters. Some of these variables have different defaults as of MySQL 5.4. innodb_buffer_pool_size, for example, is 128M on 5.4. innodb_log_file_size, however, has changed back and forth, as far as I understand, and is down to [...]