Skip to content

Commit

Permalink
change init sql to work with both mysql 5.7 and mysql 8.0
Browse files Browse the repository at this point in the history
Signed-off-by: deepthi <[email protected]>
  • Loading branch information
deepthi committed Apr 12, 2019
1 parent 4c355fc commit 4033ed3
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions test/initial_sharding_multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,21 +121,15 @@ def setUpModule():
fd.write(init_db)
fd.write('''
# Set real passwords for all users.
ALTER USER 'root'@'localhost' IDENTIFIED BY 'RootPass';
ALTER USER 'vt_dba'@'localhost' IDENTIFIED BY 'VtDbaPass';
ALTER USER 'vt_app'@'localhost' IDENTIFIED BY 'VtAppPass';
ALTER USER 'vt_allprivs'@'localhost' IDENTIFIED BY 'VtAllPrivsPass';
ALTER USER 'vt_repl'@'%' IDENTIFIED BY 'VtReplPass';
ALTER USER 'vt_filtered'@'localhost' IDENTIFIED BY 'VtFilteredPass';
# connecting through a port requires 127.0.0.1
# --host=localhost will connect through socket
UPDATE mysql.user SET %s = PASSWORD('RootPass')
WHERE User = 'root' AND Host = 'localhost';
UPDATE mysql.user SET %s = PASSWORD('VtDbaPass')
WHERE User = 'vt_dba' AND Host = 'localhost';
UPDATE mysql.user SET %s = PASSWORD('VtAppPass')
WHERE User = 'vt_app' AND Host = 'localhost';
UPDATE mysql.user SET %s = PASSWORD('VtAllprivsPass')
WHERE User = 'vt_allprivs' AND Host = 'localhost';
UPDATE mysql.user SET %s = PASSWORD('VtReplPass')
WHERE User = 'vt_repl' AND Host = '%%';
UPDATE mysql.user SET %s = PASSWORD('VtFilteredPass')
WHERE User = 'vt_filtered' AND Host = 'localhost';
CREATE USER 'vt_dba'@'127.0.0.1' IDENTIFIED BY 'VtDbaPass';
GRANT ALL ON *.* TO 'vt_dba'@'127.0.0.1';
GRANT GRANT OPTION ON *.* TO 'vt_dba'@'127.0.0.1';
Expand Down Expand Up @@ -167,7 +161,7 @@ def setUpModule():
ON *.* TO 'vt_filtered'@'127.0.0.1';
FLUSH PRIVILEGES;
''' % tuple([password_col] * 6))
''')
credentials = {
'vt_dba': ['VtDbaPass'],
'vt_app': ['VtAppPass'],
Expand Down

0 comments on commit 4033ed3

Please sign in to comment.