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 1ETIFs-0001cd-Ha for garchives@archives.gentoo.org; Sat, 22 Oct 2005 12:13:45 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.5/8.13.5) with SMTP id j9MC8fSh016570; Sat, 22 Oct 2005 12:08:41 GMT Received: from qproxy.gmail.com (qproxy.gmail.com [72.14.204.207]) by robin.gentoo.org (8.13.5/8.13.5) with ESMTP id j9MC8dVC011782 for ; Sat, 22 Oct 2005 12:08:40 GMT Received: by qproxy.gmail.com with SMTP id a10so157231qbd for ; Sat, 22 Oct 2005 05:11:34 -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=Avxem6AiGrT8EPhh7u5g5ii8HzlaHlNRSVYMBQzn8jGvk09Tex3VJGVc9IKhPH7LqLhLgFX5OL9TOaE5m0GKA9x2uXfBugQf83cJz+cO92eKqaX0qRnLDB+P5eVwIJd4otYZPqReG+s8vFZpCUdiHOq81ZTfRGWYo74i0+6TbPs= Received: by 10.64.142.3 with SMTP id p3mr2384717qbd; Sat, 22 Oct 2005 05:11:34 -0700 (PDT) Received: by 10.64.195.18 with HTTP; Sat, 22 Oct 2005 05:11:34 -0700 (PDT) Message-ID: Date: Sat, 22 Oct 2005 14:11:34 +0200 From: Dave Strydom To: gentoo-server@lists.gentoo.org Subject: Re: [gentoo-server] mysql-4.1 In-Reply-To: <4358EB92.2010605@gentoo.org> 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_2825_14428974.1129983094032" References: <4357203B.2060500@munat.com> <43588B41.6040009@munat.com> <200510211207.26060.vivo@gentoo.org> <4358EB92.2010605@gentoo.org> X-Archives-Salt: 594ec077-e97a-472d-85f2-63048f334b82 X-Archives-Hash: a5d3cdeef0d95baae48395515e9bbd51 ------=_Part_2825_14428974.1129983094032 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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 ge= t 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---------*/ /home/backup/mysql/%s.s= ql --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---------*/ /*---------------*/ # 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 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=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_2825_14428974.1129983094032 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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_2825_14428974.1129983094032-- -- gentoo-server@gentoo.org mailing list