DROP DATABASE IF EXISTS testdb;
CREATE DATABASE IF NOT EXISTS testdb;
DROP DATABASE IF EXISTS testdb_01;
CREATE DATABASE IF NOT EXISTS testdb_01;
DROP DATABASE IF EXISTS testdb_02;
CREATE DATABASE IF NOT EXISTS testdb_02;
DROP DATABASE IF EXISTS testdb_03;
CREATE DATABASE IF NOT EXISTS testdb_03;
DROP DATABASE IF EXISTS testdb_04;
CREATE DATABASE IF NOT EXISTS testdb_04;
DROP DATABASE IF EXISTS testdb_05;
CREATE DATABASE IF NOT EXISTS testdb_05;
DROP DATABASE IF EXISTS testdb_06;
CREATE DATABASE IF NOT EXISTS testdb_06;
DROP DATABASE IF EXISTS testdb_07;
CREATE DATABASE IF NOT EXISTS testdb_07;
DROP DATABASE IF EXISTS testdb_08;
CREATE DATABASE IF NOT EXISTS testdb_08;
CREATE USER IF NOT EXISTS testdb@'%' IDENTIFIED BY 'testdb';
GRANT ALL PRIVILEGES ON testdb.* TO testdb@'%';
GRANT ALL PRIVILEGES ON testdb_01.* TO testdb@'%';
GRANT ALL PRIVILEGES ON testdb_02.* TO testdb@'%';
GRANT ALL PRIVILEGES ON testdb_03.* TO testdb@'%';
GRANT ALL PRIVILEGES ON testdb_04.* TO testdb@'%';
GRANT ALL PRIVILEGES ON testdb_05.* TO testdb@'%';
GRANT ALL PRIVILEGES ON testdb_06.* TO testdb@'%';
GRANT ALL PRIVILEGES ON testdb_07.* TO testdb@'%';
GRANT ALL PRIVILEGES ON testdb_08.* TO testdb@'%';

FLUSH PRIVILEGES;
