python - sqlalchemy: connect to MySQL without password -
i have mysql base "test" no password on root. can log in there
mysql -uroot test # fine
i want access sqlalchemy
. try urls:
mysql+mysqldb://root@localhost/test mysql+mysqldb://root:@localhost/test
but both of them fail error:
sqlalchemy.exc.operationalerror: (operationalerror) (1045, "access denied user 'root'@'localhost' (using password: no)") none none
how should access base without password?
edit
i tried also:
mysql://root@/test mysql+mysqldb://root@/test
with local dummy account with password, works without problems.
the equivalent sqlalchemy url have on command line is
mysql://root@/test
mysql consideres root user connecting on standard unix socket (no -h
in command line client) different user same username connecting via tcp
Comments
Post a Comment