简体   繁体   中英

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

Have attempted several tutorials but encounter error after error.

Are you sure that you have permission to connect to your database using root from 172.18.0.1?

Try running SHOW GRANTS on your database to see if you have the correct permissions set at a database level:

SHOW GRANTS FOR 'root';

You may also want to double check the .env file in the root of your Masonite directory. This is where your environment is defined. config/database.py uses the environmental variables you define in .env to configure access to your database (below is the default sqlite configuration).

DB_CONNECTION=sqlite
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=masonite
DB_USERNAME=root
DB_PASSWORD=root
DB_LOG=True

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM