PDA

View Full Version : MySQL 4.1.13 Released


Tantawi
07-21-2005, 12:18 PM
Download it here:

http://dev.mysql.com/downloads/mysql/4.1.html

Get the rpms then run:

rpm -Uvh MySQL*

Then restart MySQL:

service mysqld restart

:)

Wouter
07-21-2005, 12:33 PM
Someone knows how to safely updating on FreeBSD?

werwin01
07-23-2005, 06:14 AM
Move over your MySQL to the FreeBSD ports system like I did, and updating is a snap.

kevin01
07-24-2005, 12:11 AM
are u sure updating with ports will not mess up everything?

jason
07-24-2005, 01:06 AM
what is the procedure under freebsd to remove your old
mysql 4.0.17 version and install the last one with out lost anything

Thanks
Have a nice day

werwin01
07-24-2005, 01:14 AM
Originally posted by kevin01
are u sure updating with ports will not mess up everything?

I've moved over this so far to ports:
Apache 2
MySQL 4.1
PHP 5
PHPMyAdmin

and everything works perfectly, with updating easy as using cvsup and portupgrade.

Of course for MySQL, you're going to need to move the data files to the default directory FreeBSD uses for them, and symlink the DA directory to the FreeBSD one.

jason
07-24-2005, 01:27 AM
well through the ports system i know the procedure
but can u please write here the hole procedure what files i have to move and link

On the other hand thereis no other way that u can update the default mysql through the direct admin service ?

3v.
08-11-2005, 03:30 AM
Me too, please.

chatwizrd
08-11-2005, 12:42 PM
The following was used on a live Freebsd 5.4-Release-p5 server.

Make sure you have cvsup to the newest version of ports.

1. cd /usr/ports/databases/mysql41-server

2. make all install clean
* Step 2 may take a while to compile.

3. ln -s /home/mysql /var/db/mysql
* When I installed it did not make the /var/db/mysql folder... if it does for you I would do the following:

mv /var/db/mysql /var/db/mysql.orig
ln -s /home/mysql /var/db/mysql

Steps for replacing the startup script.

1. chmod 0 /usr/local/etc/rc.d/mysql-server.sh

2. mv /usr/local/etc/rc.d/mysqld /usr/local/etc/rc.d/mysqld.orig

3. pico /usr/local/etc/rc.d/mysqld
* Using your favorite editor input the following into /usr/local/etc/rc.d/mysqld

#!/bin/sh

DB_DIR=/home/mysql
PIDFILE=${DB_DIR}/`/bin/hostname -s`.pid
PROGNAME=mysqld

# Source function library
. /usr/local/etc/rc.d/functions

case "$1" in
start)
/usr/bin/limits -U mysql \
/usr/local/bin/mysqld_safe --user=mysql --datadir=${DB_DIR} --pid-file=${PIDFILE} > /dev/null &
if [ $? -ne 0 ]
then
echo -e 'Starting mysqld:\t\t[ FAILED ]'
else
echo -e 'Starting mysqld:\t\t[ OK ]'
fi
;;
stop)
if [ -f ${PIDFILE} ]; then
/bin/kill `cat ${PIDFILE}` > /dev/null 2>&1 && echo -e "Stopping mysqld:\t\t[ OK ]"
else
echo -e "Stopping mysqld:\t\t[ FAILED ]"
fi
;;
restart)
$0 stop
$0 start
;;
status)
status $PROGNAME
;;
*)
echo ""
echo "Usage: `basename $0` { start | stop | restart }"
echo ""
exit 64
;;
esac

4. Save the file
5. chmod 750 /usr/local/etc/rc.d/mysqld
6. killall mysqld
7. ln -s /usr/local/etc/rc.d/mysqld /sbin/mysqld
* This step isnt necessary but makes for ease of not having to type out the whole line.

8. mysqld start
* If you didnt do step 7 then use /usr/local/etc/rc.d/mysqld start

9. To check if it was updated run the following:

/usr/local/bin/mysqld --version
/usr/local/bin/mysql --version

10. Enjoy

Let me know if anyone runs into problems.

Thanks

vertangie
08-24-2005, 12:30 PM
Followed chatwizrd instructions with just a few things to note.

cd /usr/ports/databases/mysql41-server

when I tried to install MySQL server I got the following error:

===> mysql-server-4.1.13 is marked as broken: MySQL versions mismatch: mysql40-client is installed and wanted version is mysql41-client.
===> mysql-server-4.1.13 is marked as broken: MySQL versions mismatch: mysql40-client is installed and wanted version is mysql41-client.

so I paused to install the mysql4.1 client first:

cd /usr/ports/databases/mysql41-client
make all install clean

From that point on all went just fine until the very end.

/usr/local/bin/mysqld --version

returns this

su: /usr/local/bin/mysqld: No such file or directory

So I went looking for mysqld

su-3.00# ps aux | grep mysql
/usr/local/libexec/mysqld --basedir=/usr/local --datadir=/home/mysql --user=mysql --pid-file=/home/mysql/server1.pid


So it appears my mysqls has ended up in /usr/local/libexec/mysqld

su-3.00# /usr/local/libexec/mysqld -V
/usr/local/libexec/mysqld Ver 4.1.13 for portbld-freebsd5.3 on i386 (FreeBSD port: mysql-server-4.1.13)

Yep, that's 4.1.13 alright.

Strangely the start stop script through DA's services page does start/stop the right version.

When I look at the System Information page it claims to still have MySQL version 4.0.17. Anyone know where it gets this system info from?

I'll report if I find any problems. So Far so good.

FYI Unicode/utf8 support is moving on in 4.1 which made it a necessary upgrade for me.

Angie

chatwizrd
08-24-2005, 12:57 PM
You can find mysqld with the following command:

which mysqld

Uninstalling the old client was a good idea. If you keep your ports updated you can use the portupgrade program to keep everything up to date just incase some other port relys on that old mysql client.

I had alot of problems with that old mysql start stop script so I totally wrote a new one and It does a bit more checking...

Here is the code:


#!/bin/sh

pid_file='/home/mysql/mysqld.pid' # Set to your pid file. *** CURRENTLY NOT USED ***
db_folder='/home/mysql' # Set to your db folder. *** CURRENTLY NOT USED ***

####### Editable Variables #######

mysqld_start_command() {

/usr/bin/limits -U mysql \
/usr/local/bin/mysqld_safe --user=mysql --datadir=/home/mysql --pid-file=/home/mysql/mysqld.pid > /dev/null &

}

####### Core Variables #######

mysqld_running=`ps xua | grep mysqld | grep -v grep | grep -v $0 | awk '{ print $2 }'`


################## DO NOT EDIT BELOW THIS LINE! #####################

creator="Andrew Keuhs (Andrew at fusedmail.com)"

case $1 in

start)

echo ""
echo -n "Starting MySQLd"
sleep 1
echo -n "."
sleep 1
echo -n "."
sleep 1
echo -n "."
if [ -z "$mysqld_running" ]; then
mysqld_start_command
echo -n "Done."
echo ""
sleep 3
echo "Started with PID: [`cat /home/mysql/mysqld.pid`]"
echo ""
else
echo ""
echo ""
echo "MySQLd is currently running. Will attempt a restart instead."
echo ""
echo "Note: Refreshing page in 2 seconds."
sleep 2
clear
$0 restart
fi
;;

stop)

echo ""
echo -n "Stopping MySQLd"
sleep 1
echo -n "."
sleep 1
echo -n "."
sleep 1
echo -n "."
if [ -z "$mysqld_running" ]; then
echo ""
echo ""
echo "MySQLd is not currently running."
echo ""
elif [ -f "/home/mysql/mysqld.pid" ]; then
cat /home/mysql/mysqld.pid | xargs kill
else
ps xua | grep mysqld | grep -v grep | awk '{ print $2 }' | xargs kill >/dev/null 2>&1
fi
echo -n "Done."
echo ""
echo ""
;;

restart)

echo ""
echo -n "Restarting MySQLd"
sleep 1
echo -n "."
sleep 1
echo -n "."
sleep 1
echo -n "."
if [ -z "$mysqld_running" ]; then
sleep 2
echo ""
echo "MySQLd not running starting it!"
echo ""
mysqld_start_command
sleep 2
echo "MySQLd Restarted!"
sleep 3
echo "PID: `cat /home/mysql/mysqld.pid`"
echo ""
else
echo ""
echo "MySQLd found running killing first!"
if [ -f "/home/mysql/mysqld.pid" ]; then
cat /home/mysql/mysqld.pid | xargs kill
mysqld_start_command
echo ""
echo "MySQLd Restarted!"
echo "PID: `cat /home/mysql/mysqld.pid`"
echo ""
else
ps xua | grep mysqld | grep -v grep | awk '{ print $2 }' | xargs kill >/dev/null 2>&1
echo ""
mysqld_start_command
echo ""
echo "MySQLd Restarted!"
sleep 3
echo "PID: `cat /home/mysql/mysqld.pid`"
echo ""
fi
fi
;;

status)

echo ""
echo "-= MySQLd Server Status =-"
if [ -z "$mysqld_running" ]; then
echo ""
echo "MySQLd does not seem to be running try a restart."
echo ""
else
echo ""
echo "MySQLd is running with the pid[s] of:

$mysqld_running
"
fi
;;

*)

echo ""
echo "Usage: start | stop | restart | status"
echo ""
echo "Created by $creator."
echo ""
;;

esac



You can just do the following.

1. Copy the above script into /usr/local/etc/rc.d/mysqld

2. chmod 750 /usr/local/etc/rc.d/mysqld

3. Change the code in /usr/local/etc/rc.d/mysqld


mysqld_start_command() {

/usr/bin/limits -U mysql \
/usr/local/bin/mysqld_safe --user=mysql --datadir=/home/mysql --pid-file=/home/mysql/mysqld.pid > /dev/null &

}


to


mysqld_start_command() {

/usr/bin/limits -U mysql \
/usr/local/libexec/mysqld_safe --user=mysql --datadir=/home/mysql --pid-file=/home/mysql/mysqld.pid > /dev/null &

}


4. Run /usr/local/etc/rc.d/mysqld
5. It should start the program with the right mysqld.


What is your output of: which mysqld

Oh another thing the default mysql calls on /usr/local/mysql which the da puts there. I just did rm -rf /usr/local/mysql since it was just a symbolic link to /usr/local/mysql-4.1.11-unknown-freebsd5.1-i386

Let me know if you need further help.

Thanks

chatwizrd
08-24-2005, 01:05 PM
Use which -a mysqld instead that way it will show all instances of mysqld.

user@shell: which -a mysqld

Thanks

Shark
09-03-2005, 12:18 PM
Get the rpms then run:
rpm -Uvh MySQL*
Then restart MySQL:
service mysqld restart
I'm looking to do this but when I get to the mysql page I realize I don't know which rpms to get? RedHat Enterprise Linux 4 (x86)? Do I need all rpms, server, client, headers & libraries, shared libraries and debug?

Running:
server just built 2 weeks ago,
Latest DA w/
Installtron
CentOS4/Redhat Enterprise 4.0
MySQL 4.1.11

Is this the best way to upgrade mySql or should get yum/up2date going as I've seen the howtos and gotchas for these softwares? Should you uninstall old version first or upgrade over?

So tough figuring out which updates/upgrades will be done automatically and which I need to watch and do manually...

DaveR~

Tantawi
09-03-2005, 06:42 PM
Originally posted by Shark
I'm looking to do this but when I get to the mysql page I realize I don't know which rpms to get? RedHat Enterprise Linux 4 (x86)? Do I need all rpms, server, client, headers & libraries, shared libraries and debug?

Running:
server just built 2 weeks ago,
Latest DA w/
Installtron
CentOS4/Redhat Enterprise 4.0
MySQL 4.1.11

Is this the best way to upgrade mySql or should get yum/up2date going as I've seen the howtos and gotchas for these softwares? Should you uninstall old version first or upgrade over?

So tough figuring out which updates/upgrades will be done automatically and which I need to watch and do manually...

DaveR~

You only needs:

server, client, headers & libraries, Dynamic client libraries

And be note that 4.1.14 is released now :)

I've being using the RPM method since I got my server online (Updated like 4 times), you don't have to uninstall or do anything, the RPMs will just replace the old version. May I suggest you backup your databases so you're on the safe side.

Regards.