Fix netdata mysql user in case of reinstall

This commit is contained in:
VirtuBox
2019-12-06 13:09:45 +01:00
parent d536f57cd9
commit 0e12bc29db
2 changed files with 13 additions and 13 deletions

View File

@@ -1410,11 +1410,15 @@ def post_pref(self, apt_packages, packages, upgrade=False):
try:
WOMysql.execute(
self,
"create user 'netdata'@'localhost';",
"DELETE FROM mysql.user WHERE User = 'netdata';",
log=False)
WOMysql.execute(
self,
"grant usage on *.* to 'netdata'@'localhost';",
"create user 'netdata'@'127.0.0.1';",
log=False)
WOMysql.execute(
self,
"grant usage on *.* to 'netdata'@'127.0.0.1';",
log=False)
WOMysql.execute(
self, "flush privileges;",