Have changed the Default Db port and IP address instead of localhost post that i am unable to create the new site using bench
@venkatas probably you can not access the db with the new port and ip , that’s why you can’t create a new site .
I am able to login and access the DB with new port but unable to create the new site but exiting site was working with new port.
Please help some one.
I am getting below mentioned Error …
MySQL root password:
Traceback (most recent call last):
File “/apps/frappe-bench/env/lib/python3.11/site-packages/pymysql/connections.py”, line 649, in connect
sock = socket.create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.11/socket.py”, line 863, in create_connection
raise exceptions[0]
File “/usr/lib/python3.11/socket.py”, line 848, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “”, line 198, in _run_module_as_main
File “”, line 88, in _run_code
File “/apps/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 114, in
main()
File “/apps/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 20, in main
click.Group(commands=commands)(prog_name=“bench”)
File “/apps/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 1157, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/apps/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File “/apps/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/apps/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/apps/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/apps/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/apps/frappe-bench/apps/frappe/frappe/commands/site.py”, line 99, in new_site
_new_site(
File “/apps/frappe-bench/apps/frappe/frappe/installer.py”, line 90, in _new_site
install_db(
File “/apps/frappe-bench/apps/frappe/frappe/installer.py”, line 170, in install_db
setup_database(force, verbose, mariadb_user_host_login_scope)
File “/apps/frappe-bench/apps/frappe/frappe/database/init.py”, line 21, in setup_database
return frappe.database.mariadb.setup_db.setup_database(force, verbose, mariadb_user_host_login_scope)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/apps/frappe-bench/apps/frappe/frappe/database/mariadb/setup_db.py”, line 32, in setup_database
if force or (db_name not in dbman.get_database_list()):
^^^^^^^^^^^^^^^^^^^^^^^^^
File “/apps/frappe-bench/apps/frappe/frappe/database/db_manager.py”, line 50, in get_database_list
return self.db.sql(“SHOW DATABASES”, pluck=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/apps/frappe-bench/apps/frappe/frappe/database/database.py”, line 207, in sql
self.connect()
File “/apps/frappe-bench/apps/frappe/frappe/database/database.py”, line 112, in connect
self._conn: “MariadbConnection” | “PostgresConnection” = self.get_connection()
^^^^^^^^^^^^^^^^^^^^^
File “/apps/frappe-bench/apps/frappe/frappe/database/mariadb/database.py”, line 107, in get_connection
conn = self._get_connection()
^^^^^^^^^^^^^^^^^^^^^^
File “/apps/frappe-bench/apps/frappe/frappe/database/mariadb/database.py”, line 113, in _get_connection
return self.create_connection()
^^^^^^^^^^^^^^^^^^^^^^^^
File “/apps/frappe-bench/apps/frappe/frappe/database/mariadb/database.py”, line 116, in create_connection
return pymysql.connect(**self.get_connection_settings())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/apps/frappe-bench/env/lib/python3.11/site-packages/pymysql/connections.py”, line 361, in init
self.connect()
File “/apps/frappe-bench/env/lib/python3.11/site-packages/pymysql/connections.py”, line 716, in connect
raise exc
pymysql.err.OperationalError: (2003, “Can’t connect to MySQL server on ‘127.0.0.1’ ([Errno 111] Connection refused)”)
try : bench new-site --db-root-password 123 --admin-password admin --mariadb-user-host-login-scope=% site-name
I have tried but getting same exception .
pymysql.err.OperationalError: (2003, “Can’t connect to MySQL server on ‘127.0.0.1’ ([Errno 111] Connection refused)”)
Have you mentioned your site-name in above code?
yes i have mentioned the site name while executing the bench command.
Thanks for your update !!
After added the port and hostname in common_site_config.json file and i am getting below exception.
Traceback (most recent call last):
File “”, line 198, in _run_module_as_main
File “”, line 88, in _run_code
File “/apps/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 114, in
main()
File “/apps/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 20, in main
click.Group(commands=commands)(prog_name=“bench”)
File “/apps/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 1157, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/apps/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File “/apps/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/apps/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/apps/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/apps/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/apps/frappe-bench/apps/frappe/frappe/commands/site.py”, line 99, in new_site
_new_site(
File “/apps/frappe-bench/apps/frappe/frappe/installer.py”, line 90, in _new_site
install_db(
File “/apps/frappe-bench/apps/frappe/frappe/installer.py”, line 170, in install_db
setup_database(force, verbose, mariadb_user_host_login_scope)
File “/apps/frappe-bench/apps/frappe/frappe/database/init.py”, line 21, in setup_database
return frappe.database.mariadb.setup_db.setup_database(force, verbose, mariadb_user_host_login_scope)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/apps/frappe-bench/apps/frappe/frappe/database/mariadb/setup_db.py”, line 32, in setup_database
if force or (db_name not in dbman.get_database_list()):
^^^^^^^^^^^^^^^^^^^^^^^^^
File “/apps/frappe-bench/apps/frappe/frappe/database/db_manager.py”, line 50, in get_database_list
return self.db.sql(“SHOW DATABASES”, pluck=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/apps/frappe-bench/apps/frappe/frappe/database/database.py”, line 207, in sql
self.connect()
File “/apps/frappe-bench/apps/frappe/frappe/database/database.py”, line 112, in connect
self._conn: “MariadbConnection” | “PostgresConnection” = self.get_connection()
^^^^^^^^^^^^^^^^^^^^^
File “/apps/frappe-bench/apps/frappe/frappe/database/mariadb/database.py”, line 107, in get_connection
conn = self._get_connection()
^^^^^^^^^^^^^^^^^^^^^^
File “/apps/frappe-bench/apps/frappe/frappe/database/mariadb/database.py”, line 113, in _get_connection
return self.create_connection()
^^^^^^^^^^^^^^^^^^^^^^^^
File “/apps/frappe-bench/apps/frappe/frappe/database/mariadb/database.py”, line 116, in create_connection
return pymysql.connect(**self.get_connection_settings())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/apps/frappe-bench/env/lib/python3.11/site-packages/pymysql/connections.py”, line 361, in init
self.connect()
File “/apps/frappe-bench/env/lib/python3.11/site-packages/pymysql/connections.py”, line 669, in connect
self._request_authentication()
File “/apps/frappe-bench/env/lib/python3.11/site-packages/pymysql/connections.py”, line 957, in _request_authentication
auth_packet = self._read_packet()
^^^^^^^^^^^^^^^^^^^
File “/apps/frappe-bench/env/lib/python3.11/site-packages/pymysql/connections.py”, line 775, in _read_packet
packet.raise_for_error()
File “/apps/frappe-bench/env/lib/python3.11/site-packages/pymysql/protocol.py”, line 219, in raise_for_error
err.raise_mysql_exception(self._data)
File “/apps/frappe-bench/env/lib/python3.11/site-packages/pymysql/err.py”, line 150, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.OperationalError: (1045, “Access denied for user ‘root’@‘ocdevhost
1’ (using password: YES)”)
Sorry, I am not able to connect the DB from Remotely… but i am able to connect the DB in the same server…
Can you please help me how to resolve this…
FYI…
bind-address = 0.0.0.0. i have added this line in my.cnf file to enabled remotely
APP and DB in the same server
@venkatas ok then change your bind address back to 127.0.0.1. and hostname to localhost and not ocdevhost .
@bahaou , Thanks for your update !!
I have made the same changes and restarted the services but i am getting below error …
File “/apps/frappe-bench/env/lib/python3.11/site-packages/pymysql/err.py”, line 150, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.OperationalError: (1045, “Access denied for user ‘_7623437c21f1b0ac’@‘localhost’ (using password: YES)”)
_7623437c21f1b0ac this is DB name not user name but here its taking as username . Even though have created the user same like DB name and given the all required access to same …but still its not working …
Please help…
After executing the below command i have resolved the issue…
GRANT ALL PRIVILEGES ON . TO ‘_7623437c21f1b0ac’@‘localhost’ IDENTIFIED BY ‘your_password’;
But still i am unable to create the new-site in this environment. getting this error …FYI…
File “/apps/frappe-bench/env/lib/python3.11/site-packages/pymysql/connections.py”, line 361, in init
self.connect()
File “/apps/frappe-bench/env/lib/python3.11/site-packages/pymysql/connections.py”, line 716, in connect
raise exc
pymysql.err.OperationalError: (2003, “Can’t connect to MySQL server on ‘127.0.0.1’ ([Errno 111] Connection refused)”)