Cannot run a single MySQLdb execute....

  • Thread starter Íßêïò Ãêñ33ê
  • Start date
Í

Íßêïò Ãêñ33ê

Ôç ÐÝìðôç, 28 Ìáñôßïõ 2013 4:51:16 ì.ì. UTC+2, ï ÷ñÞóôçò David M Chess Ýãñáøå:
Íßêïò Ãêñ33ê <[email protected]>
:







For instance:




'format'


(e-mail address removed) [~]# /usr/bin/python3
Python 3.2.3 (default, May 23 2012, 18:47:48)
[GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 
A

Alan Meyer

I'am about to go nuts with python 3.2.3

Do you see somehtign wrong with the following statement?

cur.execute( '''SELECT hits FROM counters WHERE url = ?''', (page,) )
data = cur.fetchone()

because as you can see by visiting my webpage at http://superhost.gr it produces an error and i dont have aclue why.

Please help. i'am using MySQLdb
Nikos,

When I try to connect to that web page I see the following error message:

"ImportError: No module named pymysql "

If that's what you're getting, there's nothing wrong with your SQL or
your cur.execute statement. The problem is that the web server is not
finding the pymysql module.

Is pymysql installed on the computer that is running your application?
Can the web server module find it?

I must be missing something because, if that's the problem, your object
named "cur" could not have been created successfully. Maybe what I'm
seeing is a new problem?

Alan
 
Í

Íßêïò Ãêñ33ê

Ôç ÐÝìðôç, 28 Ìáñôßïõ 2013 10:54:55 ì.ì. UTC+2, ï ÷ñÞóôçò Alan Meyer Ýãñáøå:
Nikos,



When I try to connect to that web page I see the following error message:



"ImportError: No module named pymysql "



If that's what you're getting, there's nothing wrong with your SQL or

your cur.execute statement. The problem is that the web server is not

finding the pymysql module.



Is pymysql installed on the computer that is running your application?

Can the web server module find it?



I must be missing something because, if that's the problem, your object

named "cur" could not have been created successfully. Maybe what I'm

seeing is a new problem?



Alan

Hello Ala, well nto this is not the error, i uses to had MySQLdb as a conenctor but even withat that i still see a blank webpage without no errros. Then i had a suspision that perhaps MySQLdb isnt't supported in Python 3.2.3 so i decided to try pymysql but it wasnt there.

I asked at hstgator support to install that module for me since iam not familiar with linux very much or pip but i got this response just now.


Click here to rate this response.
Hello again,

Per your request, a virtual environment has been created for you. You canfind local Python binaries in:

/home/nikos/bin

Unfortunately the pymysql module cannot be installed using pip or easy_install and must be installed manually. There is no indication that this module in any way requires Python 3. Is there a particular reason you must use Python 3 instead of a version which supports the modules that you need? Given that the modules you need are better supported by earlier versions of Python, it's not clear to me why we're trying to use Python 3 instead.

If you would still like us to proceed with manually installing the pymysql module for the local version of Python under the nikos account, we will be happy to give it a try but there will be a one-time charge of $35.00 for the installation. I would recommend using an earlier version of Python which is compatible with the modules that you need, but it is certainly up to you. Please let us know how you would like to proceed.

So, just to make sure that MySQLdb isnt causeing the probkem can someone, perhaps you that is familiar with linxu conenct to my jailed shell account and install manually the 'pymysql' module because i dont know how to do it and i cannot afford to pay ath linux admin because iam unemployed.

please i can providr ou with user and pass for my jailed shell access for someone ti install it manually.
 
A

Alan Meyer

On 03/29/2013 03:40 AM, Íßêïò Ãêñ33ê wrote:
....
So, just to make sure that MySQLdb isnt causeing the probkem can
someone, perhaps you that is familiar with linxu conenct to my jailed
shell account and install manually the 'pymysql' module because i
dont know how to do it and i cannot afford to pay ath linux admin
because iam unemployed.

please i can providr ou with user and pass for my jailed shell access
for someone ti install it manually.

Sorry Nikos, I don't have time to do anything like that. I'm going nuts
with my own programming problems and deadlines.

However, MySQLdb is a well established module and what you're asking it
to do is very simple and very standard.

I can think of several obvious possibilities for you to pursue.

The first one is, are you successfully connecting to the database at
all? I suspect that you are not. You may have an error in your
connection string - the host, userid, port number, database name, or
password. That's the most likely problem.

See if you can find some other program on your server that does
successfully connect and look at the connection parameters. Be sure
that you're checking the return value from your connect() call.

If everything looks good, check to see if you have rights to the
database and table you are trying to select from.

Good luck.

Alan
 
A

Alan Meyer

However, MySQLdb is a well established module and what you're asking it
to do is very simple and very standard.

Oh, sorry, I see that you already said that mysqldb won't work with
python 3. My comments in the last message are irrelevant.

Sorry again.

Good luck.

Alan
 
N

nagia.retsina

Τη ΠαÏασκευή, 29 ΜαÏτίου 2013 7:39:20 μ.μ. UTC+2, ο χÏήστης Alan Meyer έγÏαψε:
Oh, sorry, I see that you already said that mysqldb won't work with

python 3. My comments in the last message are irrelevant.



Sorry again.



Good luck.



Alan

Thanks Alan i decided to work with 'pymysql' and iam struggling to egt thbis working but i still receive the same blank page for some unknown reason......
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top