I have a shell script which has the following content:
#!/bin/sh
mysql -uqgk_user -ppw12345 -e "create database qgk; GRANT ALL PRIVILEGES ON qgk.* TO qgk_user@localhost IDENTIFIED BY 'pw12345' WITH GRANT OPTION;"
I receive this error if I run the shell script:
manager@xagate:/var/www/.../public_html/...$ sh database_setup.sh
ERROR 1045 (28000): Access denied for user 'qgk_user'@'localhost' (using password: YES)
I don't understand why this issue is occurring. Anyone who posts a working solution for this issue can include their Ripple address within their answer to be rewarded XRP for their assistance with this issue.
qgk_useris not permitted to create a database, or does not haveGRANTprivileges on that created database. Run them separately to find out which one fails. Also login asqgk_user@localhostandSHOW GRANTS. Keep in mind that thelocalhostgrants may possibly differ from127.0.0.1grants.mysql -uqgk_user -ppw12345 -e "create database qgk"-- does that succeed alone?SHOW GRANTSwhen logged in asqgk_userwith that password. It appears you don't have permission to create your database. Also, I recommend deleting that comment ^^^ because it contains details about the host you're working on.