‘mysql’ Archive

A yummy replacement

14 September 2011 23:14

Had a need to quickly (and easily) replace some yum packages this evening, namely getting mysql5.0 to 5.5 and php5.1 up to 5.3. I wasn’t looking forward to doing this manually as keeping the dependencies in check is a faff at best. A quick Google however led me to the package yum-plugin-replace.┬áThis very easily sorts all the plugins out, flips them in out, shakes them all about and quicker than you can say Robert’s your mother’s brother sorts it all out.

Getting it going is easy:

yum install yum-plugin-replace
yum replace mysql --replace-with mysql55

Do the usual confirmations and you’re done! Same goes with php to php53. This does of course assume you’ve already installed the EPEL and IUS channels to get this packages from.

On a side note, if you do mysql don’t forget to run the upgrade script.

mysql_upgrade --password

Filed: Technology // Tagged: , , , // No Comments

MySQL 5.1 on CentOS with yum

30 August 2010 17:43

Not a particularly exciting first post back after so long with nothing but hopefully it’s useful none the less. On a CentOS box you can’t get MySQL 5.1 or PHP 5.3 easily from yum. Luckily a chap known as remi as a handy repo that contains both said packages.

To get the repo running you’ll need to install a couple of RPM’s:

epel-release-5-4.noarch.rpm
remi-release-5.rpm

To install them:

rpm -Uvh epel-release-5*.rpm remi-release-5*.rpm

After that jump into /etc/yum.repos.d where you should now have a remi.repo file. Edit that and change enabled=0 to enabled=1 and you’re good to go. Do a yum check-updates and install away.

Filed: Technology // Tagged: , , , // No Comments

MySQL and 0x0B

23 April 2010 12:01

You may or may not know about the wonderful vertical tab character 0x0B. It’s a character that’s not easy to see and can cause issues across a number of different programming languages. In my case a Rails developer was having trouble passing some data from an API. A JSON parser was throwing errors about a specific character. Originally we suspected line breaks were causing the issue but after more digging and examination using Textmate and the Text bundle we spotted the invisible characters and having converted it to hex found out it was 0x0B. A quick Google brings back quite a few results of people having the same problem.

In order to find them in the database I knocked up the following SQL:

SELECT * FROM table WHERE data LIKE CONCAT('%',CHAR(0x0B),'%');

Then to replace them quickly (assuming the 3 records have ID’s 1,2 and 3):

UPDATE table SET data = REPLACE(data,CHAR(0x0B),'') WHERE id IN (1,2,3);

Filed: Technology // Tagged: , , // 2 Comments

Best way to search a MySQL database?

22 May 2009 12:26

Currently looking into a whole load of performance related issues with an application at work. Basically, how to make it go faster and support more users online at any given time.

Currently our setup has a MySQL 5.0.x master running with quite a few slaves. The setup is OK but isn’t as scalable as we’d like. The master isn’t suffering load wise so we don’t need to look at distrubtion masters or get into pyramid replication which is just a bit too complex. The main hang up is searching. We have members, each member has loads of related details, photos, payments, messages, profile information etc and currently it’s spread out over a number of tables. We’ve looked at sphinx, hadoop, solr / lucence but aren’t sure if those kinds of things can be used for multi faceted objects. We don’t want a plain text search because the data is mostly lots of numbers like height, age, hair colour all picked from lookup tables but maybe we can combine our data into some form of index that is better for searching? Currently we flatten the most searched data out into single tables (split on certain categorizations) and search those the details in them are updated regularly by triggered actions in the application. Memcache is an option as we use it to store data already.

MySQL 5.4 looks great in the performance enhancements it could bring but that’s now not looking like it’s going to be coming until around December. I hope Sun release it sooner however as the inital peek at it we’ve had seem to back up Sun’s claims.

Any ideas / suggestions / experience would be appreciated. Comment or email me.

Filed: Technology, Work // Tagged: , , , // No Comments

Maatkit

30 October 2008 10:43

I had a need, a need to change some tables in MySQL from MyISAM to InnoDB. I did a few via regular SQL and then thought there must be an easier way and indeed there is.

Maatkit (which if you haven’t heard of go Google it) can help. The following one liner will neatly switch all the tables in one go. Lovely.

mk-find -uroot wld --engine MyISAM --tblregex '^payment' \
--exec "alter table %D.%N engine=InnoDB" --print

FYI you can get this from a “yum install maatkit” as well.

Filed: Technology // Tagged: // No Comments

Sun buys MySQL

16 January 2008 16:22

Announced today and rapidly spreading over the blogosphere a post by Jonathan Schwartz that Sun have acquired MySQL.

Hopefully this will lead to MySQL’s GUI tools coming on and better support all round.

Filed: Technology // Tagged: // No Comments

phpMyAdmin

18 March 2006 15:22

Really simple comment for phpMyAdmin. Trying to install it on XP with MySQL 4.1 & Apache2. Setup the php.ini & httpd.conf file OK, php files rendered correctly all was going well. Set the path to my c:phpext dir and tried restarting but, kept getting errors:

“unable to load dynamic library ‘c:phpextphp_mysql.dll'”

Turns out that unless you copy libmysql.dll from the php root dir into c:windowssystem32 it won’t work.

Filed: Technology // Tagged: // No Comments

MySQL J4 Driver

9 February 2005 11:12

Following my previous post MM haven’t shipped the MySQL J 4 driver with CF7 as it’s not entirely stable and there seems too be some licensing issues. NewAtlanta have also not shipped this driver with Bluedragon.

If you need to install it with CF7 you can do, there is both a technote and a post over on Steven Erat’s blog.

Filed: Technology // Tagged: , // No Comments

 
Twitter   •   About   •   Contact
©2017 Ian Winter. All Rights Reserved.   •   Powered by WordPress   •   Hosted at Memset