Maria DB from EC2 to RDS migration Access denied

HI I got the following error when I connect RDS with the bench update command command

Move the EC2 DB to RDS successfully But EC2 to RDS connection not Working

Traceback (most recent call last):
File “/usr/local/lib/python3.7/”, line 193, in _run_module_as_main
main ”, mod_spec)
File “/usr/local/lib/python3.7/”, line 85, in _run_code
exec(code, run_globals)
File “/home/rivererp/erpnext/frappe-bench/apps/frappe/frappe/utils/”, line 99, in
File “/home/rivererp/erpnext/frappe-bench/apps/frappe/frappe/utils/”, line 18, in main
File “/home/rivererp/erpnext/frappe-bench/env/lib/python3.7/site-packages/click/”, line 764, in call
return self.main(*args, **kwargs)
File “/home/rivererp/erpnext/frappe-bench/env/lib/python3.7/site-packages/click/”, line 717, in main
rv = self.invoke(ctx)
File “/home/rivererp/erpnext/frappe-bench/env/lib/python3.7/site-packages/click/”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/rivererp/erpnext/frappe-bench/env/lib/python3.7/site-packages/click/”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/rivererp/erpnext/frappe-bench/env/lib/python3.7/site-packages/click/”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/rivererp/erpnext/frappe-bench/env/lib/python3.7/site-packages/click/”, line 555, in invoke
return callback(*args, **kwargs)
File “/home/rivererp/erpnext/frappe-bench/env/lib/python3.7/site-packages/click/”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/rivererp/erpnext/frappe-bench/apps/frappe/frappe/commands/ init .py”, line 26, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/rivererp/erpnext/frappe-bench/apps/frappe/frappe/commands/”, line 287, in migrate
migrate(context.verbose, rebuild_website=rebuild_website, skip_failing=skip_failing)
File “/home/rivererp/erpnext/frappe-bench/apps/frappe/frappe/”, line 43, in migrate
for app in frappe.get_installed_apps():
File “/home/rivererp/erpnext/frappe-bench/apps/frappe/frappe/ init .py”, line 906, in get_installed_apps
installed = json.loads(db.get_global(“installed_apps”) or “[]”)
File “/home/rivererp/erpnext/frappe-bench/apps/frappe/frappe/database/”, line 702, in get_global
return self.get_default(key, user)
File “/home/rivererp/erpnext/frappe-bench/apps/frappe/frappe/database/”, line 706, in get_default
d = self.get_defaults(key, parent)
File “/home/rivererp/erpnext/frappe-bench/apps/frappe/frappe/database/”, line 724, in get_defaults
defaults = frappe.defaults.get_defaults(parent)
File “/home/rivererp/erpnext/frappe-bench/apps/frappe/frappe/”, line 77, in get_defaults
globald = get_defaults_for()
File “/home/rivererp/erpnext/frappe-bench/apps/frappe/frappe/”, line 204, in get_defaults_for
where parent = %s order by creation"“”, (parent,), as_dict=1)
File “/home/rivererp/erpnext/frappe-bench/apps/frappe/frappe/database/”, line 122, in sql
File “/home/rivererp/erpnext/frappe-bench/apps/frappe/frappe/database/”, line 75, in connect
self._conn = self.get_connection()
File “/home/rivererp/erpnext/frappe-bench/apps/frappe/frappe/database/mariadb/”, line 90, in get_connection
local_infile = frappe.conf.local_infile)
File “/home/rivererp/erpnext/frappe-bench/env/lib/python3.7/site-packages/pymysql/ init .py”, line 94, in Connect
return Connection(*args, **kwargs)
File “/home/rivererp/erpnext/frappe-bench/env/lib/python3.7/site-packages/pymysql/”, line 325, in init
File “/home/rivererp/erpnext/frappe-bench/env/lib/python3.7/site-packages/pymysql/”, line 599, in connect
File “/home/rivererp/erpnext/frappe-bench/env/lib/python3.7/site-packages/pymysql/”, line 861, in _request_authentication
auth_packet = self._read_packet()
File “/home/rivererp/erpnext/frappe-bench/env/lib/python3.7/site-packages/pymysql/”, line 684, in _read_packet
File “/home/rivererp/erpnext/frappe-bench/env/lib/python3.7/site-packages/pymysql/”, line 220, in check_error
File “/home/rivererp/erpnext/frappe-bench/env/lib/python3.7/site-packages/pymysql/”, line 109, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.OperationalError: (1045, “Access denied for user ‘_2e68096a1650b265’@‘RDS’ (using password: YES)”) help me how to over come the issue

SELECT User, Host from mysql.user;

It will show users and their hosts.

Add or update the user to allow % as host.
This will allow any IP or host to access the database.

it should be changed to EC2 OR RDS ??

The queries need to run on RDS. Connect to rds using mysql -u<admin_user> -p<admin_password> -h<rds_host> command (note there is no space). Run the command from EC2 instance, RDS should be accessible from there if networking configuration is correct.

Yes. EC2 to RDS access working fine with following command mysql -h <rds-_ost> -u <admin_user> -p

After set maria_db host <rds_host>

but I run the bench update command I got the error

Also In RDS no user “_2e68096a1650b265”

did you set the db_host and other params?

refer this Using Frappe with Amazon RDS (or any other DBaaS) · frappe/frappe Wiki · GitHub

We are using MariaDB 10.4 it’s also using parameter group


We using AWS code commit for Repo.
We try to setup the Continuous deployment using Jenkins and AWS EC2. It’s is possible?

Give me the any Document for that

There is no documentation for such things anywhere.

You need to learn and implement the components as per your use case.

Related topics and repos:

Commercial? Connect with me at