MySQL (5-7) 安装脚本
#!/usr/bin/python #coding=utf-8 #Larryd.Yin import commands import os import shutil import time import sys A = "A" B = "B" C = "C" a = "a" b = "b" c = "c" Y = "Y" y = "y" N = "N" m_name = "mysql-5.5.62-linux-glibc2.12-x86_64.tar.gz" m2_name = "ql-5.6.44-linux-glibc2.12-x86_64.tar.gz" m3_name = "mysql-5.7.26-linux-glibc2.12-x86_64.tar" def jnsystem(): os.chdir("/usr/local/mysql") commandstatusoutput("mkdir log && chown -R mysql:mysql /usr/local/mysql") shutil.copy("support-files/mysql.server","/etc/init.d/mysql") msc = '/etc/init.d/mysql' mf = open("/etc/init.d/mysql","r") content = mf.read()