Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #42079 > unrolled thread

Cannot run a single MySQLdb execute....

Started byΝίκος Γκρ33κ <nikos.gr33k@gmail.com>
First post2013-03-27 20:50 -0700
Last post2013-03-29 12:24 -0700
Articles 6 on this page of 26 — 5 participants

Back to article view | Back to comp.lang.python


Contents

  Cannot run  a single MySQLdb execute.... Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 20:50 -0700
    Re: Cannot run a single MySQLdb execute.... Chris Angelico <rosuav@gmail.com> - 2013-03-28 15:00 +1100
      Re: Cannot run a single MySQLdb execute.... Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 21:03 -0700
        Re: Cannot run a single MySQLdb execute.... Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 21:08 -0700
          Re: Cannot run a single MySQLdb execute.... Chris Angelico <rosuav@gmail.com> - 2013-03-28 15:14 +1100
        Re: Cannot run a single MySQLdb execute.... Chris Angelico <rosuav@gmail.com> - 2013-03-28 15:08 +1100
          Re: Cannot run a single MySQLdb execute.... Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 21:18 -0700
            Re: Cannot run a single MySQLdb execute.... Chris Angelico <rosuav@gmail.com> - 2013-03-28 15:26 +1100
              Re: Cannot run a single MySQLdb execute.... Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 21:30 -0700
                Re: Cannot run a single MySQLdb execute.... Chris Angelico <rosuav@gmail.com> - 2013-03-28 15:35 +1100
                  Re: Cannot run a single MySQLdb execute.... Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 21:39 -0700
                  Re: Cannot run a single MySQLdb execute.... Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 21:39 -0700
              Re: Cannot run a single MySQLdb execute.... Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 21:30 -0700
          Re: Cannot run a single MySQLdb execute.... Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 21:18 -0700
        Re: Cannot run a single MySQLdb execute.... Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 21:08 -0700
          Re: Cannot run a single MySQLdb execute.... Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-28 02:44 -0700
          Re: Cannot run a single MySQLdb execute.... Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-28 02:44 -0700
        Re: Cannot run a single MySQLdb execute.... David M Chess <chess@us.ibm.com> - 2013-03-28 10:51 -0400
          Re: Cannot run a single MySQLdb execute.... Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-28 12:35 -0700
          Re: Cannot run a single MySQLdb execute.... Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-28 12:35 -0700
      Re: Cannot run a single MySQLdb execute.... Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-27 21:03 -0700
    Re: Cannot run  a single MySQLdb execute.... Alan Meyer <ameyer2@yahoo.com> - 2013-03-28 16:54 -0400
      Re: Cannot run  a single MySQLdb execute.... Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-29 00:40 -0700
        Re: Cannot run  a single MySQLdb execute.... Alan Meyer <ameyer2@yahoo.com> - 2013-03-29 13:32 -0400
          Re: Cannot run  a single MySQLdb execute.... Alan Meyer <ameyer2@yahoo.com> - 2013-03-29 13:39 -0400
            Re: Cannot run  a single MySQLdb execute.... nagia.retsina@gmail.com - 2013-03-29 12:24 -0700

Page 2 of 2 — ← Prev page 1 [2]


#42087 — Re: Cannot run a single MySQLdb execute....

FromΝίκος Γκρ33κ <nikos.gr33k@gmail.com>
Date2013-03-27 21:03 -0700
SubjectRe: Cannot run a single MySQLdb execute....
Message-ID<mailman.3851.1364443987.2939.python-list@python.org>
In reply to#42083
Τη Πέμπτη, 28 Μαρτίου 2013 6:00:17 π.μ. UTC+2, ο χρήστης Chris Angelico έγραψε:

> What paramstyle are you using?

Yes it is Chris, but i'am not sure what exactly are you asking me.
Please if you cna pout it even simper for me, thank you.

[toc] | [prev] | [next] | [standalone]


#42192

FromAlan Meyer <ameyer2@yahoo.com>
Date2013-03-28 16:54 -0400
Message-ID<5154AE1F.6010309@yahoo.com>
In reply to#42079
On 3/27/2013 11:50 PM, Νίκος Γκρ33κ wrote:
> 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

[toc] | [prev] | [next] | [standalone]


#42230

FromΝίκος Γκρ33κ <nikos.gr33k@gmail.com>
Date2013-03-29 00:40 -0700
Message-ID<fdce4d6f-748d-4a55-8614-9c1bc8f46d95@googlegroups.com>
In reply to#42192
Τη Πέμπτη, 28 Μαρτίου 2013 10:54:55 μ.μ. UTC+2, ο χρήστης Alan Meyer έγραψε:
> On 3/27/2013 11:50 PM, Νίκος Γκρ33κ wrote:
> 
> > 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

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 can find 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.

[toc] | [prev] | [next] | [standalone]


#42256

FromAlan Meyer <ameyer2@yahoo.com>
Date2013-03-29 13:32 -0400
Message-ID<kj4j3p$hh8$1@dont-email.me>
In reply to#42230
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

[toc] | [prev] | [next] | [standalone]


#42258

FromAlan Meyer <ameyer2@yahoo.com>
Date2013-03-29 13:39 -0400
Message-ID<kj4jg3$jhv$1@dont-email.me>
In reply to#42256
On 03/29/2013 01:32 PM, Alan Meyer wrote:

> 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

[toc] | [prev] | [next] | [standalone]


#42268

Fromnagia.retsina@gmail.com
Date2013-03-29 12:24 -0700
Message-ID<3d78c1da-a0a5-4e5a-8fa3-d76966eea5f4@googlegroups.com>
In reply to#42258
Τη Παρασκευή, 29 Μαρτίου 2013 7:39:20 μ.μ. UTC+2, ο χρήστης Alan Meyer έγραψε:
> On 03/29/2013 01:32 PM, Alan Meyer wrote:
> 
> 
> 
> > 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

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.....

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | comp.lang.python


csiph-web