nightmorph 07/01/06 21:38:01 Modified: mysql-upgrading.xml Log: updated mysql-upgrading guide for bug 111072, thanks to vivo for the patches
Revision Changes Path 1.19 xml/htdocs/doc/en/mysql-upgrading.xml file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/en/mysql-upgrading.xml?rev=1.19&view=markup plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/en/mysql-upgrading.xml?rev=1.19&content-type=text/plain diff : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/en/mysql-upgrading.xml?r1=1.18&r2=1.19 Index: mysql-upgrading.xml =================================================================== RCS file: /var/cvsroot/gentoo/xml/htdocs/doc/en/mysql-upgrading.xml,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- mysql-upgrading.xml 29 Dec 2006 05:49:47 -0000 1.18 +++ mysql-upgrading.xml 6 Jan 2007 21:38:01 -0000 1.19 @@ -1,6 +1,6 @@ <?xml version='1.0' encoding="UTF-8"?> <!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> -<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/mysql-upgrading.xml,v 1.18 2006/12/29 05:49:47 nightmorph Exp $ --> +<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/mysql-upgrading.xml,v 1.19 2007/01/06 21:38:01 nightmorph Exp $ --> <guide link="/doc/en/mysql-upgrading.xml"> <title>Upgrade guide to MySQL 4.* or 5.0.*</title> @@ -22,8 +22,8 @@ <!-- See http://creativecommons.org/licenses/by-sa/2.5 --> <license/> -<version>1.15</version> -<date>2006-12-28</date> +<version>1.16</version> +<date>2007-01-06</date> <chapter> <title>Straight upgrade, suggested for 4.1 => 5.0 migration</title> @@ -43,16 +43,31 @@ from old versions of MySQL</uri>. </note> +<p> +For this step two shells are required because locks belong to the mysql +session. +</p> + <pre caption="Straight upgrade from 4.1 to 5.0.*"> # <i>quickpkg dev-db/mysql</i> # <i>alias MYSQL="mysql --user=root --password=</i><comment>'your_password'</comment><i>"</i> # <i>DATADIR=$(MYSQL --batch --raw --silent --skip-column-names \</i> <i>--execute='SHOW variables LIKE "datadir";' \</i> <i>| sed -e 's|datadir[ \t]||')</i> -# <i>MYSQL --execute="FLUSH TABLES WITH READ LOCK;"</i> + +<comment>(This next step should be done in the second shell)</comment> +# <i>mysql --user=root --password=</i><comment>'your_password'</comment><i>"</i> +mysql> <i>FLUSH TABLES WITH READ LOCK;</i> + +<comment>(Return to the first shell to run this command)</comment> # <i>tar -cjpvf ~/mysql.$(date +%F"T"%H-%M).tar.bz2 \</i> <i>/etc/conf.d/mysql /etc/mysql/my.cnf "${DATADIR}"</i> -# <i>MYSQL --execute="UNLOCK TABLES;"</i> + +<comment>(The following commands should be done in the second shell)</comment> +mysql> <i>UNLOCK TABLES;</i> +mysql> <i>quit</i> + +<comment>(Return to the first shell for the rest of the upgrade)</comment> # <i>tar -tjvf ~/mysql.*.tar.bz2</i> # <i>emerge -av ">dev-db/mysql-5.0"</i> # <i>dispatch-conf</i> @@ -215,6 +230,21 @@ amongst other things is and <b>must</b> be in encoded in utf8. </impo> +<p> +Older mysqldump utilities may export tables in the wrong order when foreign keys +are involved. To work around this problem, surround the SQL with the following +statements: +</p> + +<pre caption="Fixing foreign key checks"> +SET FOREIGN_KEY_CHECKS=0 +SET FOREIGN_KEY_CHECKS=1 +</pre> + +<p> +Next, import the backup. +</p> + <pre caption="Importing the SQL backup"> # <i>cat BACKUP_MYSQL_4.0.SQL \</i> <i>| mysql \</i> -- [email protected] mailing list
