问题
I have set up a database in Amazon RDS using Amazon Aurora and would like to interact with the database using Python - the obvious choice is to use Boto.
However, their documentation is awful and does nopt cover ways in which I can interact with the databse to:
- Run queries with SQL statements
- Interact with the tables in the database
- etc
Does anyone have an links to some examples/tutorials, or know how to do these tasks?
回答1:
When using Amazon RDS offerings (including Aurora), you don't connect to the database via any AWS API (including Boto). Instead you would use the native client of your chosen database. In the case of Aurora, you would connect using the MySQL Command Line client. From there, you can query it just like any other MySQL database.
There's a brief section of the "Getting Started" documentation that talks about connecting to your Aurora database:
Connecting to an Amazon Aurora DB Cluster
来源:https://stackoverflow.com/questions/35468372/using-boto3-to-interact-with-amazon-aurora-on-rds