Mysql Database connection denied

前端 未结 1 1399
甜味超标
甜味超标 2021-01-26 13:37

I am trying to get my Symfony 3 app running in production mode on an Amazon EC2 instance.

I am have the code in the correct place, and then I try to setup any dependenci

1条回答
  •  无人共我
    2021-01-26 13:53

    As discussed in comments you did not have any privilege on the database. So running this fixes your problem:

    GRANT ALL PRIVILEGES ON my_database.* TO 'my-user'@'localhost'
    

    About your doubt why you had to change it to localhost in your params because that's what you're telling mysql Imagine you want to restrict database access to only a specific ip in your network you could run

    GRANT ALL PRIVILEGES ON my_database.* TO 'my-user'@'192.168.1.10'
    

    So replace 192.168.1.10 with 127.0.0.1 and you can use 127.0.0.1 in your parameters

    0 讨论(0)
提交回复
热议问题