Forums

SQL Error: 1044 - Access denied for user 'mattpythontestin'@'%' to database 'full'.

Hi all,

I'm trying to migrate my SQlite database to a MySQL db hosted in my pythonanywhere account (using MySQL Workbench) and I've successfully connected to pythonanywhere, but when trying to migrate I get multiple 1044 and 1142 errors, 'Access Denied' and 'CREATE command denied to user..'

I've been trying different solutions from here and stackoverflow over the last few days but to no avail, any help would be greatly appreciated.

A bit of the stack trace:

Starting... Connect to Target Database... Connect to Target Database done Perform Checks in Target... - Validating for existing schemas on target MySQL Server... Perform Checks in Target done Create Schemas and Objects.... - Creating schema in target MySQL server at Mysql@mattpythontesting.mysql.pythonanywhere-services.com:3306@ssh.pythonanywhere.com... - Executing preamble script... Execute statement: SET FOREIGN_KEY_CHECKS = 0 - Creating schema full... Execute statement: DROP SCHEMA IF EXISTS full WARNING: Error executing 'DROP SCHEMA IF EXISTS full ' Access denied for user 'mattpythontestin'@'%' to database 'full'. SQL Error: 1044

Matt

that's because you cannot create just any databases on mysql (your databases need to be in the mattpythontesting$xyz format, and you can manually create the mattpythontesting$full database over the PythonAnywhere interface (at the database tab), after which you can then run your migration to create tables and input the data/rows.

Full is the name of the SQlite db file, however I've also created the database mattpythontestin$full I'm and still receiving the same error message.

I also don't know if it matters, but my username is mattpythontesting however all my databases show as mattpythontestin$xyz (without the g).

Thanks for the help.

Your migration script is still trying to delete and create databases and it cannot. Just make the script use the database that you've already created (mattpythontestin$xyz ), instead of trying to create it. You should also remove the DROP SCHEMA from the script because that won't work either.

The shortening of your username in the database name is because MySQL does not support usernames that long.

I saw what you meant in the end and I did change the scripts manually, now I get passed this stage and just before reaching the actual migration I get problems about row count, but it's a different issue that I can probably fix so you could close this topic. Thanks for the help.

OK -- glad we could help.