From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.50) id 1ETIK5-0001U3-BI for garchives@archives.gentoo.org; Sat, 22 Oct 2005 12:18:05 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.5/8.13.5) with SMTP id j9MCDnnG007233; Sat, 22 Oct 2005 12:13:49 GMT Received: from qproxy.gmail.com (qproxy.gmail.com [72.14.204.198]) by robin.gentoo.org (8.13.5/8.13.5) with ESMTP id j9MCDmqa013662 for ; Sat, 22 Oct 2005 12:13:49 GMT Received: by qproxy.gmail.com with SMTP id a10so157555qbd for ; Sat, 22 Oct 2005 05:16:43 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=SMrATD5Oh4jm0TK+QpHM1heR6MFOHPJQAp4If/Bjbd/X/f4dKQqILv1NW4HJVlMFItsxP8qQNh0Klir+Eh7pkzWeagwj/bb1+6KtCPGQOvjSaKekJe87L9xRELTUuffMaRemCqrh67t8gYhexy9wldZ3C1zf3P+WdWlX28w2FdI= Received: by 10.64.232.15 with SMTP id e15mr2253540qbh; Sat, 22 Oct 2005 05:16:43 -0700 (PDT) Received: by 10.64.195.18 with HTTP; Sat, 22 Oct 2005 05:16:43 -0700 (PDT) Message-ID: Date: Sat, 22 Oct 2005 14:16:43 +0200 From: Dave Strydom To: gentoo-server@lists.gentoo.org Subject: Re: [gentoo-server] mysql-4.1 In-Reply-To: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-server@gentoo.org Reply-to: gentoo-server@lists.gentoo.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_2853_3300041.1129983403386" References: <4357203B.2060500@munat.com> <43588B41.6040009@munat.com> <200510211207.26060.vivo@gentoo.org> <4358EB92.2010605@gentoo.org> X-Archives-Salt: 7e8c69b0-81de-4420-bb6c-bf921f66324b X-Archives-Hash: 939d534f1ed522e3f842b4e302d60e91 ------=_Part_2853_3300041.1129983403386 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline oh yeah, and change the --password=3D'' field to your own password, dont ju= st copy past. Dave On 10/22/05, Dave Strydom wrote: > > Man, this ...... page messed up my mysql stuff seriously, ok, for those > who had the same libmysqlclient.so.12 problems i had or for those people > who get to the importing of all your database backup and it stuffs up. he= re > is DAVE'S guide to upgrading to MySQL 4.1 > > > # =3D commands to type > =3D =3D comments > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > # mkdir -p /home/backup/mysql > # nano mysql_backup.php > > =3D=3D > =3D Place the code below into the mysql_backup.php and save the file =3D > =3D=3D > > /*------mysql_backup.php---------*/ > print("mysql backup\n"); > foreach (glob('/var/lib/mysql/*') as $fullname) > { > $database =3D basename($fullname); > $command =3D sprintf('mysqldump -a -B %s -c -v -Q > > /home/backup/mysql/%s.sql --password=3D\'Our@db$IG\'', $database, > $database); > > exec($command); > print($database . ' : ' . $command . "\n\n\n"); > > } > ?> > > > /*-----------------------------------------------------*/ > > # nano mysql_restore.php > > =3D=3D > =3D Place the code below in the mysql_restore.php and save the file =3D > =3D=3D > > /*------mysql_retore.php---------*/ > > print("mysql backup\n"); > > $dir =3D '/home/backup/mysql/'; > if ($fp =3D opendir($dir)) > { > print('running...'); > while (($file =3D readdir($fp)) !=3D=3D FALSE) { > echo "$file\n"; > > $database =3D basename($file); > $command =3D sprintf('mysql < /home/backup/mysql/%s --password=3D\'Our@db= $IG\'', > $database); > print($database . ' : ' . $command . "\n\n\n"); > exec($command); > > } > closedir($fp); > } > else > { > print('cannot open path ' . $dir); > } > > ?> > > /*---------------*/ > > # php mysql_backup.php > > =3D=3D > =3D This will make individual backup's of all your databases, the reason = i > make it create scripts for each database > =3D instead of just pumping it all into 1 database, is because if there i= s a > problem on like 486590 of a 5 million > =3D line file, its going to be a bitch to work with, this way it just > simplifies matters > =3D=3D > > # quickpkg dev-db/mysql > # /etc/init.d/mysql stop > # emerge -C mysql > # rm -rf /var/lib/mysql/ /var/log/mysql > # emerge mysql > # etc-update > # emerge --config =3Dmysql-4.1.14 > # revdep-rebuild --soname libmysqlclient.so.12 > # php mysql_restore.php > # mysql_fix_privilege_tables --defaults-file=3D/etc/mysql/my.cnf --user= =3Droot > --password=3D'PASSWORD' > # /etc/init.d/mysql restart > > And thats it. > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > Dave > ------=_Part_2853_3300041.1129983403386 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline oh yeah, and change the --password=3D'' field to your own password, dont ju= st copy past.

Dave

On 10/22/05, Dave Strydom <strydom.dave@gmail.com> wrote:
Man, this ...... page messed up my mysql stuff seriously, ok, for those who had the same libmysqlclient.so.12 problems i had or for those people who get to the importing of all your database backup and it stuffs up. here is DAVE'S guide to upgrading to MySQL 4.1


#  =3D commands to type
=3D  =3D comments

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
# mkdir -p /home/backup/mysql
# nano mysql_backup.php

=3D=3D
=3D Place the code below into the mysql_backup.php and save the file =3D =3D=3D

/*------mysql_backup.php---------*/
<?
print("mysql backup\n");
foreach (glob('/var/lib/mysql/*') as $fullname)
{
        $database =3D basename($fullname= );
        $command =3D sprintf('mysqldump -a -B %s -c -v -Q > /home/backup/mysql/%s.sql --password=3D\'Our@db$IG\'', $database, $database);

        exec($command);
        print($database . ' : ' . $comma= nd . "\n\n\n");

}
?>


/*-----------------------------------------------------*/

# nano mysql_restore.php

=3D=3D
=3D Place the code below in the mysql_restore.php and save the file =3D
=3D=3D

/*------mysql_retore.php---------*/
<?

print("mysql backup\n");

$dir =3D '/home/backup/mysql/';
if ($fp =3D opendir($dir))
{
        print('running...');
 while (($file =3D readdir($fp)) !=3D=3D FALSE) {
     echo "$file\n";

     $database =3D basename($file);
     $command =3D sprintf('mysql < /home/backup/mysq= l/%s --password=3D\'Our@db$IG\'', $database);
     print($database . ' : ' . $command . "\n\n\n&= quot;);
     exec($command);

 }
 closedir($fp);
}
else
{
        print('cannot open path ' . $dir= );
}

?>

/*---------------*/

# php mysql_backup.php

=3D=3D
=3D This will make individual backup's of all your databases, the reason i = make it create scripts for each database
=3D instead of just pumping it all into 1 database, is because if there is = a problem on like 486590 of a 5 million
=3D line file, its going to be a bitch to work with, this way it just simpl= ifies matters
=3D=3D

# quickpkg dev-db/mysql
# /etc/init.d/mysql stop
# emerge -C mysql
# rm -rf /var/lib/mysql/ /var/log/mysql
# emerge mysql
# etc-update
# emerge --config =3Dmysql-4.1.14
# revdep-rebuild --soname libmysqlclient.so.12
# php mysql_restore.php
# mysql_fix_privilege_tables --defaults-file=3D/etc/mysql/my.cnf --user=3Dr= oot --password=3D'PASSWORD'
# /etc/init.d/mysql restart

And thats it.
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

Dave

------=_Part_2853_3300041.1129983403386-- -- gentoo-server@gentoo.org mailing list