1 |
On 10/22/05, Dave Strydom <strydom.dave@×××××.com> wrote: |
2 |
> oh yeah, and change the --password='' field to your own password, dont just |
3 |
> copy past. |
4 |
> |
5 |
> Dave |
6 |
> |
7 |
> |
8 |
> On 10/22/05, Dave Strydom <strydom.dave@×××××.com> wrote: |
9 |
> > Man, this ...... page messed up my mysql stuff seriously, ok, for those |
10 |
> who had the same libmysqlclient.so.12 problems i had or for those people who |
11 |
> get to the importing of all your database backup and it stuffs up. here is |
12 |
> DAVE'S guide to upgrading to MySQL 4.1 |
13 |
> > |
14 |
> > |
15 |
> > # = commands to type |
16 |
> > = = comments |
17 |
> > |
18 |
> > ==================================== |
19 |
> > # mkdir -p /home/backup/mysql |
20 |
> > # nano mysql_backup.php |
21 |
> > |
22 |
> > == |
23 |
> > = Place the code below into the mysql_backup.php and save the file = |
24 |
> > == |
25 |
> > |
26 |
> > /*------mysql_backup.php---------*/ |
27 |
> > <? |
28 |
> > print("mysql backup\n"); |
29 |
> > foreach (glob('/var/lib/mysql/*') as $fullname) |
30 |
> > { |
31 |
> > $database = basename($fullname); |
32 |
> > $command = sprintf('mysqldump -a -B %s -c -v -Q > |
33 |
> /home/backup/mysql/%s.sql --password=\'Our@db$IG\'', $database, $database); |
34 |
> > |
35 |
> > exec($command); |
36 |
> > print($database . ' : ' . $command . "\n\n\n"); |
37 |
> > |
38 |
> > } |
39 |
> > ?> |
40 |
> > |
41 |
> > |
42 |
> > /*-----------------------------------------------------*/ |
43 |
> > |
44 |
> > # nano mysql_restore.php |
45 |
> > |
46 |
> > == |
47 |
> > = Place the code below in the mysql_restore.php and save the file = |
48 |
> > == |
49 |
> > |
50 |
> > /*------mysql_retore.php---------*/ |
51 |
> > <? |
52 |
> > |
53 |
> > print("mysql backup\n"); |
54 |
> > |
55 |
> > $dir = '/home/backup/mysql/'; |
56 |
> > if ($fp = opendir($dir)) |
57 |
> > { |
58 |
> > print('running...'); |
59 |
> > while (($file = readdir($fp)) !== FALSE) { |
60 |
> > echo "$file\n"; |
61 |
> > |
62 |
> > $database = basename($file); |
63 |
> > $command = sprintf('mysql < /home/backup/mysql/%s |
64 |
> --password=\'Our@db$IG\'', $database); |
65 |
> > print($database . ' : ' . $command . "\n\n\n"); |
66 |
> > exec($command); |
67 |
> > |
68 |
> > } |
69 |
> > closedir($fp); |
70 |
> > } |
71 |
> > else |
72 |
> > { |
73 |
> > print('cannot open path ' . $dir); |
74 |
> > } |
75 |
> > |
76 |
> > ?> |
77 |
> > |
78 |
> > /*---------------*/ |
79 |
> > |
80 |
> > # php mysql_backup.php |
81 |
> > |
82 |
> > == |
83 |
> > = This will make individual backup's of all your databases, the reason i |
84 |
> make it create scripts for each database |
85 |
> > = instead of just pumping it all into 1 database, is because if there is a |
86 |
> problem on like 486590 of a 5 million |
87 |
> > = line file, its going to be a bitch to work with, this way it just |
88 |
> simplifies matters |
89 |
> > == |
90 |
> > |
91 |
> > # quickpkg dev-db/mysql |
92 |
> > # /etc/init.d/mysql stop |
93 |
> > # emerge -C mysql |
94 |
> > # rm -rf /var/lib/mysql/ /var/log/mysql |
95 |
> > # emerge mysql |
96 |
> > # etc-update |
97 |
> > # emerge --config =mysql-4.1.14 |
98 |
> > # revdep-rebuild --soname libmysqlclient.so.12 |
99 |
> > # php mysql_restore.php |
100 |
> > # mysql_fix_privilege_tables |
101 |
> --defaults-file=/etc/mysql/my.cnf --user=root |
102 |
> --password='PASSWORD' |
103 |
> > # /etc/init.d/mysql restart |
104 |
> > |
105 |
> > And thats it. |
106 |
> > ======================================= |
107 |
> > |
108 |
> > Dave |
109 |
> > |
110 |
> |
111 |
> |
112 |
|
113 |
The upgrade TOTALLY pfutzed my test box. After installing 4.1, |
114 |
revdep-rebuild wanted to build a bunch of ~x86 stuff (mod_php among |
115 |
them). I went back to the old version. I have three production servers |
116 |
running MySQL/Apache2/PHP, none of which will get this upgrade. For |
117 |
the 1st time in 3 years, Gentoo is really pissing me off. |
118 |
|
119 |
-- |
120 |
gentoo-server@g.o mailing list |