From 028be819ca29966c2b32d20148591fb25258a73f Mon Sep 17 00:00:00 2001 From: yedongfu Date: Thu, 15 Jul 2021 20:36:11 +0800 Subject: [PATCH] another way to change passwd --- .travis.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0fbc351..3313d09 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,8 @@ go: - 1.15.x env: - GO111MODULE=on -before_script: - - echo "USE mysql;\nUPDATE user SET password=PASSWORD('my-secret-pw') WHERE user='root';\nFLUSH PRIVILEGES;\n" | mysql -u root + before_install: + - sudo mysql -e "use mysql; update user set authentication_string=PASSWORD('my-secret-pw') where User='root'; update user set plugin='mysql_native_password';FLUSH PRIVILEGES;" + - sudo mysql_upgrade -u root -pmy-secret-pw + - sudo service mysql restart script: go test ./...