Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email email@example.com
Date: Thu Jan 14 2010 - 10:02:38 CST
I am using RPM. And for Centos 5 it was installing a lower version
of mysql than what was installed with the system. That is why I want
to check before doing the RPM. I guess the alternative is to use the
latest version all the time, but not sure whether that will work on
the 4.5 version.
The other thing is, mysql appears to keep changing between
/etc/init.d/mysqld and /etc/init/mysql so I also have to do an
ls /etc/init.s/mysql* to figure out what to use to start which is also
kind of a pain.
From: Johan De Meersman [mailto:vegivamptuxera.be]
Sent: Thursday, January 14, 2010 09:44 AM
Subject: Re: version
You *should* be using a package manager (perfectly fine RPMs available for
all your needs), but if you must do this, it's a reasonably safe bet to
right-align and zero-pad all your number to 4 digits, at which point you're
free to concatenate them and treat them as a single number.
184.108.40.206.19 then becomes 0014 0012 0005 0000 0019 which becomes
You'd probably be safe with 3 or maaaaaaaybe even two positions, depending
on how many releases get done :-)
The better-but-more-work way is to compare every number separately, starting
with the major release.
On Thu, Jan 14, 2010 at 4:21 PM, <tony.chamberlainlemko.com> wrote:
> I have an install script that does some stuff with mysql (i.e. install,
> start, etc). It installs
> mysql Ver 14.12 Distrib 5.0.19, for pc-linux-gnu (i686) using readline 5.0
> This was good when we just used CentOS 4.5. Now we are doing some later
> CentOS versions and the mysql version may be higher.
> I want to do something like "mysql --version" and process the result and
> if the version is >= 5.0.19 skip the mysql installation and just do the
> other stuff. I can't compare as it is right now because the . and stuff
> may screw up the comparison (e.g. ver 5.2 will show as greater than 5.19
> I want to know, if I break the individual pieces like 14 12 5 0 19 I can do
> some sort of calculation to determine a number that I can actually compare.
> Or can I just remove all the decimal points, like 220.127.116.11.19 becomes
> 14125019? I might have to make it like 14120050019 or something.
> What is an algorithm I can use?
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/mysql?unsub=vegivamptuxera.be
Bier met grenadyn
Is als mosterd by den wyn
Sy die't drinkt, is eene kwezel
Hy die't drinkt, is ras een ezel
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql