Problem with library.test and mysql (access denied)

Hello. I am having difficulties with the first library.test project shortly after installing ERPNext.

After creating the library.test site I try bench start and to access the test website through the browser. but get the following message:

OperationalError pymysql.err.OperationalError: (1045, “Access denied for user (…) (using password: YES)”)

Why does the user that was created alongside library.test not get access? Is he not using the proper password? Any ideas what I can do? Thanks

The error message OperationalError pymysql.err.OperationalError: (1045, “Access denied for user (…) (using password: YES)”) indicates that you are trying to connect to a MySQL database with an incorrect username or password. The 1045 error code specifically means that the database server denied your request because the username and password combination you provided did not match a valid user account.

Thanks for the reply. I am new to both Frappe and Linux, but I did figure out that it’s an issue with user privileges. I find it a bit mysterious though, seeing as both the database and the user seem to be generated by bench? They only exist in the database after I run bench new-site library.test, as per the instructions. The tutorial also does not specify any need to grant permissions to a new user that is created during the process. So far I haven’t been able to solve the problem.

What linux distro are you testing on?

Hi

I am able to replicate this issue.
I have found this issue on EL9 distributions when using MariaDB Connector.
After pinning down the issue to the MariaDB Connector, and after overcoming the issue, I found that PyMySQL used by frappe is throwing the same error.

pymysql.err.OperationalError: (1045, "Access denied for user 'root'@'10.0.0.1' (using password: YES)")

Long story made short, and in the end I’ll add some links:

Installed new RockyLinux9 machine, compiled and installed python3.11 from the sources, installed everything including mariadb-connector-c, installed bench, creating new site fails with said error.
Created a shell script to test the connection to the MariaDB Server. Script always connects successfully.
Created a python script for the same purpose: fails.
(importing mariadb on the script not pymysql)

Installed MariaDB connector C 3.2.6 from Repo. Installed MariaDB python connector v1.0.11 fails
compiled from source connector 3.3.10 and mariadb python connector 1.1.10: fails
Another machine with AlmaLinux 9 instead of going for Python from sources I tried with Python3.9 from the OS.
Installed pip and the MariaDB Connector 3.2.6 fails
connector 3.3.10 fails.

By then I was only testing my script. Shell script always succeeds, Python always fails with this same error.

I have tried installing Python3.11 from the sources Python3.11 from the repos, and Python3.9 from the repos. Connecting via Python always fails.

Another test, I did another AL9 vm installed Python3.11 from the repos BUT instead of installing anything MariaDB I installed mysql client and libraries. I also installed mysql-connector-python instead of MariaDB.

Result:
Test script connects to DB successfully.

Testing with Frappe Framework on this very same environment:
PyMySQL fails. Python script which imports mysql.connector works correctly.

Topics I’ve created while following this problem:
Frappe Forums - bench: new installation & database issues
Python Forums - Issue with python3.11 connector on EL9