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