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_exceptio ns.InternalErro r: (-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@goingt o 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='localhos t',user='gbd',p asswd='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(Connectio n, args, kwargs)
File "/usr/local/lib/python2.3/site-packages/MySQLdb/connections.py" ,
line 116, in __init__
self._make_conn ection(args, kwargs2)
File "/usr/local/lib/python2.3/site-packages/MySQLdb/connections.py" ,
line 41, in _make_connectio n
apply(super(Con nectionBase, self).__init__, args, kwargs)
_mysql_exceptio ns.InternalErro r: (-1, 'server not initialized')
[baggott2@goingt o 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@goingt o baggott2]$ 2 2546
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_exceptio ns.InternalErro r: (-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:
OperationalErro r: (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
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_exceptio ns.InternalErro r: (-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@goingt o 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='localhos t',user='gbd',p asswd='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(Connectio n, args, kwargs) File "/usr/local/lib/python2.3/site-packages/MySQLdb/connections.py" , line 116, in __init__ self._make_conn ection(args, kwargs2) File "/usr/local/lib/python2.3/site-packages/MySQLdb/connections.py" , line 41, in _make_connectio n apply(super(Con nectionBase, self).__init__, args, kwargs) _mysql_exceptio ns.InternalErro r: (-1, 'server not initialized') [baggott2@goingt o 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@goingt o baggott2]$
Daniel,
I have these two additional args in my connect call:
port=3306,unix_ socket="/tmp/mysql.sock"
wes This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 "conflicting header files," but I don't
know what to do about conflicting header files, or where I would find
them, and once I found them, which ones to remove.
I have compiled MySQL 4.1 and installed into /usr/local/mysql, but
since have moved to a Fink...
|
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 password - how do I get
a meaningful error message which I can present to my user?
|
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 works as expected. But
>>> numb=10
>>> cursor.execute("SELECT * FROM mytest where clientID = %d",numb)
Traceback (innermost last):
File "<stdin>", line 1, in ?
|
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 be kept in the db from now on
problem:
|
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 -------------------------------
#!/usr/bin/python
import MySQLdb
db = MySQLdb.connect(host="localhost", user="root", passwd="mypass",
db="my_db")
cursor = db.cursor()
| |
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 the error
"""
import MySQLdb
|
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 apple-darwin8.2.0 (powerpc) using
readline 4.3
runing the software gives me
steve:~/MySQL-python-1.2.0 steve$ python setup.py build
|
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.
Here is a sample error:
>>> c=MySQLdb.Connect(host='localhost',user='root',passwd='',db='shop',port=3306)
Traceback (most recent call last):
|
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 build
running build_py
creating build
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |