fix bug: ACCESS DENIED in test user of test tenant under Fast Boot Docker

This commit is contained in:
GITHUBear
2023-11-23 04:41:15 +00:00
committed by ob-robot
parent a19665eec0
commit 19fece84d3
4 changed files with 13 additions and 4 deletions

0
tools/docker/standalone/fast_boot_docker_build.sh Normal file → Executable file
View File

View File

View File

View File

@ -120,16 +120,25 @@ if __name__ == "__main__":
args.tenant_name, args.zone, args.tenant_name))
create_tenant_end = datetime.datetime.now()
logging.info('create tenant success: %s ms' % ((create_tenant_end - create_tenant_begin).total_seconds() * 1000))
# grant privilege
cursor.execute("CREATE USER '%s'@'%%'" % (args.tenant_name))
cursor.execute("GRANT ALL ON *.* TO '%s'@'%%'" % (args.tenant_name))
logging.info("grant privilege success")
db.close()
except mysql.err.Error as e:
logging.warn("deploy observer failed")
kill_server()
exit(-1)
# grant privilege
try:
db = mysql.connect(host=args.ip, user="root@%s" % (args.tenant_name), port=int(args.mysql_port), passwd="")
cursor = db.cursor(cursor=mysql.cursors.DictCursor)
logging.info('connect by common tenant success!')
cursor.execute("CREATE USER '%s'@'%%'" % (args.tenant_name))
cursor.execute("GRANT ALL ON *.* TO '%s'@'%%'" % (args.tenant_name))
logging.info("grant privilege success!")
except mysql.err.Error as e:
logging.warn("grant privilege for common tenant failed")
kill_server()
exit(-1)
# stop observer
kill_server()