Merge pull request #141 from haiwen/db_owner

Db owner
This commit is contained in:
Daniel Pan 2019-01-30 17:14:21 +08:00 committed by GitHub
commit 03270ed21c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -265,8 +265,16 @@ def update_version_stamp(version, fn=get_version_stamp_file()):
fp.write(version + '\n')
def wait_for_mysql():
tried = False
while not exists('/var/run/mysqld/mysqld.sock'):
logdbg('waiting for mysql server to be ready')
"""
Try to solve the MySQL startup failure caused by the permission problem
caused by the MySQL user's uid change.
"""
if not tried:
os.system('rm /var/lib/mysql/tc.log -f && chown -R mysql.mysql /var/lib/mysql/')
tried = True
time.sleep(2)
logdbg('mysql server is ready')