I created an RDS instance on AWS (Aurora MySQL with replication). When I start importing an SQL file into the database I get an error message ERROR 2013 (HY000) at line 2805: Lost connection to MySQL server during query and AWS changes the replication role from writer to reader.
Is there a way to disable changing of the replication role during import or some other way to fix it?
Related
I am working on a project, where I want to replicate data from a source Aurora Mysql to Kinesis with AWS data migration service (DMS).
I am able to connect to source Mysql DB from mysql command and can see whole database:
mysql --host=<host>.amazonaws.com --port=8200 --user=<user> -p
But when I am starting replication task of DMS, DMS is giving connection issue with source DB. Connection with destination (Kinesis) is fine.
Testing connection for source DB from DMS, giving error:
Test Endpoint failed: Application-Status: 1020912, Application-Message: Cannot connect to ODBC provider ODBC general error., Application-Detailed-Message: RetCode: SQL_ERROR SqlState: HY000 NativeError: 2003 Message: [unixODBC][MySQL][ODBC 8.0(w) Driver]Can't connect to MySQL server on '.compute-1.amazonaws.com' (110)
I tried from AWS docs but I am not able to figure out the issue. In the network ACL of VPC, I have allowed ALL incoming traffic for its VPC.
Faced the same issue, not sure if you have figured out the solution. Network setup was fine, was using the same VPC for both RDS and DMS Replication instance, there was no issue with security group, however the issue was with the version of DMS.
RDS MySQL version is 5.7, the ODBC driver present in the higher version doesn't seem to work with the RDS instance or probably something is limiting connection to RDS MySQL 5.7 in DMS, launched a new replication instance in DMS with version 3.3.3 and the DB connectivity worked fine, also data movement is happening fine
I am currently trying to connect to my MySql database created on AWS with a python program using the library PyMySQL.
import pymysql.cursors
connection = pymysql.connect(host='.blablablablabla.us-east.rds.amazonaws.com',
user='Username',
password='Password',
db='nameofmydb',
)
When I run the above code I get the following error:
pymysql.err.InternalError: (1049, "Unknown database 'nameofmydb'")
What am I doing wrong? The arguments I gave to the function are correct. Could it be a problem with the MySql driver?
Thank you in advance
The message is the standard one, returned by mysql server. It means what it says, it can not find the database. Doesn't look like a connectivity problem or a driver issue: it reaches the server and the server returns a message.
Just make sure you have created the database using the CREATE DATABASE command. Use the mysql CLI client to connect to the database and type SHOW DATABASES to see all the available databases.
I am trying to migrate a database from Microsoft SQL Server 2008 to a local mysql database.Although the tool is able to migrate schema and table,it fails at the time of bulk data transfer.
my database name is university and my log show below message
13:42:11 [INF][copytable]: Connecting to MySQL server at 127.0.0.1:3306 with user root
13:42:11 [INF][copytable]: Connection to MySQL opened
13:42:11 [INF][copytable]: Re-enabling triggers for schema 'university'
13:42:11 [INF][copytable]: No triggers found for 'university'
what should i do? please help me.
i am trying to connect AWS db instance through MySQL workbench, the current rdb instance engine is MYSQL 5.6.23 also i am under the free tier plan in AWS ap-southeast region (Singapore)
These are the follwing steps in MySQL workbench
The user name and password is already set by me when i click the Test connection i got error always like this in the below image
So i go to the RDS Security group of this instance amrita2016-rds (sg-970f10f2) in AWS and Add an inbound rule to that group for allowing connections from my machine see the image
after that i tried once again through MYSQL workbench getting same error also i am working under domain network . Please help me to resolve this issue
I'm trying to import my .sql dump from local machine to AWS RDS db instance using the command:
C:\Program Files\MySQL\MySQL Server 5.5\bin>mysqldump --host=localhost
--user=root --password=admin e_learning_system | mysql
--host=mydbinstance.cyz1k1vacvdd.us-east-1.rds.amazonaws.com
--user=root --password=adminadmin e_learning_system
but it is throwing this error:
ERROR 2003 (HY000): Can't connect to MySQL server on
'mydbinstance.cyz1k1vacvdd.us-east-1.rds.amazonaws.com' (10060)
mysqldump: Got errno 22 on write
How do I correct this?
In case there is anyone who is still looking for a solution like I was, I managed to get it done by setting the security group in my RDS instance. Just go to that security group, you will find the click in "Security and Network" section. After you are on that security group page, edit the inbound rule, change the source to 0.0.0.0/0 (meaning accept from all) temporarily, and then import your db dump. That should work. But keep in mind you might want to revert it back this setting on production.
Yes, Amazon Beanstalk application and RDS security groups must be same for connecting application to database instance..
Right click on database instance and add a new security group using by beanstalk application..
error 2003 means no connection to mysql server. Check if you allowed the machine from where you connect to RDS in the RDS security group.
I prefer using MySQL workbench. It's much more easier & user friendly than the command line way.
It provides a simple GUI.
MySQL workbench or SQL Yog.
These are the steps that I did.
1) Install MySQL Workbench.
2) In AWS console, there must be a security group for your RDS instance. Add an inbound rule to that group for allowing connections from your machine. It's simple. Add your IP-address.
3) Open MySQL workbench, Add a new connection.
4) Give the connection a name you prefer.
5) Choose connection method- Standard TCP/IP
6) Enter your RDS endpoint in the field of Hostname (mydbinstance.cyz1k1vacvdd.us-east-1.rds.amazonaws.com).
7) Port:3306
8) Username: master username (the one which which you created during the creation of your RDS instance) (root)
9)Password: master password (admin admin)
10) Click Test Connection to check your connection.
11) If connection is successful, click OK.
12) Open the connection.
13) you will see your database 'e_learning_system' there.
14) Now you can export your mysqldump file to this database. Go to-> Server. Click Data Import.
15) You can check whether the data has been migrated by simply opening a blank SQL file & typing in basic SQL commands like use database, select * from table;
I was getting the same error and I solved it by adding mysql.exe... to the firewall of the machine I was connecting to.