<class '_mysql_exceptions.OperationalError'> | Python 2.7.5: /bin/python Thu Nov 21 06:49:31 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/project-web/coverhunter/cgi-bin/index.cgi in |
34 section = form.getvalue("section", "overview") |
35 print build_header(section) |
=> 36 print build_body(section) |
37 print build_footer() |
38 |
build_body = <function build_body>, section = 'news' |
/home/project-web/coverhunter/cgi-bin/builder.py in build_body(section='news') |
171 build_func = functions[section] |
172 body = body + '<div id="main">' |
=> 173 body = body + build_func() |
174 body = body + '</div>' # close the "main" div |
175 body = body + '</div>' # close the "body" div |
body = '<div id="body"><div id="lefthand">\n ...edits</a></span><br /></div></div><div id="main">', build_func = <function build_news> |
/home/project-web/coverhunter/cgi-bin/builder.py in build_news() |
74 def build_news(): |
75 import MySQLdb |
=> 76 db = MySQLdb.connect(db=dbname, host=host, user=user, passwd=passwd) |
77 cursor = db.cursor() |
78 cursor.execute("SELECT title, date, body FROM news ORDER BY date DESC") |
db undefined, MySQLdb = <module 'MySQLdb' from '/usr/lib64/python2.7/site-packages/MySQLdb/__init__.pyc'>, MySQLdb.connect = <function Connect>, global dbname = 'coverhunter', global host = 'mysql', global user = 'coverhunter', global passwd = 'gui1979' |
/usr/lib64/python2.7/site-packages/MySQLdb/__init__.py in Connect(*args=(), **kwargs={'db': 'coverhunter', 'host': 'mysql', 'passwd': 'gui1979', 'user': 'coverhunter'}) |
79 """Factory function for connections.Connection.""" |
80 from MySQLdb.connections import Connection |
=> 81 return Connection(*args, **kwargs) |
82 |
83 connect = Connection = Connect |
Connection = <class 'MySQLdb.connections.Connection'>, args = (), kwargs = {'db': 'coverhunter', 'host': 'mysql', 'passwd': 'gui1979', 'user': 'coverhunter'} |
/usr/lib64/python2.7/site-packages/MySQLdb/connections.py in __init__(self=<_mysql.connection closed at 24083a0>, *args=(), **kwargs={'db': 'coverhunter', 'host': 'mysql', 'passwd': 'gui1979', 'user': 'coverhunter'}) |
191 autocommit = kwargs2.pop('autocommit', False) |
192 |
=> 193 super(Connection, self).__init__(*args, **kwargs2) |
194 self.cursorclass = cursorclass |
195 self.encoders = dict([ (k, v) for k, v in conv.items() |
builtin super = <type 'super'>, global Connection = <class 'MySQLdb.connections.Connection'>, self = <_mysql.connection closed at 24083a0>, ).__init__ = <bound method Connection.__init__ of <_mysql.connection closed at 24083a0>>, args = (), kwargs2 = {'client_flag': 196608, 'conv': {0: <class 'decimal.Decimal'>, 1: <type 'int'>, 2: <type 'int'>, 3: <type 'long'>, 4: <type 'float'>, 5: <type 'float'>, 7: <function mysql_timestamp_converter>, 8: <type 'long'>, 9: <type 'int'>, 10: <function Date_or_None>, ...}, 'db': 'coverhunter', 'host': 'mysql', 'passwd': 'gui1979', 'user': 'coverhunter'} |
<class '_mysql_exceptions.OperationalError'>: (2003, "Can't connect to MySQL server on 'mysql' (101)")
args =
(2003, "Can't connect to MySQL server on 'mysql' (101)")
message =
''