equal
deleted
inserted
replaced
115 print ("Please verify MySQL is properly configured and online " |
115 print ("Please verify MySQL is properly configured and online " |
116 "before using svcadm(1M) to clear this service.") |
116 "before using svcadm(1M) to clear this service.") |
117 sys.exit(smf_include.SMF_EXIT_ERR_FATAL) |
117 sys.exit(smf_include.SMF_EXIT_ERR_FATAL) |
118 |
118 |
119 cursor = db.cursor() |
119 cursor = db.cursor() |
120 cursor.execute("SET foreign_key_checks = 0") |
|
121 cursor.execute("ALTER DATABASE %s CHARACTER SET = 'utf8'" % |
120 cursor.execute("ALTER DATABASE %s CHARACTER SET = 'utf8'" % |
122 engine.url.database) |
121 engine.url.database) |
123 cursor.execute("ALTER DATABASE %s COLLATE = 'utf8_general_ci'" % |
122 cursor.execute("ALTER DATABASE %s COLLATE = 'utf8_general_ci'" % |
124 engine.url.database) |
123 engine.url.database) |
125 cursor.execute("SET foreign_key_checks = 1") |
|
126 cursor.execute("SHOW tables") |
124 cursor.execute("SHOW tables") |
127 res = cursor.fetchall() |
125 res = cursor.fetchall() |
128 if res: |
126 if res: |
129 cursor.execute("SET foreign_key_checks = 0") |
127 cursor.execute("SET foreign_key_checks = 0") |
130 for item in res: |
128 for item in res: |