1echo # switching from mysql.global_priv to mysql.user;
2disable_query_log;
3rename table mysql.user to mysql.user_bak;
4CREATE TABLE mysql.user (
5  Host char(60) binary DEFAULT '' NOT NULL,
6  User char(80) binary DEFAULT '' NOT NULL,
7  Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL,
8  Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
9  Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
10  Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
11  Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
12  Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
13  Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
14  Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
15  Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
16  Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
17  File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
18  Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
19  References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
20  Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
21  Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
22  Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
23  Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
24  Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
25  Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
26  Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
27  Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
28  Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
29  Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
30  Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
31  Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
32  Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
33  Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
34  Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
35  Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
36  Create_tablespace_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
37  Delete_history_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
38  ssl_type enum('','ANY','X509','SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL,
39  ssl_cipher BLOB NOT NULL,
40  x509_issuer BLOB NOT NULL,
41  x509_subject BLOB NOT NULL,
42  max_questions int(11) unsigned DEFAULT 0  NOT NULL,
43  max_updates int(11) unsigned DEFAULT 0  NOT NULL,
44  max_connections int(11) unsigned DEFAULT 0  NOT NULL,
45  max_user_connections int(11) DEFAULT 0  NOT NULL,
46  plugin char(64) CHARACTER SET latin1 DEFAULT '' NOT NULL,
47  authentication_string TEXT NOT NULL,
48  password_expired ENUM('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
49  is_role enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
50  default_role char(80) binary DEFAULT '' NOT NULL,
51  max_statement_time decimal(12,6) DEFAULT 0 NOT NULL,
52  PRIMARY KEY (Host,User)
53) engine=Aria transactional=1 CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges';
54insert mysql.user select * from mysql.user_bak;
55rename table mysql.global_priv to mysql.global_priv_bak;
56flush privileges;
57enable_query_log;
58