I want to change to another MySQL database (from backand) from my current one. So, I suppose it is about the way I set the database settings.
engine = create_engine('mysql+mysqldb://user:pw@backands146367311ktcttuv7')
df_2.to_sql(name='KLSE', con=engine, if_exists='replace')
it returns this error
OperationalError: (_mysql_exceptions.OperationalError) (2005, "Unknown MySQL server host 'backands146367311ktcttuv7' (0)")
When I use another settings,
engine = create_engine('mysql+mysqldb://user:[email protected]:3306')
df_2.to_sql(name='KLSE', con=engine, if_exists='replace')
It returns this error
OperationalError: (_mysql_exceptions.OperationalError) (1046, 'No database selected') [SQL: 'DESCRIBE `KLSE`']
Below is the MySQL database information provided
Database Type:
mysql
Endpoint:
bk-prod-us1.cd2junihlkms.us-east-1.rds.amazonaws.com:3306
Database name:
backands146367311ktcttuv7
try to specify the database name in your DB URL after the port number, like this:
engine = create_engine('mysql+mysqldb://user:[email protected]:3306/backands146367311ktcttuv7'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With