First time here? Check out the FAQ!
1

django cannot create test database

I created a django project and a testCase with setUpTestData containing several objects.create. when I debug the test , I get the following error : I get the following error : Got an error creating the test database: (1044, "Access denied for user 'odile'@'localhost' to database 'test_recettes_database'")

I am using mySQL and my django settings module is using a .env file in my virtual environment. Any help will be welcomed

piscvau's avatar
486
piscvau
asked 2021-09-07 15:07:33 -0600
edit flag offensive 0 remove flag close merge delete

Comments

It seems it is due to mysql on Ubuntu which does not allow the creation of the database unless the user is connected as sudo. It seems therefore that Wing has nothing to do with it. I need to create the database outside and tell django test to load the database with my test data. But how can I do this?

piscvau's avatar piscvau (2021-09-08 03:03:50 -0600) edit
add a comment see more comments

1 Answer

1

problem solved. It comes from mysql8 which uses plugin caching_sha2_password . So changing in mysql the plugin to mysql_native_password solves the problem

piscvau's avatar
486
piscvau
answered 2021-09-08 05:44:50 -0600
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer