SELECT table_schema, count(*) FROM information_schema.TABLES WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest') GROUP BY TABLE_SCHEMA;
@@ -33,8 +33,6 @@ CREATE TABLE IF NOT EXISTS db ( Host char(60) binary DEFAULT '' NOT NULL, Db c
-- Remember for later if db table already existed
set@had_db_table=@@warning_count!=0;
CREATETABLEIFNOTEXISTShost(Hostchar(60)binaryDEFAULT''NOTNULL,Dbchar(64)binaryDEFAULT''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,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,Create_tmp_table_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Lock_tables_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,Execute_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,Trigger_privenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,PRIMARYKEYHost(Host,Db))engine=Ariatransactional=1CHARACTERSETutf8COLLATEutf8_bincomment='Host privileges; Merged with database privileges';
CREATETABLEIFNOTEXISTSuser(Hostchar(60)binaryDEFAULT''NOTNULL,Userchar(80)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,Delete_history_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,password_expiredENUM('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,is_roleenum('N','Y')COLLATEutf8_general_ciDEFAULT'N'NOTNULL,default_rolechar(80)binaryDEFAULT''NOTNULL,max_statement_timedecimal(12,6)DEFAULT0NOTNULL,PRIMARYKEYHost(Host,User))engine=Ariatransactional=1CHARACTERSETutf8COLLATEutf8_bincomment='Users and global privileges';
-- Remember for later if user table already existed
...
...
@@ -265,3 +263,4 @@ set storage_engine=@orig_storage_engine;