Page MenuHomePhabricator

mlWikidbupdate using improper credentials to connect to databases
Closed, ResolvedPublic


I have created a tool named mlWikidbupdate. When running the command


following error was generated:

  File "", line 88, in <module>
    conn = pymysql.connect(,db=settings.dbname,read_default_file='~/.my.cnf',charset='utf8mb4',)
  File "/mnt/nfs/labstore-secondary-tools-project/mlwikidbupdate/venv/local/lib/python2.7/site-packages/pymysql/", line 94, in Connect
    return Connection(*args, **kwargs)
  File "/mnt/nfs/labstore-secondary-tools-project/mlwikidbupdate/venv/local/lib/python2.7/site-packages/pymysql/", line 325, in __init__
  File "/mnt/nfs/labstore-secondary-tools-project/mlwikidbupdate/venv/local/lib/python2.7/site-packages/pymysql/", line 599, in connect
  File "/mnt/nfs/labstore-secondary-tools-project/mlwikidbupdate/venv/local/lib/python2.7/site-packages/pymysql/", line 861, in _request_authentication
    auth_packet = self._read_packet()
  File "/mnt/nfs/labstore-secondary-tools-project/mlwikidbupdate/venv/local/lib/python2.7/site-packages/pymysql/", line 684, in _read_packet
  File "/mnt/nfs/labstore-secondary-tools-project/mlwikidbupdate/venv/local/lib/python2.7/site-packages/pymysql/", line 220, in check_error
  File "/mnt/nfs/labstore-secondary-tools-project/mlwikidbupdate/venv/local/lib/python2.7/site-packages/pymysql/", line 109, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.OperationalError: (1045, u"Access denied for user 'tools.mlwikidbupdate'@'' (using password: NO)")

Event Timeline

Aklapper changed the task status from Open to Stalled.May 31 2020, 5:28 PM

Hi, we don't know what the tool does or where its code is. Please read and follow when creating tickets.
Also, how is this related to

I added it only due to the reason that it's related to tools

Majavah added a subscriber: Majavah.

You're using the wrong username when accessing MySQL, the correct username and password are available on a file named,cnf on your tool's home directory. See for more details.

bd808 added a subscriber: bd808.

Your trace shows this python code:
conn = pymysql.connect(,db=settings.dbname,read_default_file='~/.my.cnf',charset='utf8mb4',)

Later this error is reported:
pymysql.err.OperationalError: (1045, u"Access denied for user 'tools.mlwikidbupdate'@'' (using password: NO)")

It appears that you have manually created a $HOME/.my.cnf file and set incorrect credentials there. The tool's $HOME/ file contains the proper credentials. Please read for more information.

bd808 renamed this task from Access denied issue when running a tool to mlWikidbupdate using improper credentials to connect to databases.May 31 2020, 6:31 PM
bd808 changed the task status from Stalled to Open.Jun 1 2020, 3:38 AM
bd808 assigned this task to Adithyak1997.

Thanks a lot. I replaced

conn = pymysql.connect(,db=settings.dbname,read_default_file='~/.my.cnf',charset='utf8mb4',)


conn = pymysql.connect(,db=settings.dbname,read_default_file='~/',charset='utf8mb4',)

and it started working.