Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 78471 Details for
Bug 120210
Migration to slotted MySQL initial document
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Differences between jtk's last version and mine
mysql-slotted-edited.diff (text/plain), 12.72 KB, created by
Chris White (RETIRED)
on 2006-01-29 13:06:11 UTC
(
hide
)
Description:
Differences between jtk's last version and mine
Filename:
MIME Type:
Creator:
Chris White (RETIRED)
Created:
2006-01-29 13:06:11 UTC
Size:
12.72 KB
patch
obsolete
>--- 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 @@ > <!-- $Header$ --> > > <guide link="/doc/en/mysql-upgrade-slotted.xml"> >-<title>MySQL, upgrade and switch to slotted guide</title> >+<title>Slotted MySQL Upgrade and Migration Guide</title> > > <author title="Author"> > <mail link="vivo@gentoo.org">Francesco Riosa</mail> > </author> >+<author title="Editor"> >+ <mail link="chriswhite@gentoo.org">Chris White</mail> >+</author> >+<author title="Editor"> >+ <mail link="jkt@gentoo.org"></mail> >+</author> > > <abstract> >-Here described there is an upgrade path for MySQL databases as painless as >-possible. >+This document describes the upgrade path to the new slotted MySQL. It strives >+to make the upgrade as painless and friendly as possible. > </abstract> > > <!-- The content of this document is licensed under the CC-BY-SA license --> > <!-- See http://creativecommons.org/licenses/by-sa/2.5 --> > <license/> > >-<version>1</version> >+<version>1.0</version> > <date>2006-01-25</date> > > <chapter> >-<title>Upgrading from old versions of MySQL</title> >+<title>Upgrading Older MySQL Versions</title> > <section> > <body> > > <p> >-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: > </p> > > <ul> >@@ -38,20 +44,19 @@ > </ul> > > <p> >-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. > </p> > > <ul> >-<li>3.23 ancient</li> >+<li>3.23 deprecated</li> > <li>5.1 active development</li> > </ul> > > <note> >-The present document will use <c>mysql-4.0.26</c> as start point and >-<c>mysql-5.0.18-r30</c> as the target version. Replace any of these with your >-own. >+<c>mysql-4.0.26</c> will be used as start point, and <c>mysql-5.0.18-r30</c> as >+the target version. Replace any of these versions with your own. > </note> > > </body> >@@ -60,18 +65,18 @@ > > > <chapter id="install_the_new_version"> >-<title>Install the new version</title> >+<title>Installing The New Version</title> > <section> > <body> > > <p> >-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. > </p> > >-<pre caption="Backup old package and prepare installation"> >+<pre caption="Backing up the older version and preparing the installation"> > # <i>quickpkg dev-db/mysql</i> > # <i>rm -rf /usr/include/mysql /usr/bin/mysql_config</i> > # <i>for tmpfile in /usr/lib/*mysql* ; do</i> >@@ -82,8 +87,8 @@ > </pre> > > <p> >-Be sure to update the <path>/etc/init.d/mysql</path> startup script with >-<c>etc-update</c> or <c>dispatch-conf</c>. >+Be sure to run <c>etc-update</c> or <c>dispatch-conf</c> in order to update the >+<path>/etc/init.d/mysql</path> startup script. > </p> > > </body> >@@ -91,23 +96,31 @@ > </chapter> > > <chapter> >-<title>Copy the data to the newly installed server</title> >+<title>Copying The Data To The New Server</title> > <section> > <body> > > <p> >-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 <b>slotted</b> MySQL. Notice the >-<c>-500</c> suffix to the mysqldump program name, it's from the <b>5.0</b>.x >-version. >+Now we'll go ahead and dump the data. This will be imported into the new >+version of MySQL. <c>mysqldump</c> will be used from the <b>slotted</b> >+MySQL. Notice the <c>-500</c> suffix to the <c>mysqldump</c> program name. This >+indicates it's from the <b>5.0</b>.x version. > </p> > >+<impo> >+If you are upgrading between version revisions (ie. <c>dev-db/mysql-5.0.18</c> >+to <c>dev-db/mysql-5.0.18-r30</c>), you can simply stop the database, move from >+one datadir to the other, and restart the server. This allows you to skip this >+section entirely. >+</impo> >+ > <pre caption="Dump of all databases"> > # <i>mysqldump-500 \</i> >- <i>--defaults-file=/etc/mysql/my.cnf</i> >- <i>-uroot \</i> >- <i>--password=</i><comment>'your_password'</comment><i> \</i> >- <i>-hlocalhost \</i> >+ <i>--defaults-file=/etc/mysql/my.cnf \</i> >+ <i>--user=root \</i> >+ <comment>(Replace 'your_password' with your MySQL root password)</comment> >+ <i>--password='your_password' \</i> >+ <i>--host=localhost \</i> > <i>--all-databases \</i> > <i>--opt \</i> > <i>--allow-keywords \</i> >@@ -120,7 +133,7 @@ > </pre> > > <p> >-Now a file named <path>BACKUP_MYSQL_4.0.SQL</path> exist which can be used to >+A file named <path>BACKUP_MYSQL_4.0.SQL</path> is created, which can be used to > recreate your data. The data is described in the MySQL dialect of SQL, the > Structured Query Language. > </p> >@@ -129,35 +142,35 @@ > Start the server without networking and user management and run the SQL script: > </p> > >-<pre caption="Load data"> >+<pre caption="Loading the data"> > # <i>mv /etc/conf.d/mysql /etc/conf.d/mysql.orig</i> >-# <i>echo '</i> >+# <i>cat <<- EOF > /etc/conf.d/mysql</i> > <i>NOCHECK=1</i> > <i>DEBUG=3</i> > <i>mysql_slot_500=(</i> > <i> "skip-networking"</i> > <i> "skip-grant-tables"</i> > <i>)</i> >- <i>' > /etc/conf.d/mysql</i> >+ <i>EOF</i> > # <i>/etc/init.d/mysql-500 start</i> > # <i>mysql-500 --defaults-file=/etc/mysql-500/my.cnf < BACKUP_MYSQL_4.0.SQL</i> >-# <i>mv /etc/conf.d/mysql.orig /etc/conf.d/mysql</i> > # <i>/etc/init.d/mysql-500 stop</i> >+# <i>mv /etc/conf.d/mysql.orig /etc/conf.d/mysql</i> > </pre> > > <note> >-To convert the data to UTF-8 during this step you <e>must</e> remove >+To convert the data to UTF-8 during this step, you <e>must</e> remove > <c>--hex-blob</c> from the <c>mysqldump</c> option, then filter the data through >-a converter like <c>iconv</c>. In most case this is done simply "piping" it like >-<c>iconv -f ISO_8859-1 -t UTF8 BACKUP_MYSQL_4.0.SQL | mysql-500 >---defaults-file=/etc/mysql-500/my.cnf</c>. Also manual tweaking of the SQL file >-could be needed, depending on the structure and the data contained in it. >+a converter like <c>iconv</c>. In most cases this is done by simply "piping" it >+like so: <c>iconv -f ISO_8859-1 -t UTF8 BACKUP_MYSQL_4.0.SQL | mysql-500 >+--defaults-file=/etc/mysql-500/my.cnf</c>. Manual adjustments of the SQL file >+could be required, depending on the structure and the data contained within. > </note> > > <note> > If there are applications still <e>writing</e> 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. > </note> > > </body> >@@ -166,27 +179,28 @@ > > > <chapter> >-<title>Switch to the new server</title> >+<title>Migrating To The New Server</title> > <section> > <body> > > <p> > 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 >-<c>[client]</c> section of <path>/etc/mysql/my.cnf</path> 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 <c>[client]</c> section of <path>/etc/mysql/my.cnf</path> config file. > </p> > > <p> >-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 >+<path>/etc/init.d/mysql</path> to the default runlevel, ensuring it starts at >+the next reboot. > </p> > >-<pre caption="Use the new server"> >+<pre caption="Using the new server"> > # <i>rc-update del mysql default</i> > # <i>rc-update add mysql-500 default</i> > # <i>/etc/init.d/mysql stop</i> >@@ -195,10 +209,10 @@ > > <p> > 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 <uri >-link="#install_the_new_version">Backup old package and prepare >-installation</uri>. 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 in <uri >+link="#install_the_new_version">Backing up the older version and preparing the >+installation</uri>. This is an intended behavior, and meant to avoid breaking >+applications linked to the old MySQL version. > </p> > > <pre caption="cleanup first step"> >@@ -207,10 +221,10 @@ > # <i>cd /etc</i> > # <i>mv mysql mysql.$(date +%F_%H-%M)</i> > # <i>rm -rf /usr/lib/*.TMP</i> >-# <i>rm -rf /usr/lib/*.TMP</i> > # <i>for i in /usr/lib/*mysql* ; do</i> >- <i> readlink -f $i || [[ -L $i ]] && rm $i</i> >+ <i> [[ -z "$( readlink -f $i )" ]] && [[ -L $i ]] && rm $i</i> > <i>done</i> >+ <comment>(emerge app-admin/eselect-mysql if you haven't already)</comment> > # <i>eselect mysql list</i> > # <i>eselect mysql set 1</i> > # <i>eselect mysql show</i> >@@ -222,14 +236,14 @@ > > > <chapter> >-<title>Rebuild applications</title> >+<title>Rebuilding Applications</title> > <section> > <body> > > <p> >-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 <c>revdep-rebuild</c> from the <c>app-portage/gentoolkit</c> >-is necessary for rebuilding packages linking against MySQL. >+is necessary for rebuilding packages linked against MySQL. > </p> > > <pre caption="Reverse dependancies rebuild"> >@@ -238,8 +252,9 @@ > </pre> > > <note> >-Depending on which really is the old version <path>libmysqlclient.so</path> >-number may be 10, 12, 14 or 15, chose the one of the <e>old</e> package. >+Depending on the older MySQL version, the <path>libmysqlclient.so</path> >+version may be 10, 12, 14 or 15. Please choose version of the <e>old</e> >+package. > </note> > > </body> >@@ -248,26 +263,27 @@ > > > <chapter> >-<title>Final touches</title> >+<title>Final Touches</title> > <section> > <body> > > <pre caption="Upgrading user database"> >+<comment>(Replace all instances of 'your_password' with your MySQL root password)</comment> > # <i>mysql_fix_privilege_tables-500 \</i> > <i>--defaults-file=/etc/mysql-500/my.cnf \</i> > <i>--user=root \</i> >- <i>--password=</i><comment>'your_password'</comment><i></i> >-# <i>mysql -uroot -p</i><comment>'your_password'</comment><i> mysql -e "FLUSH PRIVILEGES;"</i> >-# <i>for tbl in $( mysql --silent -uroot -p</i><comment>'your_password'</comment><i> -e 'USE mysql ; SHOW TABLES LIKE "help%";' )</i> >+ <i>--password='your_password'</i> >+# <i>mysql -uroot -p'your_password' mysql -e "FLUSH PRIVILEGES;"</i> >+# <i>for tbl in $( mysql --silent -uroot -p'your_password' -e 'USE mysql ; SHOW TABLES LIKE "help%";' )</i> > <i>do</i> >- <i>mysql -uroot -p</i><comment>'your_password'</comment><i> -e "use mysql ; TRUNCATE TABLE ${tbl};"</i> >+ <i>mysql -uroot -p'your_password' -e "use mysql ; TRUNCATE TABLE ${tbl};"</i> > <i>done</i> >-# <i>mysql -uroot -p</i><comment>'your_password'</comment><i> mysql < /usr/share/mysql/fill_help_tables.sql</i> >+# <i>mysql -uroot -p'your_password' mysql < /usr/share/mysql/fill_help_tables.sql</i> > </pre> > > <p> >-If you encountered any problems during the upgrade process, please report them >-at our <uri link="https://bugs.gentoo.org">Bugzilla</uri>. >+If you encounter any problems during the upgrade process, please report them >+to our <uri link="https://bugs.gentoo.org">Bugzilla</uri>. > </p> > > </body>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 120210
:
78019
|
78040
|
78470
|
78471
|
78478
|
78479
|
78523
|
78525