473,326 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

MySQLdb 'server not initialized'

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
2 2503
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Peter Nikolaidis | last post by:
Greetings, I am attempting to get MySQLdb 0.9.2 installed on Mac OS 10.2 with a Fink distribution of Python 2.2.2. I have seen only a few posts on the subject, some of them relate to...
1
by: Derek Fountain | last post by:
I was trying to use MySQLdb to connect to a database. All is OK, except I can't figure out how to get the details of an error. Suppose I try to connect to a non existant server, or with the wrong...
21
by: John Fabiani | last post by:
Hi, I'm a newbie and I'm attempting to learn howto create a select statement. When I use >>> string1='18 Tadlock Place' >>> cursor.execute("SELECT * FROM mytest where address = %s",string1) All...
2
by: m0226065 | last post by:
Ok so I have a mySQL server and mySQLdb as an interface (do I us this term correct here?) to this server from python now I have a game: I want to read a file into the db I want other data to...
2
by: ws Wang | last post by:
MySQLdb is working fine at command line, however when I tried to use it with mod_python, it give me a "server not initialized" error. This is working fine: ----------------------- testmy.py...
4
by: fedor | last post by:
Hi all, I have a problem with mysql connections. After about 28000-29000 connections, I get a "Can't connect to MySQL server on '127.0.0.1'" error. I have made a small program which generates...
1
by: Steve | last post by:
Darwin steve.local 8.3.0 Darwin Kernel Version 8.3.0: Mon Oct 3 20:04:04 PDT 2005; root:xnu-792.6.22.obj~2/RELEASE_PPC Power Macintosh powerpc MacOSX 10.4.3 mysql Ver 14.7 Distrib 4.1.14, for...
2
by: Mondal | last post by:
Hi, I am using MySQL 5.0 beta and Active Python 2.4. I have the correct version of MySQLdb installed. The problem is that I can't connect to MySQL through the Active Python interactive window. ...
1
by: Yi Xing | last post by:
Hi, I met the following error when I tried to install MySQLdb. I had no problem installing numarray, Numeric, Rpy, etc. Does anyone know what's the problem? Thanks! running install running...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.