pymysql.err.OperationalError: (1698, "Access denied for user 'root'@'localhost'")

when i try to create new site using bench new-site library.test i get this error i have tried many things but nothing works well please anyone do reply

raise errorclass(errno, errval)
pymysql.err.OperationalError: (1698, “Access denied for user ‘root’@‘localhost’”)

Looks like you have not setup your MariaDB properly
installation guide :follow the steps

When asking for root password after running command
sudo mysql_secure_installation

put your root password and the when asked to change password in the next step either put your root password again or setup a different password for your mysql server

1 Like

ERROR 1290 (HY000) at line 1: The MariaDB server is running with the --skip-grant-tables option so it cannot execute this statement
it says like this

mysql -u root -p
FLUSH PRIVILEGES;

try this

yea it worked but still the above problem hasnt been solved they ask for “MySQL root password :” and what should i give,the root password that i have set during mysql_secure_installation?

it now shows
Warning: MariaDB version [‘10.11’, ‘2’] is more than 10.8 which is not yet tested with Frappe Framework.
For key character_set_server. Expected value utf8mb4, found value latin1
For key collation_server. Expected value utf8mb4_unicode_ci, found value latin1_swedish_ci

Creation of your site - library.test failed because MariaDB is not properly
configured.

Please verify the above settings in MariaDB’s my.cnf. Restart MariaDB.
And then run bench new-site library.test again.

Database settings do not match expected values; stopping database setup.

this error

Hi @nived_s ,

To grant privileges to the ‘root’ user, you can use the following MySQL command:

GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY 'your_password' WITH GRANT OPTION;

Then, for your last error message you need to update the my.cnf file:

[mysqld]
character-set-server=utf8mb4
collation-server=utf8mb4_unicode_ci

Hope this will help you out

Thank you.

1 Like

where to find my.cnf file im a newbie i dint know much sorry

Hi,

The location of the my.cnf file depends on your operating system and the way MariaDB was installed.
common locations Linux: /etc/mysql/my.cnf, /etc/my.cnf, or /usr/local/etc/my.cnf

Hope this will help you out

Thank you.

1 Like

but when i open this file by sudo nano command it seems to be empty …

You can try creating a new my.cnf file in the appropriate directory (as I mentioned in my previous message) and add the necessary configuration settings for character set and collation.

Here is an example of how to create a new my.cnf file and set the character set and collation:

sudo nano /etc/mysql/my.cnf

Then add the following lines to the file:

[mysqld]
character-set-server=utf8mb4
collation-server=utf8mb4_unicode_ci

Save the file and exit the editor. Then restart MariaDB and try running the bench new-site command again, but once you need to verify that on the begin of the stage where you have installed the DB.

Hope this will help you out

Thank you.

it is showing the same error pymysql.err.OperationalError: (1698, "Access denied for user 'root'@'localhost'") - #7 by nived_s

This implies that you are running mysql in debug/recovery mode. Once you have changed/set the password for the root access, you need to restart mysql in “normal” mode so that the changes can take effect.
Once it is running, you will need to go into mysql using the password that you have set for the root user
mysql -u root -p
will prompt for the password. Once inside mysql, you need to run the commands that VINOTH mentioned above

and then you can try the bench command again