Skip to main content

Posts

Showing posts from January, 2013

Avoid clear text passwords in MySQL logging.

What happens when you use the PASSWORD() function to insert a password hash into a table? The hash will be written to the table The password might be written in clear text to the binlog The password might be written in clear text to the general log The password might be written in clear text to the slow query log The query mysql [localhost] {msandbox} (test) > INSERT INTO testpwd(pwd) VALUES(PASSWORD(' secret_password ')); Query OK, 1 row affected (0.00 sec) The General log 130128 16:04:41 1 Query INSERT INTO testpwd(pwd) VALUES(PASSWORD(' secret_password ')) The Slow query log # Time: 130128 16:04:41 # User@Host: msandbox[msandbox] @ localhost [] # Query_time: 0.004887 Lock_time: 0.001043 Rows_sent: 0 Rows_examined: 0 SET timestamp=1359385481; INSERT INTO testpwd(pwd) VALUES(PASSWORD(' secret_password ')); The binlog: # at 219 #130128 16:04:41 server id 1 end_log_pos 287 Query thread_id=1 exec_time=0 error_code=0 SET TIMESTAMP=1...

Installing Multicorn on RHEL6

The Multicorn project makes it possible to write Foreign Data Wrappers for PostgreSQL in Python. To install Multicorn on RHEL6 the following is needed: PostgreSQL 9.2 Python 2.7 make, GCC, etc. Installing PostgreSQL 9.2 is easy as it's available in the PostgreSQL Yum repository . Unfortunately Python 2.7 is not included in RHEL6. And replacing the 'system' python is a bad idea. The solution is to do an 'altinstall' of Python. The "--shared" and ucs4 options are required. The altinstall will install a python binary with the name python2.7 instead of just python. This allows you to have multiple python versions on 1 system. wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz tar zxf Python-2.7.3.tgz cd Python-2.7.3 ./configure --shared --enable-unicode=ucs4 make make altinstall This will result in a /usr/local/bin/python2.7 which doesn't work. This is due to the fact that the libraries are installed /usr/local/lib, which is...

How to install PGXN on RHEL6

Installing PGXN on RHEL 6.3 is not as easy as it might sound. First you need to install the PostgreSQL yum repo: rpm -ivh http://yum.postgresql.org/9.2/redhat/rhel-6.3-x86_64/pgdg-redhat92-9.2-7.noarch.rpm Then you need to install pgxnclient: yum install pgxnclient The pgxn client has 2 dependencies which are not listed in the package: setuptools simplejson 2.1 To satisfy the first dependency we need to install python-setuptools yum install python-setuptools The second one is not that easy as the simplejson version in RHEL6.3 is 2.0, which is too old. We can use PIP to install a newer version: yum remove python-simplejson yum install python-pip python-devel python-pip install simplejson And now the pgxn command will work.

MySQL version history (updated)

I've created a graph about the MySQL version history. It's mysql-graph-history on github. Please let me know if this is correct or if I'm forgetting some versions.

Untrusted downloads and MySQL

When the MySQL version from your distribution isn't good enough you need to download the latest Oracle MySQL. There are more possibilities like Percona Server and MariaDB, but that's not what this post is about. The dowload site for MySQL is https://www.mysql.com/downloads/mysql/ and contains to a mirror.php script which ask you if you like to login with a Oracle Web Account and then chooses a mirror for you. You don't have to login. Then you will be redirected to the chosen mirror. In my case this is https://cdn.mysql.com Firefox will give you a "This Connection is Untrusted" dialog. If you click on "Technical details" it will show the following error: cdn.mysql.com uses an invalid security certificate. The certificate is only valid for the following names:   a248.e.akamai.net , *.akamaihd.net , *.akamaihd-staging.net  (Error code: ssl_error_bad_cert_domain) The Qualys SSL Labs confirm the mismatch between the site name and the certificate...

How to install MySQL succesfully on a Raspberry Pi

For those starting to learn MySQL and want to install it on a Raspberry Pi: there is a little gotcha you should be aware of. Disclaimer: Only run command if you know what it does. Always make sure you have backups of your important data. First you need to put the official Raspbian image on your SD card and then boot the Raspberry Pi. Then if you try to install mysql with " sudo apt-get install mysql-server-5.5 " this will fail. The reason for this is that the filesystem on the SD card will become full. This can be seen by running the " df -h " command. The SD card is probably 4GB. The filesystem will be around 1.9GB. This was done to make it fit on 2GB cards. To stretch the filesystem to complete 4GB you need to run " sudo raspi-config " and choose the " expand_rootfs " option. Then you need to reboot. Now " df -h " should tell you that the filesystem has much more free space. But your MySQL installation failed. So you run ...