command line - Batch file to create a user and then assign permissions with mysql -



command line - Batch file to create a user and then assign permissions with mysql -

i trying create batch file create new user , assign permissions new user. want this:

c:\mysql\bin\mysql -uroot -ppassword < create user 'username_here'@'localhost' identified 'password_here'; c:\mysql\bin\mysql -uroot -ppassword < grant on mydb.* 'username_here'@'localhost';

problem error saying scheme can not find file specified. know calling mysql exe right place because if do:

c:\mysql\bin\mysql -uroot -ppassword

it logs in , gives me mysql prompt. doing wrong?

you can utilize --execute alternative pass 1 statement database:

class="lang-none prettyprint-override">c:\mysql\bin\mysql -uroot -ppassword --execute="create user 'username_here'@'localhost' identified 'password_here';" c:\mysql\bin\mysql -uroot -ppassword --execute="grant on mydb.* 'username_here'@'localhost';"

mysql command-line batch-file

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -