Showing entries 13343 to 13352 of 44049
« 10 Newer Entries | 10 Older Entries »
MySQL Security Webinar: Follow-up Q&A

Thanks to everyone who attended last week’s webinar on MySQL security; hopefully you’ve all gone out and set SELinux to enforcing mode if you weren’t already running that way. If you weren’t able to attend, the recording and slides are available for viewing/download. But now, without further ado, here are the questions which we didn’t have time to cover during the presentation.

Q: Do you have a favorite software firewall you recommend that I can run on an EC2 instance in front of my MySQL server?
A: I’d probably just do this with iptables. Any of the other Linux-based software firewall packages are all going to be wrappers around iptables anyway. However, if …

[Read more]
Running out of Disk Space? Move innodb-tables to another partition (with MySQL 5.6)

Recently i had to manage big database installation that was running out of disk space. The partition on which the mysql datadir was located only had a few gigabytes free. Resizing the partition was not possible without a long downtime so that was no option. The installation had only innodb-tables so using symlinks was also not possible.

Luckily they were using MySQL 5.6 and the server had another partition with more than enough disk space available so i decided to use that partition for the biggest tables.

First get the 15 biggest tables:

root@mysqlserver [(none)]> set global innodb_stats_on_metadata=0; select table_schema, table_name "Table Name",round(sum(data_length+index_length)/1024/1024/1024,4) "Size (GB)" from information_schema.tables group by table_schema,table_name ORDER BY round(sum(data_length+index_length)) DESC LIMIT 15;
 Query OK, 0 rows affected (0.00 sec)
[Read more]
The Galera installation guide for dummies.

The Galera series

 

Overview and some history

Some years ago (2011), I was presenting in one article what at that time I have call “A dream on MySQL parallel replication” (http://www.tusacentral.net/joomla/index.php/mysql-blogs/96-a-dream-on-mysql-parallel-replication).

At that time I was dreaming about having a replication mechanism working on the commit operations, and was also trying to explain how useless is to have parallel replication by schema. I have to say that I got a lot of feedback about that article, directly and indirectly, most of it telling me that I was crazy and that what I was looking for cannot be done.

 

The only crazy guy that was following me in my wandering was Herik Ingo, who mentions to me Codership and Galera.

After …

[Read more]
Setting up Jenkins Continuous Integration for a PHP project on a Mac Mini Server

With one of my previous post I have run through the steps involve in setting up Jenkins and today I’m going to discuss about the how to get a PHP project integrated with Jenkins on a Mac Mini server(It’s a pain in the ass compared to a Linux box when it comes to setting up […]

Cloning MySQL 5.6 instances

A tip for all those cloud users that like cloning database servers (as reported in my book Effective MySQL – Replication Techniques in Depth).

Starting with MySQL 5.6, MySQL instances have a UUID. Cloning servers to quickly create slaves will result in the following error message.

mysql> SHOW SLAVE STATUSG
...
  Last_IO_Error: Fatal error: The slave I/O thread stops because master and slave have equal MySQL server UUIDs; these UUIDs must be different for replication to work.
...

The solution is simple. Clear our the file based configuration file (located in the MySQL datadir) and restart the MySQL instance.

$ rm -f /mysql/data/auto.cnf
$ service mysql restart
eq_range_index_dive_limit system variable in MySQL 5.6

MySQL5.6 introduced a new system variable eq_range_index_dive_limit. This may significantly affect query execution plans. Here I show a typical example.

 

There is a table "t". Primary key consists of multiple columns starting from "id1". There are 1.67M rows in table t, and cardinality of id1 is 46K (These numbers can be collected by SHOW TABLE STATUS / SHOW INDEX). So there are 36 rows (1.67M/46K=36) per id1 on average, but actual id1 distribution is not even. There are nearly 1M rows where id1 between 1 and 10.

 

mysql> explain select count(*) from t force index (PRIMARY) where id1 in (1,2,3,4,5,6,7,8,9)\G

*************************** 1. row ***************************

[Read more]
eq_range_index_dive_limit system variable in MySQL 5.6

MySQL5.6 introduced a new system variable eq_range_index_dive_limit. This may significantly affect query execution plans. Here I show a typical example.

 

There is a table "t". Primary key consists of multiple columns starting from "id1". There are 1.67M rows in table t, and cardinality of id1 is 46K (These numbers can be collected by SHOW TABLE STATUS / SHOW INDEX). So there are 36 rows (1.67M/46K=36) per id1 on average, but actual id1 distribution is not even. There are nearly 1M rows where id1 between 1 and 10.

 

mysql> explain select count(*) from t force index (PRIMARY) where id1 in (1,2,3,4,5,6,7,8,9)\G

*************************** 1. row ***************************

[Read more]
OurSQL Episode 151: Tooling Around, Part 1

This week we start talking about the Python MySQL Utilities. Ear Candy is a pitfall when importing a mysqldump export and At the Movies is "Deploying MySQL in AWS and OpenStack" by Mark Riddoch of SkySQL.

Part 2 of MySQL Utilities
Part 3 of MySQL Utilities
Part 4 of MySQL Utilities
Part 5 of MySQL Utilities

MySQL Utilities
MySQL Utilities documentation

read more

Oracle Linux 6.4 and MySQL 5.6

Oracle Linux had a lot of engineering hours inside it to drive the performance to new levels. But currently oracle Linux 6.4 comes with a dated version of MySQL, version 5.1.69. So how can you upgrade to 5.6 without losing your data?

First, make a backup just in case Murphy’s Law has a tort waiting for you.

Remove the old files. The rpm -qa | grep -i ^mysql command will show you the packages to be removed. Then rpm -e mysql-server-5.1.69-1.el6_4.x85_64 mysql-libs-5.1.69-1.el6_4.x86_64 and mysql-5.1.69-1.el6_4.x85_64 to remove them.

Thirdly, download the big MySQL 5.6 bundle for Oracle Linux. Untar the bundle and then a quick rpm -Uhv MySQL-*.rpm will install the files.

There is ONE big difference. MySQL as of 5.6, forces a default for the MySQL server and places it in /root/.mysql_secret and you will see to set a new password upon …

[Read more]
MySQL forçar usuário a trocar a senha

Send to Kindle

Desde a versão 5.6.6 MySQL introduziu o habilidade the forcar usuários a trocar suas senhas.
Tu pode fazer isso digitando ALTER USER PASSWORD EXPIRE.

ALTER USER 'marcelo'@'localhost' PASSWORD EXPIRE;

Na próxima vez que marcelo tentar conectar ao MySQL via localhost, o servidor ira bloquear todos os comandos até que o usuario use SET PASSWORD;

mysql> \s
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement

Para alterar a senha, e utilizar o server normalmente, basta digitar:

SET PASSWORD = PASSWORD('senha');
#Ou utilizando o hash gerado por SELECT PASSWORD('senha');
SET PASSWORD = '*AD77F56D2FD78299B87609DCC0423260B5AADB03';

Mas tome cuidado, se tu marcar a senha de um usuário como expirada, ele não poderá conectar via clientes com versão anterior a 5.6.10:

ERROR 1862 (HY000): Your password has expired. To log in you must …
[Read more]
Showing entries 13343 to 13352 of 44049
« 10 Newer Entries | 10 Older Entries »