--- mysql-upgrade-slotted.xml 2006-01-30 05:00:23.000000000 +0900
+++ mysql-slotted-edited.xml 2006-01-30 06:02:07.000000000 +0900
@@ -3,32 +3,38 @@
-This document cover how to upgrade to the latest version available. There are
-currently three version of MySQL supported in portage:
+This document covers how to upgrade to the latest avaliable MySQL version.
+There are currently three versions of MySQL supported in portage:
-There are two additional version presently, but are currently unsupported
-meaning that bug reports have very low priority any may lack functionalities.
-The current document is not guaranteed to work with them.
+There are two additional versions present, but are currently unsupported.
+This means that bug reports have very low priority any may lack functionalities.
+This document is not guaranteed to work with them.
-This step require to (re)move some files from the running environment, so the
-first thing to do is a backup of the running database server, still not the
-data. Done that, it's possible to remove the conflicting files with the slotted
-MySQL and install the new version side by side with the current one.
+This step will require (re)moving some files from the running environment, so
+the first thing to do is backup the running database server, not the data. Once
+this is done, it's possible to remove the conflicting files with the slotted
+MySQL, and install the new version side by side with the current one.
-Be sure to update the
-Lets go to to dump the data, this will be imported in the new version of MySQL.
-We are going to use mysqldump from the slotted MySQL. Notice the
-
-Now a file named
@@ -38,20 +44,19 @@
-
+
# quickpkg dev-db/mysql
# rm -rf /usr/include/mysql /usr/bin/mysql_config
# for tmpfile in /usr/lib/*mysql* ; do
@@ -82,8 +87,8 @@
# mysqldump-500 \
- --defaults-file=/etc/mysql/my.cnf
- -uroot \
- --password=
+# mv /etc/conf.d/mysql /etc/conf.d/mysql.orig -# echo ' +# cat <<- EOF > /etc/conf.d/mysql NOCHECK=1 DEBUG=3 mysql_slot_500=( "skip-networking" "skip-grant-tables" ) - ' > /etc/conf.d/mysql + EOF # /etc/init.d/mysql-500 start # mysql-500 --defaults-file=/etc/mysql-500/my.cnf < BACKUP_MYSQL_4.0.SQL -# mv /etc/conf.d/mysql.orig /etc/conf.d/mysql # /etc/init.d/mysql-500 stop +# mv /etc/conf.d/mysql.orig /etc/conf.d/mysql-To convert the data to UTF-8 during this step you must remove +To convert the data to UTF-8 during this step, youmust remove--hex-blob from themysqldump option, then filter the data through -a converter likeiconv . In most case this is done simply "piping" it like -iconv -f ISO_8859-1 -t UTF8 BACKUP_MYSQL_4.0.SQL | mysql-500 ---defaults-file=/etc/mysql-500/my.cnf . Also manual tweaking of the SQL file -could be needed, depending on the structure and the data contained in it. +a converter likeiconv . In most cases this is done by simply "piping" it +like so:iconv -f ISO_8859-1 -t UTF8 BACKUP_MYSQL_4.0.SQL | mysql-500 +--defaults-file=/etc/mysql-500/my.cnf . Manual adjustments of the SQL file +could be required, depending on the structure and the data contained within.If there are applications still @@ -166,27 +179,28 @@writing to the previous database, it's -possible to setup a "Replication" relationship between the two databases, -however this will not be covered here. +possible to setup a "Replication" relationship between the two databases. +However, this document will not be cover that procedure.- Switch to the new server +Migrating To The New Server If you need to be sure that applications are working with the newly installed -server, please test them against it, quite every application has configuration -settings to chose which port or socket to use to connect to the database -server. Simply start the server on an alternate port (for example 3307) and tell -your application or a test copy of it to connect with those parameters. Pay -attention that most of them will try to use the parameters found in the -
[client] section of/etc/mysql/my.cnf config file. +server, please test them against it. Quite often every application has +configuration settings to chose which port or socket to use for connecting to +the database server. Simply start the server on an alternate port (for example +3307) and tell your application, or a test copy of it, to connect with those +parameters. Please note that most applications will try to use the parameters +found in the[client] section of/etc/mysql/my.cnf config file.-When you're satisfied with the results, remove every testing setting, stop the -old server and start the new one. Also make it the server that will start at -next reboot. +When you're satisfied with the results, remove every test setting, stop the +old server and start the new one. Also, be sure to add +
-/etc/init.d/mysql to the default runlevel, ensuring it starts at +the next reboot.+# rc-update del mysql default # rc-update add mysql-500 default # /etc/init.d/mysql stop @@ -195,10 +209,10 @@Unmerge the old version, and make the new one the default. The unmerge command -will be unable to remove some files, the ones moved in
Backup old package and prepare -installation . This is an intended behavior, and avoid breaking application -linked to the old MySQL version. +will be unable to remove some files, such as the ones moved inBacking up the older version and preparing the +installation . This is an intended behavior, and meant to avoid breaking +applications linked to the old MySQL version.@@ -207,10 +221,10 @@ # cd /etc # mv mysql mysql.$(date +%F_%H-%M) # rm -rf /usr/lib/*.TMP -# rm -rf /usr/lib/*.TMP # for i in /usr/lib/*mysql* ; do - readlink -f $i || [[ -L $i ]] && rm $i + [[ -z "$( readlink -f $i )" ]] && [[ -L $i ]] && rm $i done +(emerge app-admin/eselect-mysql if you haven't already) # eselect mysql list # eselect mysql set 1 # eselect mysql show @@ -222,14 +236,14 @@- Rebuild applications +Rebuilding Applications -After you got rid of your old MySQL installation, you can now install the new +After you remove your old MySQL installation, you can now install the new version. Note that
revdep-rebuild from theapp-portage/gentoolkit -is necessary for rebuilding packages linking against MySQL. +is necessary for rebuilding packages linked against MySQL.@@ -238,8 +252,9 @@-Depending on which really is the old version @@ -248,26 +263,27 @@libmysqlclient.so -number may be 10, 12, 14 or 15, chose the one of theold package. +Depending on the older MySQL version, thelibmysqlclient.so +version may be 10, 12, 14 or 15. Please choose version of theold +package.- Final touches +Final Touches +(Replace all instances of 'your_password' with your MySQL root password) # mysql_fix_privilege_tables-500 \ --defaults-file=/etc/mysql-500/my.cnf \ --user=root \ - --password='your_password' -# mysql -uroot -p'your_password' mysql -e "FLUSH PRIVILEGES;" -# for tbl in $( mysql --silent -uroot -p'your_password' -e 'USE mysql ; SHOW TABLES LIKE "help%";' ) + --password='your_password' +# mysql -uroot -p'your_password' mysql -e "FLUSH PRIVILEGES;" +# for tbl in $( mysql --silent -uroot -p'your_password' -e 'USE mysql ; SHOW TABLES LIKE "help%";' ) do - mysql -uroot -p'your_password' -e "use mysql ; TRUNCATE TABLE ${tbl};" + mysql -uroot -p'your_password' -e "use mysql ; TRUNCATE TABLE ${tbl};" done -# mysql -uroot -p'your_password' mysql < /usr/share/mysql/fill_help_tables.sql +# mysql -uroot -p'your_password' mysql < /usr/share/mysql/fill_help_tables.sql-If you encountered any problems during the upgrade process, please report them -at our
Bugzilla . +If you encounter any problems during the upgrade process, please report them +to ourBugzilla .