I'm trying to do some testing with github actions.
previous post: test-not-found-in-github-actions
Now that the test is recognized, all that's left is to configure mysql.
I'm getting the error "User access is denied"
https://github.com/duri0214/portfolio/actions/runs/4250191595/jobs/7391059026#step:4:569
Usually this error goes away by granting privileges to mysql.
It has been confirmed on the production server that django works by giving the following nine permissions.
-- in VirtualPrivateServer
mysql> CREATE DATABASE portfolio_db DEFAULT CHARACTER SET utf8mb4;
Query OK, 1 row affected (0.01 sec)
mysql> CREATE USER 'python'@'%' IDENTIFIED BY 'XXXXXXXX';
mysql> grant CREATE, DROP, SELECT, UPDATE, INSERT, DELETE, ALTER, REFERENCES, INDEX on portfolio_db.* to 'python'@'localhost';
However, I don't really understand how to type this mysql command.
I get an error even if I issue a command to github actions as follows.
I was able to confirm that the secret was output
https://github.com/duri0214/portfolio/actions/runs/4249942981/jobs/7390568462#step:4:424
mysql -u${{ secrets.DB_USER }} -p${{ secrets.DB_PASSWORD }} -e 'CREATE DATABASE portfolio_db DEFAULT CHARACTER SET utf8mb4;'
mysql -u${{ secrets.DB_USER }} -p${{ secrets.DB_PASSWORD }} -e 'CREATE USER '${{ secrets.DB_USER }}'@'localhost' IDENTIFIED BY '${{ secrets.DB_PASSWORD }}';'
mysql -u${{ secrets.DB_USER }} -p${{ secrets.DB_PASSWORD }} -e 'grant CREATE, DROP, SELECT, UPDATE, INSERT, DELETE, ALTER, REFERENCES, INDEX on portfolio_db.* to '${{ secrets.DB_USER }}'@'localhost';'
Warning: arning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user '***'@'localhost' (using password: YES)
Error: Process completed with exit code 1.
I've tried many things, but I'm getting tired...
Anyone know how to solve this?
additional
for Azeem san :)
Django will use the information found here to create a throwaway database. this
At this time, I don't know if the credentials are from '.env' or disposable credentials.
As far as I can see the log, I was able to create the migration file, but it seems that I cannot log in to the database. this
If disposable authentication information is fine, 'echo' around here may not be necessarythis