Creating new site error

bench new-site turiya_tree.com
MySQL root password:

Traceback (most recent call last):
File “/usr/lib/python3.10/runpy.py”, line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File “/usr/lib/python3.10/runpy.py”, line 86, in _run_code
exec(code, run_globals)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 104, in
main()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 19, in main
click.Group(commands=commands)(prog_name=“bench”)
File “/home/ubuntu/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 1130, in call
return self.main(*args, **kwargs)
File “/home/ubuntu/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 1055, in main
rv = self.invoke(ctx)
File “/home/ubuntu/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/ubuntu/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/ubuntu/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/ubuntu/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 760, in invoke
return __callback(*args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/commands/site.py”, line 77, in new_site
_new_site(
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/installer.py”, line 80, in _new_site
install_db(
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/installer.py”, line 155, in install_db
setup_database(force, source_sql, verbose, no_mariadb_socket)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/database/init.py”, line 20, in setup_database
return frappe.database.mariadb.setup_db.setup_database(
File “/home/ubuntu/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 “/home/ubuntu/frappe-bench/apps/frappe/frappe/database/db_manager.py”, line 49, in get_database_list
return self.db.sql(“SHOW DATABASES”, pluck=True)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/database/database.py”, line 203, in sql
self.connect()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/database/database.py”, line 117, in connect
self._conn = self.get_connection()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/database/mariadb/database.py”, line 98, in get_connection
conn = self._get_connection()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/database/mariadb/database.py”, line 104, in _get_connection
return self.create_connection()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/database/mariadb/database.py”, line 107, in create_connection
return pymysql.connect(**self.get_connection_settings())
File “/home/ubuntu/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py”, line 353, in init
self.connect()
File “/home/ubuntu/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py”, line 633, in connect
self._request_authentication()
File “/home/ubuntu/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py”, line 907, in _request_authentication
auth_packet = self._read_packet()
File “/home/ubuntu/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py”, line 725, in _read_packet
packet.raise_for_error()
File “/home/ubuntu/frappe-bench/env/lib/python3.10/site-packages/pymysql/protocol.py”, line 221, in raise_for_error
err.raise_mysql_exception(self._data)
File “/home/ubuntu/frappe-bench/env/lib/python3.10/site-packages/pymysql/err.py”, line 143, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.OperationalError: (1698, “Access denied for user ‘root’@‘localhost’”)

After that i tried_________

sudo mysql -u root -p

use mysql;

set password for ‘root’@‘localhost’ = password(‘YOUR_ROOT_PASSWORD_HERE’);

But in my sites folder site is there i want to know whether its created properly or not?
Again i tried to create new site same error for that also

Hi,

The error message “Access denied for user ‘root’@‘localhost’” indicates that the MySQL root user does not have the necessary permissions to create a new database.

Instead of using the root user, you can create a new MySQL user with the necessary permissions to create a new database and then use that user to create the new site.

To create a new MySQL user, follow these steps:

  1. Log in to MySQL as the root user:

    sudo mysql -u root -p
    
  2. Create a new user:

    CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
    

Replace newuser with the desired username and password with the desired password.

  1. Grant the new user the necessary permissions:

    GRANT ALL PRIVILEGES ON *.* TO 'newuser'@'localhost';
    
  2. Flush the privileges:

    FLUSH PRIVILEGES;
    
  3. Exit MySQL:

    exit
    
  4. Now, create the new site using the newly created MySQL user:

    bench new-site turiya_tree.com --mariadb-root-username=newuser --mariadb-root-password=password
    

Replace newuser and password with the username and password you created in step 2.

After creating the new site, you can check if it was created properly by navigating to the sites folder and verifying that a folder with the name of your site (in this case, turiya_tree.com) was created.

Hope this will help you out.

Thank you.

frappe-bench bench new-site turiyatree.com --mariadb-root-username=ramki --mariadb-root-password=marir5
Site turiyatree.com already exists
➜ frappe-bench bench new-site turiya.com --mariadb-root-username=ramki --mariadb-root-password=marir5
Traceback (most recent call last):
File “/usr/lib/python3.10/runpy.py”, line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File “/usr/lib/python3.10/runpy.py”, line 86, in _run_code
exec(code, run_globals)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 104, in
main()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 19, in main
click.Group(commands=commands)(prog_name=“bench”)
File “/home/ubuntu/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 1130, in call
return self.main(*args, **kwargs)
File “/home/ubuntu/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 1055, in main
rv = self.invoke(ctx)
File “/home/ubuntu/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/ubuntu/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/ubuntu/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/ubuntu/frappe-bench/env/lib/python3.10/site-packages/click/core.py”, line 760, in invoke
return __callback(*args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/commands/site.py”, line 77, in new_site
_new_site(
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/installer.py”, line 80, in _new_site
install_db(
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/installer.py”, line 155, in install_db
setup_database(force, source_sql, verbose, no_mariadb_socket)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/database/init.py”, line 20, in setup_database
return frappe.database.mariadb.setup_db.setup_database(
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/database/mariadb/setup_db.py”, line 50, in setup_database
dbman.grant_all_privileges(db_name, db_name, *dbman_kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/database/db_manager.py”, line 43, in grant_all_privileges
self.db.sql(f"GRANT {permissions} ON {target}.
TO ‘{user}’@‘{host}’")
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/database/database.py”, line 222, in sql
self._cursor.execute(query, values)
File “/home/ubuntu/frappe-bench/env/lib/python3.10/site-packages/pymysql/cursors.py”, line 148, in execute
result = self._query(query)
File “/home/ubuntu/frappe-bench/env/lib/python3.10/site-packages/pymysql/cursors.py”, line 310, in _query
conn.query(q)
File “/home/ubuntu/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py”, line 548, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File “/home/ubuntu/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py”, line 775, in _read_query_result
result.read()
File “/home/ubuntu/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py”, line 1156, in read
first_packet = self.connection._read_packet()
File “/home/ubuntu/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py”, line 725, in _read_packet
packet.raise_for_error()
File “/home/ubuntu/frappe-bench/env/lib/python3.10/site-packages/pymysql/protocol.py”, line 221, in raise_for_error
err.raise_mysql_exception(self._data)
File “/home/ubuntu/frappe-bench/env/lib/python3.10/site-packages/pymysql/err.py”, line 143, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.OperationalError: (1044, “Access denied for user ‘ramki’@‘localhost’ to database ‘_738a7c40126d20d3’”)

Still same error sir