Gentoo Archives: gentoo-server

From: Francesco Riosa <vivo@g.o>
To: gentoo-server@l.g.o
Subject: Re: [gentoo-server] MySQL upgrade guide
Date: Fri, 08 Dec 2006 01:20:45
Message-Id: 4578BD54.8050001@gentoo.org
In Reply to: Re: [gentoo-server] MySQL upgrade guide by Alex Efros
1 Alex Efros ha scritto:
2 > Hi!
3 >
4 > On Fri, Dec 08, 2006 at 01:45:31AM +0200, Alex Efros wrote:
5 >
6 >> # mysql_upgrade_shell --user=root --password='your_password' \
7 >> --protocol=tcp --datadir="${DATADIR}"
8 >>
9 >> In original MySQL upgrade documentation they recommend to run mysql_upgrade
10 >> program and there is nothing about mysql_upgrade_shell script.
11 >> AFAIK mysql_upgrade_shell is older version of this program (mysql_upgrade
12 >> program was added because there no bash to execute mysql_upgrade_shell
13 >> script on Win32).
14 >> So, what's better to run - mysql_upgrade_shell or mysql_upgrade? Or there
15 >> no difference between them now?
16 >>
17 >
18 > BTW, I got error while running mysql_upgrade_shell:
19 >
20 > ---cut---
21 > # mysql_upgrade_shell --user=root --password='MYPASS' --protocol=tcp --datadir="${DATADIR}"
22 > This script updates all the mysql privilege tables to be usable by
23 > MySQL 4.0 and above.
24 >
25 > This is needed if you want to use the new GRANT functions,
26 > CREATE AGGREGATE FUNCTION, stored procedures, or
27 > more secure passwords in 4.1
28 >
29 > Got a failure from command:
30 > cat /usr/share/mysql/mysql_fix_privilege_tables.sql | /usr/bin/mysql --no-defaults --force --user=root --host=localhost --password=MYPASS --database=mysql
31 > Please check the above output and try again.
32 >
33
34 > Running the script with the --verbose option may give you some information
35 > of what went wrong.
36 >
37 > If you get an 'Access denied' error, you should run this script again and
38 > give the MySQL root user password as an argument with the --password= option
39 > ---cut---
40 >
41 > As you see, there no "above output", so I've tried to run failed command
42 > manually. And got strange output with some errors:
43 >
44 > ---cut---
45 > ERROR 1060 (42S21) at line 22: Duplicate column name 'File_priv'
46 > @hadGrantPriv:=1
47 >
48 ^^^ these are good, the colum is already in place and don't need to be
49 created === the database is up to date
50 > ERROR 1054 (42S22) at line 277: Unknown column 'Create_routine_priv' in 'where clause'
51 > ERROR 1054 (42S22) at line 313: Unknown column 'Create_user_priv' in 'where clause'
52 > ---cut---
53 >
54
55 > Running mysql_upgrade result in similar errors but looks like it stop on
56 > first error:
57 >
58 > ---cut---
59 > # mysql_upgrade -p -v --basedir=/usr
60 > Enter password:
61 > mysql_upgrade already done for this version
62 > ERROR 1060 (42S21) at line 22: Duplicate column name 'File_priv'
63 > ---cut---
64 >
65 >
66 This is what I get with an already updated db:
67
68 ---cut---
69
70
71 /usr/bin/mysql_fix_privilege_tables --verbose -uroot --password=${PASS}
72
73 This script updates all the mysql privilege tables to be usable by
74 MySQL 4.0 and above.
75
76 This is needed if you want to use the new GRANT functions,
77 CREATE AGGREGATE FUNCTION, stored procedures, or
78 more secure passwords in 4.1
79
80 You can safely ignore all 'Duplicate column' and 'Unknown column' errors
81 because these just mean that your tables are already up to date.
82 This script is safe to run even if your tables are already up to date!
83
84 ERROR 1060 (42S21) at line 22: Duplicate column name 'File_priv'
85 ERROR 1060 (42S21) at line 28: Duplicate column name 'Grant_priv'
86 ERROR 1060 (42S21) at line 29: Duplicate column name 'Grant_priv'
87 ERROR 1060 (42S21) at line 30: Duplicate column name 'Grant_priv'
88 ERROR 1060 (42S21) at line 41: Duplicate column name 'ssl_type'
89 ERROR 1060 (42S21) at line 70: Duplicate column name 'Routine_type'
90 ERROR 1054 (42S22) at line 94: Unknown column 'Type' in 'columns_priv'
91 ERROR 1060 (42S21) at line 100: Duplicate column name 'type'
92 ERROR 1060 (42S21) at line 110: Duplicate column name 'Show_db_priv'
93 ERROR 1060 (42S21) at line 127: Duplicate column name 'max_questions'
94 ERROR 1060 (42S21) at line 137: Duplicate column name
95 'Create_tmp_table_priv'
96 ERROR 1060 (42S21) at line 140: Duplicate column name
97 'Create_tmp_table_priv'
98 ERROR 1061 (42000) at line 145: Duplicate key name 'Grantor'
99 ERROR 1060 (42S21) at line 252: Duplicate column name 'Create_view_priv'
100 ERROR 1060 (42S21) at line 253: Duplicate column name 'Create_view_priv'
101 ERROR 1060 (42S21) at line 254: Duplicate column name 'Create_view_priv'
102 ERROR 1060 (42S21) at line 259: Duplicate column name 'Show_view_priv'
103 ERROR 1060 (42S21) at line 260: Duplicate column name 'Show_view_priv'
104 ERROR 1060 (42S21) at line 261: Duplicate column name 'Show_view_priv'
105 ERROR 1060 (42S21) at line 282: Duplicate column name 'Create_routine_priv'
106 ERROR 1060 (42S21) at line 283: Duplicate column name 'Create_routine_priv'
107 ERROR 1060 (42S21) at line 284: Duplicate column name 'Create_routine_priv'
108 ERROR 1060 (42S21) at line 289: Duplicate column name 'Alter_routine_priv'
109 ERROR 1060 (42S21) at line 290: Duplicate column name 'Alter_routine_priv'
110 ERROR 1060 (42S21) at line 291: Duplicate column name 'Alter_routine_priv'
111 ERROR 1060 (42S21) at line 293: Duplicate column name 'Execute_priv'
112 ERROR 1060 (42S21) at line 294: Duplicate column name 'Execute_priv'
113 ERROR 1060 (42S21) at line 306: Duplicate column name 'max_user_connections'
114 ERROR 1060 (42S21) at line 315: Duplicate column name 'Create_user_priv'
115 done
116
117 ---cut---
118
119 /usr/share/mysql/mysql_fix_privilege_tables.sql
120 is plain sql you can try single statments from there to see what's the
121 result
122
123 good night CET time remember ? ;)
124
125
126 --
127 gentoo-server@g.o mailing list