pymysql.err.OperationalError: (1130, "172.26.0.6' is not allowed to connect to this MariaDB server")

When I’m running this command im getting this error

cmd

bench new-site wiki141.localhost --mariadb-root-password 123 --admin-password admin --no-mariadb-socket

error

frappe@94256f75672a:/workspace/development/frappe-bench$ bench new-site wiki141.localhost --mariadb-root-password 123 --admin-password admin --no-mariadb-socket
Traceback (most recent call last):
  File "/home/frappe/.pyenv/versions/3.10.12/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/frappe/.pyenv/versions/3.10.12/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/workspace/development/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 109, in <module>
    main()
  File "/workspace/development/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
    click.Group(commands=commands)(prog_name="bench")
  File "/workspace/development/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/workspace/development/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/workspace/development/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/workspace/development/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/workspace/development/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/workspace/development/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/workspace/development/frappe-bench/apps/frappe/frappe/commands/site.py", line 76, in new_site
    _new_site(
  File "/workspace/development/frappe-bench/apps/frappe/frappe/installer.py", line 80, in _new_site
    install_db(
  File "/workspace/development/frappe-bench/apps/frappe/frappe/installer.py", line 156, in install_db
    setup_database(force, source_sql, verbose, no_mariadb_socket)
  File "/workspace/development/frappe-bench/apps/frappe/frappe/database/__init__.py", line 20, in setup_database
    return frappe.database.mariadb.setup_db.setup_database(
  File "/workspace/development/frappe-bench/apps/frappe/frappe/database/mariadb/setup_db.py", line 36, in setup_database
    if force or (db_name not in dbman.get_database_list()):
  File "/workspace/development/frappe-bench/apps/frappe/frappe/database/db_manager.py", line 49, in get_database_list
    return self.db.sql("SHOW DATABASES", pluck=True)
  File "/workspace/development/frappe-bench/apps/frappe/frappe/database/database.py", line 201, in sql
    self.connect()
  File "/workspace/development/frappe-bench/apps/frappe/frappe/database/database.py", line 115, in connect
    self._conn = self.get_connection()
  File "/workspace/development/frappe-bench/apps/frappe/frappe/database/mariadb/database.py", line 98, in get_connection
    conn = self._get_connection()
  File "/workspace/development/frappe-bench/apps/frappe/frappe/database/mariadb/database.py", line 104, in _get_connection
    return self.create_connection()
  File "/workspace/development/frappe-bench/apps/frappe/frappe/database/mariadb/database.py", line 107, in create_connection
    return pymysql.connect(**self.get_connection_settings())
  File "/workspace/development/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py", line 352, in __init__
    self.connect()
  File "/workspace/development/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py", line 635, in connect
    self._get_server_information()
  File "/workspace/development/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py", line 1056, in _get_server_information
    packet = self._read_packet()
  File "/workspace/development/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py", line 729, in _read_packet
    packet.raise_for_error()
  File "/workspace/development/frappe-bench/env/lib/python3.10/site-packages/pymysql/protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "/workspace/development/frappe-bench/env/lib/python3.10/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.OperationalError: (1130, "172.26.0.6' is not allowed to connect to this MariaDB server")

Help me to solve this

@Robot try this command mysql -u root -p and set your sql password which is 123 according to you. does it open the database ?

Not opening, how to change the root password

@Robot switch to the root using su . you have to provide your root user password ( it’s not the mysql root password).
then try the command mysql . it should open the database .
the run
flush privileges;
use mysql;
ALTER USER ‘root’@‘localhost’ IDENTIFIED BY ‘NewPassword’;
quit
return to normal user using exit
try the same command from above using the new password.