472,804 Members | 810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,804 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 2466
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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.