Forums

Can't connect to mysql

Hello, I have this error and I searched google and tried all suggestions but not working for me. whenever I try to connect MySQL on paythonanywhere.com I get this error "(2002, "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2" please any one has a solution for me? I can't install MySQL cause I get permission denied message.

This help page has the details. The most important bit -- you need to specify the MySQL server host in your connection parameters. The hostname is on the "Databases" tab.

Thanks for your reply problem already been solved. and your are right the problem was HOST parameter. thanks anyhow

:)

<class 'RuntimeError'> Failure to connect, tried 5 times: Traceback (most recent call last): File "/home/fernandocad/suporte/gluon/packages/dal/pydal/base.py", line 455, in init self._adapter = adapter(kwargs) File "/home/fernandocad/suporte/gluon/packages/dal/pydal/adapters/init.py", line 40, in call obj = super(AdapterMeta, cls).call(*args, kwargs) File "/home/fernandocad/suporte/gluon/packages/dal/pydal/adapters/base.py", line 369, in init super(SQLAdapter, self).init(args, kwargs) File "/home/fernandocad/suporte/gluon/packages/dal/pydal/adapters/base.py", line 53, in init self.reconnect() File "/home/fernandocad/suporte/gluon/packages/dal/pydal/connection.py", line 152, in reconnect self.connection = self.connector() File "/home/fernandocad/suporte/gluon/packages/dal/pydal/adapters/mysql.py", line 52, in connector return self.driver.connect(self.driver_args) File "/usr/lib/python3.5/site-packages/MySQLdb/init.py", line 85, in Connect return Connection(args, kwargs) File "/usr/lib/python3.5/site-packages/MySQLdb/connections.py", line 204, in init super(Connection, self).init(*args, kwargs2) _mysql_exceptions.OperationalError: (1045, "Access denied for user 'fernandocad'@'10.0.0.73' (using password: YES)")

Are you sure that you're using the right database name and password? The password should match the one in the file .my.cnf in your home directory, and the database name should be something like fernandocad$yourdbname.