简体   繁体   中英

AWS Elastic Beanstalk RDS MacOS mysqlclient not working

I'm trying to set up an application with Django through Elastic Beanstalk and MySQL through RDS. I can successfully use the application on localhost with the MySQL RDS database. When I deploy, I have problems.

I get

"111: Connection refused"

but maybe more importantly

"mysql_config: command not found, mariadb_config: command not found, mysql_config: command not found"

Posts on here talk about using yum in a packages.config file, I tried those suggestions without success. Isn't yum for use on operating systems other than MacOS?

I followed the instructions here: https://pypi.org/project/mysqlclient/

And of course mysqlclient is in my requirements.txt

Obviously I need the files mentioned above, but how do I get them?

mysqlclient is just like a python wrapper, and it needs the MySQL client binary (and other required tools) installed on the OS. The binary installation varies based on the server OS.

I believe by what you said MacOS is your computer OS, not the server OS, right? You must check your Elastic Bean configuration and install the required binaries based on your Elastic Bean OS. For knowing what the required binaries are, you can refer to the mysqlclient docs ( Windows , Linux , MacOS )

Taking an example from an SO answer , one of yaml config to install the binary:

packages: 
  yum:
    python3-devel: []
    mariadb-devel: []

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM