Search code examples
pythonmysqldbconnection

why we need --skip-grant-tables in mysql to remove error 1045:access denied ?what does it really do?


why we need --skip-grant-tables to remove Mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) Every where either for linux/unix or windows there is same error. can any one please explain it. And what does --skip-grant-tables really do? here is my code

import MySQLdb
db=MySQLdb.connect(host="localhost",
                   user="root",
                   passwd="********",
                   db="test")

Solution

  • There must be conflict between your mysql password and password you uses in your application. You should not use --skip-grant-tables options as it will start your server without using the privilege system. It must be dangerous for you. Any one can access your account if you will use it.