昨天用shell脚本创建数据库,涉及java调用,比较折腾,改用python直接创建数据库,比较方便,好了,直接上代码,相关注释也添加了 # _*_encoding:UTF-8_*_import MySQLdb db_host = ''db_user = ''db_pw = ''db_name = 'vdt' def cre_db(host, user, pw, name): try: # 数据库连接 db = MySQLdb.connect(host, user, pw, charset='u