Пример #1
0
 def grant_privileges(self):
     self.get_mysql_root_password()
     database._mysql_exec_as_root(
         "GRANT ALL PRIVILEGES ON %s.* TO '%s'@'localhost'" %
         (self.TEST_DB, self.TEST_USER))
     database._mysql_exec_as_root("FLUSH PRIVILEGES")
Пример #2
0
 def create_database(self):
     self.get_mysql_root_password()
     self.drop_database()
     database._mysql_exec_as_root("CREATE DATABASE %s CHARACTER SET utf8" % self.TEST_DB)
Пример #3
0
 def create_table(self):
     self.get_mysql_root_password()
     database._mysql_exec_as_root("CREATE TABLE %s.%s(mycolumn CHAR(30))" %
                                  (self.TEST_DB, self.TEST_TABLE))
Пример #4
0
 def create_database_user(self):
     self.get_mysql_root_password()
     self.drop_database_user()
     database._mysql_exec_as_root(
         "CREATE USER '%s'@'localhost' IDENTIFIED BY '%s'" %
         (self.TEST_USER, self.TEST_PASSWORD))
Пример #5
0
 def drop_database(self):
     self.get_mysql_root_password()
     if database._db_exists(self.TEST_DB):
         database._mysql_exec_as_root("DROP DATABASE %s" % self.TEST_DB)
Пример #6
0
 def grant_privileges(self):
     self.get_mysql_root_password()
     database._mysql_exec_as_root(
         "GRANT ALL PRIVILEGES ON %s.* TO '%s'@'localhost'" %
         (self.TEST_DB, self.TEST_USER))
     database._mysql_exec_as_root("FLUSH PRIVILEGES")
Пример #7
0
 def drop_database_user(self):
     self.get_mysql_root_password()
     if database._test_mysql_user_exists(self.TEST_USER):
         database._mysql_exec_as_root("DROP USER '%s'@'localhost'" % self.TEST_USER)
Пример #8
0
 def create_table(self):
     self.get_mysql_root_password()
     database._mysql_exec_as_root("CREATE TABLE %s.%s(mycolumn CHAR(30))" %
                                  (self.TEST_DB, self.TEST_TABLE))
Пример #9
0
 def create_database(self):
     self.get_mysql_root_password()
     self.drop_database()
     database._mysql_exec_as_root("CREATE DATABASE %s CHARACTER SET utf8" % self.TEST_DB)
Пример #10
0
 def drop_database(self):
     self.get_mysql_root_password()
     if database._db_exists(self.TEST_DB):
         database._mysql_exec_as_root("DROP DATABASE %s" % self.TEST_DB)
Пример #11
0
 def create_database_user(self):
     self.get_mysql_root_password()
     self.drop_database_user()
     database._mysql_exec_as_root(
         "CREATE USER '%s'@'localhost' IDENTIFIED BY '%s'" %
         (self.TEST_USER, self.TEST_PASSWORD))
Пример #12
0
 def drop_database_user(self):
     self.get_mysql_root_password()
     if database._test_mysql_user_exists(self.TEST_USER):
         database._mysql_exec_as_root("DROP USER '%s'@'localhost'" % self.TEST_USER)