By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,156 Members | 1,027 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,156 IT Pros & Developers. It's quick & easy.

MySQLdb 'server not initialized'

P: n/a
Hi,

I'm seeking assistance in troubleshooting connecting to MySQL (4.0.20)
using Python (2.3.4) and MySQLdb (1.0.0). When I attempt to make a
connection, I get the following exception:
_mysql_exceptions.InternalError: (-1, 'server not initialized')

The database is definitely running as I can connect to it using the
mysql client. Also, when I attempt to connect to MySQL from within
Python, I don't see any messages in the MySQL logs (ie the .log and .err
files in /usr/local/mysql/data/).

Does anyone have any advice or suggestions as to how to figure out
what's going wrong? Also, if there's a better forum for posting this
question, please point me in the right direction.

Thanks!

Dan
[baggott2@goingto baggott2]$ python
Python 2.3.4 (#1, Jul 26 2004, 15:14:49)
[GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-34)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import MySQLdb
c = MySQLdb.connect(host='localhost',user='gbd',passwd ='xxxxxxx',db='zinc')
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/local/lib/python2.3/site-packages/MySQLdb/__init__.py",
line 64, in Connect
return apply(Connection, args, kwargs)
File "/usr/local/lib/python2.3/site-packages/MySQLdb/connections.py",
line 116, in __init__
self._make_connection(args, kwargs2)
File "/usr/local/lib/python2.3/site-packages/MySQLdb/connections.py",
line 41, in _make_connection
apply(super(ConnectionBase, self).__init__, args, kwargs)
_mysql_exceptions.InternalError: (-1, 'server not initialized')

[baggott2@goingto baggott2]$ mysql -h localhost -u gbd -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9 to server version: 4.0.20-standard-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show databases;
+----------+
| Database |
+----------+
| zinc |
+----------+
1 row in set (0.00 sec)

mysql> Bye
[baggott2@goingto baggott2]$
Jul 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Daniel Baggott schrieb:
Hi,

I'm seeking assistance in troubleshooting connecting to MySQL (4.0.20)
using Python (2.3.4) and MySQLdb (1.0.0). When I attempt to make a
connection, I get the following exception:
_mysql_exceptions.InternalError: (-1, 'server not initialized')

The database is definitely running as I can connect to it using the
mysql client. Also, when I attempt to connect to MySQL from within
Python, I don't see any messages in the MySQL logs (ie the .log and .err
files in /usr/local/mysql/data/).
If the server isn't running you'd get another exception anyway:

OperationalError: (2003, "Can't connect to MySQL server on 'localhost'
(10061)")

I tried on Windows, but I can't think there's a difference at this point.

What happens if you try the same thing with user "root" and his password
- just for diagnostic purposes?
Does anyone have any advice or suggestions as to how to figure out
what's going wrong? Also, if there's a better forum for posting this
question, please point me in the right direction.


There is a help forum for MySQLdb on SourceForge:

http://sourceforge.net/forum/forum.php?forum_id=70461

But it doesn't look very active to me, at least at the moment. So I
wouldn't call it better, just another possibility.

Regards,
Koczian
Jul 18 '05 #2

P: n/a
Daniel Baggott wrote:
Hi,

I'm seeking assistance in troubleshooting connecting to MySQL (4.0.20)
using Python (2.3.4) and MySQLdb (1.0.0). When I attempt to make a
connection, I get the following exception:
_mysql_exceptions.InternalError: (-1, 'server not initialized')

The database is definitely running as I can connect to it using the
mysql client. Also, when I attempt to connect to MySQL from within
Python, I don't see any messages in the MySQL logs (ie the .log and .err
files in /usr/local/mysql/data/).

Does anyone have any advice or suggestions as to how to figure out
what's going wrong? Also, if there's a better forum for posting this
question, please point me in the right direction.

Thanks!

Dan
[baggott2@goingto baggott2]$ python
Python 2.3.4 (#1, Jul 26 2004, 15:14:49)
[GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-34)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import MySQLdb
c =


MySQLdb.connect(host='localhost',user='gbd',passwd ='xxxxxxx',db='zinc')
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/local/lib/python2.3/site-packages/MySQLdb/__init__.py",
line 64, in Connect
return apply(Connection, args, kwargs)
File "/usr/local/lib/python2.3/site-packages/MySQLdb/connections.py",
line 116, in __init__
self._make_connection(args, kwargs2)
File "/usr/local/lib/python2.3/site-packages/MySQLdb/connections.py",
line 41, in _make_connection
apply(super(ConnectionBase, self).__init__, args, kwargs)
_mysql_exceptions.InternalError: (-1, 'server not initialized')

[baggott2@goingto baggott2]$ mysql -h localhost -u gbd -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9 to server version: 4.0.20-standard-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show databases;
+----------+
| Database |
+----------+
| zinc |
+----------+
1 row in set (0.00 sec)

mysql> Bye
[baggott2@goingto baggott2]$

Daniel,
I have these two additional args in my connect call:
port=3306,unix_socket="/tmp/mysql.sock"
wes

Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.