DatabaseError | Python 3.8.10: /usr/bin/python3 Tue Apr 23 14:02:03 2024 |
A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.
/home/cryan/secure_html/daily/blogpost.py in <module> |
102 return content,promo,maincategory,headerimage,row[1],weburl,blogcat,blogid; |
103 |
=> 104 myConnection = mysql.connector.connect( host=hostname, user=username, passwd=password, db=database ) |
105 content,promo,maincategory,headerimage,mytitle,weburl,blogcat,blogid = doQuery( myConnection ) |
106 myConnection.close() |
myConnection undefined, mysql = <module 'mysql' from '/home/cryan/.local/lib/python3.8/site-packages/mysql/__init__.py'>, mysql.connector = <module 'mysql.connector' from '/home/cryan/.loc...on3.8/site-packages/mysql/connector/__init__.py'>, mysql.connector.connect = <function connect>, host undefined, hostname = 'localhost', user undefined, username = 'cryan', passwd undefined, password = 'kbf2wdw', db undefined, database = 'cryan' |
/home/cryan/.local/lib/python3.8/site-packages/mysql/connector/pooling.py in connect(*args=(), **kwargs={'db': 'cryan', 'host': 'localhost', 'passwd': 'kbf2wdw', 'user': 'cryan'}) |
291 |
292 if CMySQLConnection and not use_pure: |
=> 293 return CMySQLConnection(*args, **kwargs) |
294 return MySQLConnection(*args, **kwargs) |
295 |
global CMySQLConnection = <class 'mysql.connector.connection_cext.CMySQLConnection'>, args = (), kwargs = {'db': 'cryan', 'host': 'localhost', 'passwd': 'kbf2wdw', 'user': 'cryan'} |
/home/cryan/.local/lib/python3.8/site-packages/mysql/connector/connection_cext.py in __init__(self=<mysql.connector.connection_cext.CMySQLConnection object>, **kwargs={'db': 'cryan', 'host': 'localhost', 'passwd': 'kbf2wdw', 'user': 'cryan'}) |
118 |
119 if kwargs: |
=> 120 self.connect(**kwargs) |
121 |
122 def _add_default_conn_attrs(self) -> None: |
self = <mysql.connector.connection_cext.CMySQLConnection object>, self.connect = <bound method MySQLConnectionAbstract.connect of...nnector.connection_cext.CMySQLConnection object>>, kwargs = {'db': 'cryan', 'host': 'localhost', 'passwd': 'kbf2wdw', 'user': 'cryan'} |
/home/cryan/.local/lib/python3.8/site-packages/mysql/connector/abstracts.py in connect(self=<mysql.connector.connection_cext.CMySQLConnection object>, **kwargs={'db': 'cryan', 'host': 'localhost', 'passwd': 'kbf2wdw', 'user': 'cryan'}) |
1179 |
1180 self.disconnect() |
=> 1181 self._open_connection() |
1182 # Server does not allow to run any other statement different from ALTER |
1183 # when user's password has been expired. |
self = <mysql.connector.connection_cext.CMySQLConnection object>, self._open_connection = <bound method CMySQLConnection._open_connection ...nnector.connection_cext.CMySQLConnection object>> |
/home/cryan/.local/lib/python3.8/site-packages/mysql/connector/connection_cext.py in _open_connection(self=<mysql.connector.connection_cext.CMySQLConnection object>) |
294 self.converter.str_fallback = self._converter_str_fallback |
295 except MySQLInterfaceError as err: |
=> 296 raise get_mysql_exception( |
=> 297 msg=err.msg, errno=err.errno, sqlstate=err.sqlstate |
=> 298 ) from err |
global get_mysql_exception = <function get_mysql_exception>, msg undefined, err undefined, errno undefined, sqlstate undefined |
DatabaseError: 2003 (HY000): Can't connect to MySQL server on 'localhost:3306' (111)
args =
(2003, "2003 (HY000): Can't connect to MySQL server on 'localhost:3306' (111)", 'HY000')
errno =
2003
msg =
"Can't connect to MySQL server on 'localhost:3306' (111)"
sqlstate =
'HY000'
with_traceback =
<built-in method with_traceback of DatabaseError object>