I have Nginx+Passenger+Rails3.
Passenger throws the following error:
Can't connect to MySQL server on '184.169.131.xxx' (111) (Mysql2::Error)
I am able to connect to MySql using mysql command. I think that the user that is running Passenger doesnt have the permissions.
I want to know: How to determine which user is running passenger and how to give permissions to access mysql.
Thanks
If it can’t connect, it’s likely that either:
127.0.0.1and can’t accept connections from remote machines.Are you certain that
mysqlis connecting to the same remote? You might be running a local server instead that allows access with the default configuration.As a note, opening up 3306 to the general internet is a bad idea, so you will want to be very selective in how you do this. The best practice is to use private IPs whenever possible, like 10.x.x.x, 172.16.x.x or 192.168.x.x. There are a number of reserved blocks which can be used safely, but these cannot be routed outside your local network.
You should also check that whatever
config/database.ymlsettings you have defined are the same you’re using with themysqlcommand-line tool. Passenger is not treated as a special case.