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/runpy.py”, line 193, in _run_module_as_main
main ”, mod_spec)
File “/usr/local/lib/python3.7/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “/home/rivererp/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 99, in
main()
File “/home/rivererp/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/rivererp/erpnext/frappe-bench/env/lib/python3.7/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/home/rivererp/erpnext/frappe-bench/env/lib/python3.7/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/home/rivererp/erpnext/frappe-bench/env/lib/python3.7/site-packages/click/core.py”, 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/core.py”, 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/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/rivererp/erpnext/frappe-bench/env/lib/python3.7/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/home/rivererp/erpnext/frappe-bench/env/lib/python3.7/site-packages/click/decorators.py”, 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/site.py”, line 287, in migrate
migrate(context.verbose, rebuild_website=rebuild_website, skip_failing=skip_failing)
File “/home/rivererp/erpnext/frappe-bench/apps/frappe/frappe/migrate.py”, 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/database.py”, line 702, in get_global
return self.get_default(key, user)
File “/home/rivererp/erpnext/frappe-bench/apps/frappe/frappe/database/database.py”, line 706, in get_default
d = self.get_defaults(key, parent)
File “/home/rivererp/erpnext/frappe-bench/apps/frappe/frappe/database/database.py”, line 724, in get_defaults
defaults = frappe.defaults.get_defaults(parent)
File “/home/rivererp/erpnext/frappe-bench/apps/frappe/frappe/defaults.py”, line 77, in get_defaults
globald = get_defaults_for()
File “/home/rivererp/erpnext/frappe-bench/apps/frappe/frappe/defaults.py”, 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/database.py”, line 122, in sql
self.connect()
File “/home/rivererp/erpnext/frappe-bench/apps/frappe/frappe/database/database.py”, line 75, in connect
self._conn = self.get_connection()
File “/home/rivererp/erpnext/frappe-bench/apps/frappe/frappe/database/mariadb/database.py”, 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/connections.py”, line 325, in init
self.connect()
File “/home/rivererp/erpnext/frappe-bench/env/lib/python3.7/site-packages/pymysql/connections.py”, line 599, in connect
self._request_authentication()
File “/home/rivererp/erpnext/frappe-bench/env/lib/python3.7/site-packages/pymysql/connections.py”, line 861, in _request_authentication
auth_packet = self._read_packet()
File “/home/rivererp/erpnext/frappe-bench/env/lib/python3.7/site-packages/pymysql/connections.py”, line 684, in _read_packet
packet.check_error()
File “/home/rivererp/erpnext/frappe-bench/env/lib/python3.7/site-packages/pymysql/protocol.py”, line 220, in check_error
err.raise_mysql_exception(self._data)
File “/home/rivererp/erpnext/frappe-bench/env/lib/python3.7/site-packages/pymysql/err.py”, 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 https://github.com/frappe/frappe/wiki/Using-Frappe-with-Amazon-RDS-(or-any-other-DBaaS)

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

Hi,

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 castlecraft.in