@@ -38,6 +38,9 @@ CREATE TABLE IF NOT EXISTS host ( Host char(60) binary DEFAULT '' NOT NULL, Db
...
@@ -38,6 +38,9 @@ CREATE TABLE IF NOT EXISTS host ( Host char(60) binary DEFAULT '' NOT NULL, Db
CREATETABLEIFNOTEXISTSuser(Hostchar(60)binaryDEFAULT''NOTNULL,Userchar(16)binaryDEFAULT''NOTNULL,Passwordchar(41)charactersetlatin1collatelatin1_binDEFAULT''NOTNULL,Select_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Insert_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Update_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Delete_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Create_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Drop_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Reload_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Shutdown_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Process_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,File_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Grant_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,References_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Index_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Alter_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Show_db_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Super_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Create_tmp_table_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Lock_tables_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Execute_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Repl_slave_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Repl_client_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Create_view_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Show_view_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Create_routine_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Alter_routine_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Create_user_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Event_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Trigger_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Create_tablespace_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,ssl_typeenum('','ANY','X509','SPECIFIED')COLLATEutf8_general_ciDEFAULT''NOTNULL,ssl_cipherBLOBNOTNULL,x509_issuerBLOBNOTNULL,x509_subjectBLOBNOTNULL,max_questionsint(11)unsignedDEFAULT0NOTNULL,max_updatesint(11)unsignedDEFAULT0NOTNULL,max_connectionsint(11)unsignedDEFAULT0NOTNULL,max_user_connectionsint(11)DEFAULT0NOTNULL,pluginchar(64)CHARACTERSETlatin1DEFAULT''NOTNULL,authentication_stringTEXTNOTNULL,PRIMARYKEYHost(Host,User))engine=MyISAMCHARACTERSETutf8COLLATEutf8_bincomment='Users and global privileges';
CREATETABLEIFNOTEXISTSuser(Hostchar(60)binaryDEFAULT''NOTNULL,Userchar(16)binaryDEFAULT''NOTNULL,Passwordchar(41)charactersetlatin1collatelatin1_binDEFAULT''NOTNULL,Select_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Insert_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Update_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Delete_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Create_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Drop_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Reload_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Shutdown_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Process_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,File_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Grant_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,References_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Index_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Alter_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Show_db_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Super_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Create_tmp_table_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Lock_tables_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Execute_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Repl_slave_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Repl_client_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Create_view_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Show_view_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Create_routine_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Alter_routine_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Create_user_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Event_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Trigger_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Create_tablespace_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,ssl_typeenum('','ANY','X509','SPECIFIED')COLLATEutf8_general_ciDEFAULT''NOTNULL,ssl_cipherBLOBNOTNULL,x509_issuerBLOBNOTNULL,x509_subjectBLOBNOTNULL,max_questionsint(11)unsignedDEFAULT0NOTNULL,max_updatesint(11)unsignedDEFAULT0NOTNULL,max_connectionsint(11)unsignedDEFAULT0NOTNULL,max_user_connectionsint(11)DEFAULT0NOTNULL,pluginchar(64)CHARACTERSETlatin1DEFAULT''NOTNULL,authentication_stringTEXTNOTNULL,PRIMARYKEYHost(Host,User))engine=MyISAMCHARACTERSETutf8COLLATEutf8_bincomment='Users and global privileges';
-- Remember for later if user table already existed
set@had_user_table=@@warning_count!=0;
CREATETABLEIFNOTEXISTSroles_mapping(
CREATETABLEIFNOTEXISTSroles_mapping(
HostFkchar(60)binaryDEFAULT''NOTNULL,
HostFkchar(60)binaryDEFAULT''NOTNULL,
UserFkchar(16)binaryDEFAULT''NOTNULL,
UserFkchar(16)binaryDEFAULT''NOTNULL,
...
@@ -47,9 +50,6 @@ CREATE TABLE IF NOT EXISTS roles_mapping (
...
@@ -47,9 +50,6 @@ CREATE TABLE IF NOT EXISTS roles_mapping (
-- Remember for later if user table already existed
set@had_user_table=@@warning_count!=0;
CREATETABLEIFNOTEXISTSfunc(namechar(64)binaryDEFAULT''NOTNULL,rettinyint(1)DEFAULT'0'NOTNULL,dlchar(128)DEFAULT''NOTNULL,typeenum('function','aggregate')COLLATEutf8_general_ciNOTNULL,PRIMARYKEY(name))engine=MyISAMCHARACTERSETutf8COLLATEutf8_bincomment='User defined functions';
CREATETABLEIFNOTEXISTSfunc(namechar(64)binaryDEFAULT''NOTNULL,rettinyint(1)DEFAULT'0'NOTNULL,dlchar(128)DEFAULT''NOTNULL,typeenum('function','aggregate')COLLATEutf8_general_ciNOTNULL,PRIMARYKEY(name))engine=MyISAMCHARACTERSETutf8COLLATEutf8_bincomment='User defined functions';