Fix MariaDB upgrade
This commit is contained in:
@@ -933,11 +933,8 @@ def post_pref(self, apt_packages, packages, upgrade=False):
|
|||||||
config_file.close()
|
config_file.close()
|
||||||
else:
|
else:
|
||||||
# make sure root account have all privileges
|
# make sure root account have all privileges
|
||||||
if "IDENTIFIED BY PASSWORD" not in WOShellExec.cmd_exec_stdout(
|
if os.path.exists('/etc/mysql/conf.d/my.cnf.tmp'):
|
||||||
self, 'mysql -e "use mysql; show grants;"'):
|
|
||||||
try:
|
try:
|
||||||
if not os.path.exists('/etc/mysql/conf.d/my.cnf.tmp'):
|
|
||||||
Log.error(self, 'my.cnf not found')
|
|
||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
config.read('/etc/mysql/conf.d/my.cnf.tmp')
|
config.read('/etc/mysql/conf.d/my.cnf.tmp')
|
||||||
chars = config['client']['password']
|
chars = config['client']['password']
|
||||||
@@ -981,10 +978,11 @@ def post_pref(self, apt_packages, packages, upgrade=False):
|
|||||||
inno_buffer=wo_ram_innodb,
|
inno_buffer=wo_ram_innodb,
|
||||||
inno_log_buffer=wo_ram_log_buffer,
|
inno_log_buffer=wo_ram_log_buffer,
|
||||||
innodb_instances=wo_innodb_instance,
|
innodb_instances=wo_innodb_instance,
|
||||||
newmariadb=mariadbconf)
|
newmariadb=mariadbconf, release=WOVar.wo_version)
|
||||||
if os.path.exists('/etc/mysql/mariadb.conf.d/50-server.cnf'):
|
if os.path.exists('/etc/mysql/mariadb.conf.d/50-server.cnf'):
|
||||||
WOTemplate.deploy(
|
WOTemplate.deploy(
|
||||||
self, '/etc/mysql/my.cnf', 'my.mustache', data)
|
self, '/etc/mysql/mariadb.conf.d/50-server.cnf',
|
||||||
|
'my.mustache', data)
|
||||||
else:
|
else:
|
||||||
WOTemplate.deploy(
|
WOTemplate.deploy(
|
||||||
self, '/etc/mysql/my.cnf', 'my.mustache', data)
|
self, '/etc/mysql/my.cnf', 'my.mustache', data)
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# MariaDB database server configuration file.
|
# MariaDB database server configuration file.
|
||||||
|
# Optimized by WordOps {{release}}
|
||||||
#
|
#
|
||||||
# You can copy this file to one of:
|
# You can copy this file to one of:
|
||||||
# - "/etc/mysql/my.cnf" to set global options,
|
# - "/etc/mysql/my.cnf" to set global options,
|
||||||
|
|||||||
Reference in New Issue
Block a user