Skip to content

Commit 36167f2

Browse files
Error : ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'rqg_test'@'% (#9)
Fix : user rqg_test is already present and script is trying to add it before verifying the existance. Added a check to first veify if user exists or not , if exists then delete it before adding.
1 parent 5641564 commit 36167f2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

util/rqg_datagen.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ def initiate_rqg(self, module, db, socket):
3838
os.system(create_db)
3939
if int(self.version) > int("050700"):
4040
create_user = self.basedir + "/bin/mysql --user=root --socket=" + socket + \
41-
' -Bse"create user rqg_test@\'%\' identified with mysql_native_password by \'\'; ' \
41+
' -Bse" drop user if exists \'rqg_test\'@\'%\'; FLUSH PRIVILEGES; ' \
42+
'create user rqg_test@\'%\' identified with mysql_native_password by \'\'; ' \
4243
'grant all on *.* to rqg_test@\'%\';" 2>&1'
4344
os.system(create_user)
4445
# Checking RQG module

0 commit comments

Comments
 (0)