Problem using mysql library

2024-07-11 Thread Tobiah via Python-list
sinewave:toby ~(1)> python Python 2.7.18 (default, Jul 8 2024, 12:49:12) [GCC 13.2.0] on linux2 Type "help", "copyright", "credits" or "license" for more information. import MySQLdb Traceback (most recent call last): File "", line 1, in File

Re: Conecting to MySQL

2022-08-14 Thread Michael Torrie
On 8/8/22 19:26, Guilherme Campos wrote: > Hello folks, > > trying to connect to MYSQL it appears the error msg below: > InterfaceError: 2003: Can't connect to MySQL server on 'localhost:3306' > (111 Connection refused) > [image: conexao.png] > How can i fix that.? MySQL

Re: Conecting to MySQL

2022-08-09 Thread Dan Ciprus (dciprus) via Python-list
I'm not sure about this but this mailing list does not allow attachments ... On Tue, Aug 09, 2022 at 12:45:33PM -0300, Guilherme Campos wrote: Hi Igor, Accessing mysql-workbench it appeared new error messages when I clicked Server Status. I created my database on MySQL Workbench

Re: Conecting to MySQL

2022-08-09 Thread Dan Ciprus (dciprus) via Python-list
Yes, exactly that .. I replied from different account and my email was rejected. Just make sure that your mysql is actually running. Depending on your OS, run netstat -an | grep 3306 and this will tell you whether socket is actually in listening mode or not. If it's not, your mysql is either

Re: Conecting to MySQL

2022-08-09 Thread Guilherme Campos
Hi Igor, Accessing mysql-workbench it appeared new error messages when I clicked Server Status. I created my database on MySQL Workbench . Is that your question? [image: image.png] [image: image.png] Em ter., 9 de ago. de 2022 às 12:36, Igor Korot escreveu: > Hi, > @OP, > Ca

Re: Conecting to MySQL

2022-08-09 Thread Igor Korot
Hi, @OP, Can you try to connect with mysql-workbench? Also - you didn't answer my first question. Are you using an ODBC wrapper or python module? Thank you. On Tue, Aug 9, 2022 at 10:27 AM Axy wrote: > > > >> trying to connect to MYSQL it appears the error msg below: > >&

Re: Conecting to MySQL

2022-08-09 Thread Axy via Python-list
trying to connect to MYSQL it appears the error msg below: InterfaceError: 2003: Can't connect to MySQL server on 'localhost:3306' (111 Connection refused) [image: conexao.png] How can i fix that.? What do you use for connection? Does the firewall interfere with the connection? Firewall

Re: Conecting to MySQL

2022-08-09 Thread Guilherme Campos
Igor, firewall was disable... Em ter., 9 de ago. de 2022 às 11:18, Igor Korot escreveu: > Hi, > > On Tue, Aug 9, 2022 at 9:07 AM Guilherme Campos > wrote: > > > > Hello folks, > > > > trying to connect to MYSQL it appears the error msg below: > > In

Re: Conecting to MySQL

2022-08-09 Thread Igor Korot
Hi, On Tue, Aug 9, 2022 at 9:07 AM Guilherme Campos wrote: > > Hello folks, > > trying to connect to MYSQL it appears the error msg below: > InterfaceError: 2003: Can't connect to MySQL server on 'localhost:3306' > (111 Connection refused) > [image: conexao.png] > How c

Conecting to MySQL

2022-08-09 Thread Guilherme Campos
Hello folks, trying to connect to MYSQL it appears the error msg below: InterfaceError: 2003: Can't connect to MySQL server on 'localhost:3306' (111 Connection refused) [image: conexao.png] How can i fix that.? thanks in advance Guilherme Campos Belo Horizonte - MG -- https://mail.python.org

[issue39860] configparser - no support for cascading defaults (as defined by MySQL)

2022-02-09 Thread Ben Griffin
Ben Griffin added the comment: This is still being ignored. It's a bug, because it prevents the ini file from being used by other clients. -- versions: +Python 3.10, Python 3.11, Python 3.8, Python 3.9 ___ Python tracker

[issue46136] "dh low key " issue when try to connect mysql

2021-12-20 Thread Christian Heimes
Christian Heimes added the comment: DH_KEY_TOO_SMALL means that you are using weak and easy to break keys for your connections. Recent versions of OpenSSL prevent insecure connections. You can lower the security setting for a context with: >>> import ssl >>> context =

[issue46136] "dh low key " issue when try to connect mysql

2021-12-19 Thread Ajith MsM
open title: "dh low key " issue when try to connect mysql type: resource usage versions: Python 3.10 Added file: https://bugs.python.org/file50504/issue.txt ___ Python tracker <https://bug

[issue40787] Mysql + unittest crash

2020-05-27 Thread Lucas
Lucas added the comment: The problem was that I didn't close the 1st connection to the database and then made another request, which had to wait for the 1st to close, to be exact. -- ___ Python tracker

[issue40787] Mysql + unittest crash

2020-05-27 Thread Lucas
Lucas added the comment: While trying to simplify my program for you, I found that the problem was caused by a very specific interaction of one of the functions that was being tested with the restore command, which did not happen when I tried to rule this problem out in other ways.

[issue40787] Mysql + unittest crash

2020-05-27 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: Hi Lucas, this is probably not an issue with unittest but a bug in the test themselves. Can you attach an example to reproduce the issue? -- nosy: +remi.lapeyre ___ Python tracker

[issue40787] Mysql + unittest crash

2020-05-26 Thread Lucas
New submission from Lucas : environment: win10 cmd, python 3.8 32-bit, mysql, unittest description: When restoring a database through mysql in a unittest function, the command prompt freezes before giving the result of the test, and I am forced to close it to quit. steps to replicate: Have

Re: Debian Buster: ModuleNotFoundError: No module named 'mysql'

2020-05-07 Thread rackflot
i have figured it out. When i made the database, i made it with root access. I think i had to do that to make it accessable for a webpage. i changed to SU and installed this. pip install mysql-connector-python-rf and the other listed above. dumped out of su then tried it again. it worked

Re: Debian Buster: ModuleNotFoundError: No module named 'mysql'

2020-05-07 Thread rackflot
On Thursday, May 7, 2020 at 7:57:14 AM UTC-4, MRAB wrote: > On 2020-05-07 12:30, rackf...@gmail.com wrote: > > I have the same issue. I use visual code from Ms and the remote debugging > > over an ssh. > > I am able to do all mysql while in the debugger but running on c

Re: Debian Buster: ModuleNotFoundError: No module named 'mysql'

2020-05-07 Thread MRAB
On 2020-05-07 12:30, rackf...@gmail.com wrote: I have the same issue. I use visual code from Ms and the remote debugging over an ssh. I am able to do all mysql while in the debugger but running on command line does not work. The DB is logged in as root as this was the only way I could make

Re: Debian Buster: ModuleNotFoundError: No module named 'mysql'

2020-05-07 Thread rackflot
I have the same issue. I use visual code from Ms and the remote debugging over an ssh. I am able to do all mysql while in the debugger but running on command line does not work. The DB is logged in as root as this was the only way I could make it work. pi@raspberrypi:~/blescan/iBeacon-Scanner

Re: Escaping confusion with Python 3 + MySQL

2020-04-21 Thread moorthy . rs
On Sunday, March 26, 2017 at 7:55:09 PM UTC+5:30, Νίκος Βέργος wrote: > Τη Κυριακή, 26 Μαρτίου 2017 - 5:19:27 μ.μ. UTC+3, ο χρήστης Ian έγραψε: > > > You need to change the placeholders back. The poster who told you to > > replace them was misinformed. > > okey altered them back to > >

[issue40242] zmq mysql core dump

2020-04-10 Thread Eric V. Smith
Eric V. Smith added the comment: I'm going to close this. If you can provide information on how to reproduce this and/or what you observe in the segfault dump, we will happily reopen it. I think the best "resolution" tag is to call this "third party", but I'm not sure it matters too much.

[issue40242] zmq mysql core dump

2020-04-10 Thread Rohit Gupta
Rohit Gupta added the comment: For the time being, changing the order of import is solving the problem. -- ___ Python tracker ___

[issue40242] zmq mysql core dump

2020-04-09 Thread Eric V. Smith
Eric V. Smith added the comment: This looks like a problem in zmq, pyzmq, or mysql-connector-python, not in python itself. I'd suggest asking in a mysql-connector-python specific location for starters. You should also try to duplicate the problem without importing zmq, which doesn't seem

[issue40242] zmq mysql core dump

2020-04-09 Thread Rohit Gupta
New submission from Rohit Gupta : # pyzmq==19.0.0 # zmq==0.0.0 # mysql-connector-python==8.0.19 # Following code is resulting in # Segmentation fault (core dumped) ## import zmq import mysql.connector database = "dev" host = "192.168.56.1&qu

[issue39860] configparser - no support for cascading defaults (as defined by MySQL)

2020-03-05 Thread Ben Griffin
Ben Griffin added the comment: Having looked at the code, I believe that it is best NOT to interfere with the 'default_section' value of the class, as it is used as a proxy to _defaults, whereas the section parameter of get() is easily extended. The actual changes are all to the method

[issue39860] configparser - no support for cascading defaults (as defined by MySQL)

2020-03-05 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch nosy: +python-dev nosy_count: 1.0 -> 2.0 pull_requests: +18148 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18791 ___ Python tracker

[issue39860] configparser - no support for cascading defaults (as defined by MySQL)

2020-03-05 Thread Ben Griffin
New submission from Ben Griffin : While there is now support for a single default group, mysql documentation is clear that there is a cascade of groups for option settings, normally starting with [client], and including version numbers.. This allows generic settings to be overridden

Re: Debian Buster: ModuleNotFoundError: No module named 'mysql'

2020-01-19 Thread 황병희
^Bart writes: >> pip is probably defaulting to Python 2.7. Try using pip3, or this more >> explicit syntax: > > Now it works! > > Python 3.7.3 (default, Apr 3 2019, 05:39:12) > [GCC 8.3.0] on linux > Type "help", "copyright", "credits" or "license()" for more information. > ==

Re: Debian Buster: ModuleNotFoundError: No module named 'mysql'

2020-01-18 Thread ^Bart
> == RESTART: /home/gabriele/Corso_4.0/Python/Test_MySQL2.py == >>> I solved the "issue" by: # aptitude install python3-pip $ python3 -m pip install mysql-connector $ python3 -m pip search mysql-connector | grep --color mysql-connector-python $ python3

Re: Debian Buster: ModuleNotFoundError: No module named 'mysql'

2020-01-18 Thread Michael Torrie
On 1/18/20 9:03 AM, ^Bart wrote: >> What could I do to fix this issue?! :\ > > I understood I have Python 2.7 and Python 3 but I can't install modules > on Python 3... :\ > > ^Bart pip is probably defaulting to Python 2.7. Try using pip3, or this more explicit syntax: python3 -m pip install

Re: Debian Buster: ModuleNotFoundError: No module named 'mysql'

2020-01-18 Thread ^Bart
What could I do to fix this issue?! :\ I understood I have Python 2.7 and Python 3 but I can't install modules on Python 3... :\ ^Bart -- https://mail.python.org/mailman/listinfo/python-list

Debian Buster: ModuleNotFoundError: No module named 'mysql'

2020-01-18 Thread ^Bart
Hi guys, I'd like to use Python to connect to my MariaDB db, it works from phpmyadmin and if I open a console with mysql -u root -p. I tried: $ pip search mysql-connector | grep --color mysql-connector-python mysql-connector-python (8.0.19) - MySQL driver written

Re: How to compare in python an input value with an hashed value in mysql table?

2020-01-16 Thread centredeformationfrance
Thank you so much Pieter! Danku well Where can I write you a review 5/5! Linkedin? Google business? Facebook page? Thank you!Thank you!Thank you!Thank you!Thank you! X 1! :-) -- https://mail.python.org/mailman/listinfo/python-list

Re: How to compare in python an input value with an hashed value in mysql table?

2020-01-16 Thread Pieter van Oostrum
Growth Hacking Formation writes: > Thanks for helping. That is what I thought. > Lets say it is the case and I get the key. We know it uses sha256 and it > apply to the ascii code. > What should be the python code in this scenario? > I am novice and the hash python module is a bit too complex

Re: How to compare in python an input value with an hashed value in mysql table?

2020-01-14 Thread Chris Angelico
On Wed, Jan 15, 2020 at 5:41 PM Growth Hacking Formation wrote: > > Thanks for helping. That is what I thought. > Lets say it is the case and I get the key. We know it uses sha256 and it > apply to the ascii code. > What should be the python code in this scenario? > I am novice and the hash

Re: How to compare in python an input value with an hashed value in mysql table?

2020-01-14 Thread Growth Hacking Formation
Thanks for helping. That is what I thought. Lets say it is the case and I get the key. We know it uses sha256 and it apply to the ascii code. What should be the python code in this scenario? I am novice and the hash python module is a bit too complex for me. I read the doc. Thanks. --

Re: How to compare in python an input value with an hashed value in mysql table?

2020-01-14 Thread Chris Angelico
On Wed, Jan 15, 2020 at 10:54 AM Dennis Lee Bieber wrote: > > On Tue, 14 Jan 2020 10:02:08 -0800 (PST), Growth Hacking Formation > declaimed the following: > > > > > >Hello @formationgrowthhacking, > >thank you for your message and for using my plugin. > >For license key

Re: How to compare in python an input value with an hashed value in mysql table?

2020-01-14 Thread Growth Hacking Formation
Thanks for your help. Litle details, the license key is goldQ3T8-1QRD-5QBI-9F22 and it is stored in database already encrypted. License key is not saved in database with clear text. It is already encrypted. I am not sure what is this hash column for? License key =>

Re: How to compare in python an input value with an hashed value in mysql table?

2020-01-14 Thread dieter
ad...@formationgrowthhacking.com writes: > I have a wordpress 5.3 websites which sell a software with license key. > > The license key is encrypted and stored in Mysql table. there are 2 columns > "license" and &

Re: How to compare in python an input value with an hashed value in mysql table?

2020-01-14 Thread Pieter van Oostrum
ad...@formationgrowthhacking.com writes: > I have a wordpress 5.3 websites which sell a software with license key. > > The license key is encrypted and stored in Mysql table. there are 2 columns > "license" and &

How to compare in python an input value with an hashed value in mysql table?

2020-01-13 Thread admin
I have a wordpress 5.3 websites which sell a software with license key. The license key is encrypted and stored in Mysql table. there are 2 columns "license" and "hash

Re: How to format a datetime MySQL database field to local using strftime()

2019-02-26 Thread vergos . nikolas
Actually i just found it has a directive: dictrows: Whether or not to support dict-like access to row objects (default: True). so i just did: plugin = bottle_pymysql.Plugin( dbuser='nikos', dbpass='*', dbname='counters', dictrows=False ) and now it works with indexes as integers not as

Re: How to format a datetime MySQL database field to local using strftime()

2019-02-26 Thread vergos . nikolas
Τη Τρίτη, 26 Φεβρουαρίου 2019 - 3:26:29 μ.μ. UTC+2, ο χρήστης vergos@gmail.com έγραψε: > Can you help me rewrite this function, which when iam using 'pymysql' > conncector works normally, it does not when iam using 'bottle_pymysql' > > def coalesce( data ): > newdata = [] >

Re: How to format a datetime MySQL database field to local using strftime()

2019-02-26 Thread vergos . nikolas
Can you help me rewrite this function, which when iam using 'pymysql' conncector works normally, it does not when iam using 'bottle_pymysql' def coalesce( data ): newdata = [] seen = {} for host, ref, location, useros, browser, visits, hits, downloads, authuser in data:

RE: Connector/Python, MySQL Workbench Issue

2019-02-25 Thread Steve
, MySQL Workbench Issue I was trying to install MySQL Workbench and it asked me to install the Connector/Python 3.7. I installed Python 3.7.2, restarted the computer and tried to install MySQL workbench again and it told me again that I needed to install Connector/Python 3.7. I found the download

Re: Connector/Python, MySQL Workbench Issue

2019-02-25 Thread DL Neil
Scott, Someone else will be better able to assist - I use Linux. In the mean-time, may I suggest combing-through the MySQL docs for installing on Windows - the suspicion about Administrator cf user remains... Yes, I often find MySQL-Workbench a useful tool when interacting with RDBMSes

Re: Connector/Python, MySQL Workbench Issue

2019-02-25 Thread DL Neil
Scott, On 26/02/19 2:15 PM, Scott Sorgent wrote: I was trying to install MySQL Workbench and it asked me to install the Connector/Python 3.7. I installed Python 3.7.2, restarted the computer and tried to install MySQL workbench again and it told me again that I needed to install Connector

Connector/Python, MySQL Workbench Issue

2019-02-25 Thread Scott Sorgent
I was trying to install MySQL Workbench and it asked me to install the Connector/Python 3.7. I installed Python 3.7.2, restarted the computer and tried to install MySQL workbench again and it told me again that I needed to install Connector/Python 3.7. I found the download for MySQL

Re: How to format a datetime MySQL database field to local using strftime()

2019-02-25 Thread DL Neil
I was half-waiting for you to jump in! At this stage, the OP doesn't seem to have mastered converting MySQL results into Python (a pain in and of itself). Accordingly, whilst a pythonic improvement was suggested along with debugging methods, had deferred SQL improvements until the root-problem

Re: How to format a datetime MySQL database field to local using strftime()

2019-02-24 Thread DL Neil
so: %e should likely be %w or %d. Which 'connector' are you using between MySQL and Python? (may not be the same as the one I favor) 'visit' is being returned from database containing a MySQL datatime field that i want to change to another format which is ('%A %e %b, %I:%M %p') thats why i'm

Re: How to format a datetime MySQL database field to local using strftime()

2019-02-24 Thread vergos . nikolas
de? How do we get from the collection of > > tuples/dicts called "data", to an iterable called "visits"? > > > > Also: %e should likely be %w or %d. > > > > Which 'connector' are you using between MySQL and Python? > > (may not be the same a

Re: How to format a datetime MySQL database field to local using strftime()

2019-02-24 Thread vergos . nikolas
isit in visits: > >visit = visit.strftime('%A %e %b, %I:%M %p') > > Is this the actual code? How do we get from the collection of > tuples/dicts called "data", to an iterable called "visits"? > > Also: %e should likely be %w or %d. >

Re: How to format a datetime MySQL database field to local using strftime()

2019-02-24 Thread DL Neil
"data", to an iterable called "visits"? Also: %e should likely be %w or %d. Which 'connector' are you using between MySQL and Python? (may not be the same as the one I favor) 'visit' is being returned from database containing a MySQL datatime field that i want to change to

How to format a datetime MySQL database field to local using strftime()

2019-02-24 Thread vergos . nikolas
: visit = visit.strftime('%A %e %b, %I:%M %p') 'visit' is being returned from database containing a MySQL datatime field that i want to change to another format which is ('%A %e %b, %I:%M %p') thats why i'm using that function. If not convert or comment out then results

Re: Python MySQL Guide

2018-08-10 Thread Vishal Hule
ht you consider > breaking it up into a number of smaller pages and giving an index as the > main page? > > On Aug 9, 2018 5:18 PM, wrote: > >> Refer this complete guide on working with Python and MySQL >> >> https://pynative.com/python-mysql-tutorial/ >> -

Re: Python MySQL Guide

2018-08-10 Thread Bob Gailer
ide on working with Python and MySQL > > https://pynative.com/python-mysql-tutorial/ > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list

Python MySQL Guide

2018-08-09 Thread vishalhule24
Refer this complete guide on working with Python and MySQL https://pynative.com/python-mysql-tutorial/ -- https://mail.python.org/mailman/listinfo/python-list

Re: install MySQL-python failed ....

2018-04-05 Thread INADA Naoki
https://stackoverflow.com/questions/11107155/how-to-fix-address-space-is-already-occupied-error-on-fetch-commit On Fri, Apr 6, 2018 at 8:12 AM, yi zhao <stevenzha...@gmail.com> wrote: > $ python -m pip install MySQL-python > Collecting MySQL-python > Downloading MySQL-python-1

Re: install MySQL-python failed ....

2018-04-05 Thread Larry Martell
On Thu, Apr 5, 2018 at 7:12 PM, yi zhao <stevenzha...@gmail.com> wrote: > $ python -m pip install MySQL-python > Collecting MySQL-python > Downloading MySQL-python-1.2.5.zip (108kB) > 100% || 112kB 260kB/s > 930 [main] python2.7

install MySQL-python failed ....

2018-04-05 Thread yi zhao
$ python -m pip install MySQL-python Collecting MySQL-python Downloading MySQL-python-1.2.5.zip (108kB) 100% || 112kB 260kB/s 930 [main] python2.7 12948 child_info_fork::abort: address space needed by 'datetime.dll' (0x87) is already occupied

Re: Escaping confusion with Python 3 + MySQL

2017-03-27 Thread Jussi Piitulainen
Gregory Ewing writes: > Νίκος Βέργος wrote: > >> Its still a mystery to em whay this fails syntactically when at the >> same time INSERT works like that. > > I don't think *anyone* understands why SQL was designed with > INSERT and UPDATE having completely different syntaxes. > But it was, and we

Re: Escaping confusion with Python 3 + MySQL

2017-03-27 Thread Gregory Ewing
Νίκος Βέργος wrote: Its still a mystery to em whay this fails syntactically when at the same time INSERT works like that. I don't think *anyone* understands why SQL was designed with INSERT and UPDATE having completely different syntaxes. But it was, and we have to live with it. -- Greg --

Re: Escaping confusion with Python 3 + MySQL

2017-03-27 Thread Νίκος Βέργος
fugure that out cost me lots of time. Στις Δευ, 27 Μαρ 2017 στις 10:52 π.μ., ο/η Johann Spies < johann.sp...@gmail.com> έγραψε: > Νίκος, > > I am glad that you solved the problem. > > I am not using mysql but postgresql. When I get a problem using python to > communicat

Re: Escaping confusion with Python 3 + MySQL

2017-03-27 Thread Johann Spies
Νίκος, I am glad that you solved the problem. I am not using mysql but postgresql. When I get a problem using python to communicate with the database, one of my first steps will be to determine whether the error is a python (maybe psycopg-related) related error or a database error. What I do

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Δευτέρα, 27 Μαρτίου 2017 - 6:00:34 π.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: > On Mon, Mar 27, 2017 at 1:52 PM, Νίκος Βέργος wrote: > > Its NOT that i have not read it exactly, but for some strange reason i was > > under the belief that the way i had syntactically

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Chris Angelico
On Mon, Mar 27, 2017 at 1:52 PM, Νίκος Βέργος wrote: > Its NOT that i have not read it exactly, but for some strange reason i was > under the belief that the way i had syntactically typed the UPDATE query was > correctly and more consistent and similar to thr INSERT query

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Δευτέρα, 27 Μαρτίου 2017 - 5:43:01 π.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: > On Mon, Mar 27, 2017 at 1:39 PM, Νίκος Βέργος <me.on@gmail.com> wrote: > >> MariaDB / MySQL shows part of your SQL from where they failed to parse. > >> In your case, yo

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Chris Angelico
On Mon, Mar 27, 2017 at 1:39 PM, Νίκος Βέργος <me.on@gmail.com> wrote: >> MariaDB / MySQL shows part of your SQL from where they failed to parse. >> In your case, your MariaDB can't parse from '(' >> LIKE clause is not problem for this issue? > > Yes inde

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Δευτέρα, 27 Μαρτίου 2017 - 2:27:31 π.μ. UTC+3, ο χρήστης INADA Naoki έγραψε: > > i dont have to update table set column1 = this value, column2=that value and > > so on > > Why do you think so? Did you really read the manual? > > mysql> create table test_update (

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Steve D'Aprano
On Mon, 27 Mar 2017 07:13 am, Νίκος Βέργος wrote: > OMG!!! It actually worked! > > Can't believe that 3 days in a row i have tried everything concerning > string manipulation and mysql escaping nd the error was the UPDATE > itself You tried everything except what we told you

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread INADA Naoki
> i dont have to update table set column1 = this value, column2=that value and > so on Why do you think so? Did you really read the manual? mysql> create table test_update (a int primary key, b int, c int); Query OK, 0 rows affected (0.02 sec) mysql> insert into test_update val

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread breamoreboy
On Sunday, March 26, 2017 at 8:33:49 PM UTC+1, Νίκος Βέργος wrote: > Τη Κυριακή, 26 Μαρτίου 2017 - 10:23:27 μ.μ. UTC+3, ο χρήστης > bream...@gmail.com έγραψε: > > On Sunday, March 26, 2017 at 4:11:54 PM UTC+1, Νίκος Βέργος wrote: > > > Τη Κυριακή, 26 Μαρτίου 2017 - 5:49:00 μ.μ. UTC+3, ο χρήστης

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread breamoreboy
On Sunday, March 26, 2017 at 4:11:54 PM UTC+1, Νίκος Βέργος wrote: > Τη Κυριακή, 26 Μαρτίου 2017 - 5:49:00 μ.μ. UTC+3, ο χρήστης Ian έγραψε: > > > The database wrapper won't do substitution into the middle of a string > > like that. Either concatenate the literal %'s on in the SQL statement > >

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Κυριακή, 26 Μαρτίου 2017 - 11:59:21 μ.μ. UTC+3, ο χρήστης Larry Hudson έγραψε: > On 03/26/2017 01:21 AM, Νίκος Βέργος wrote: > > print('''UPDATE visitors SET (pagesID, host, ref, location, useros, > > browser, visits) VALUES (%s, %s, %s, %s, %s, %s, %s) WHERE host LIKE > > "%s"''', (pID,

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Larry Hudson via Python-list
On 03/26/2017 01:21 AM, Νίκος Βέργος wrote: print('''UPDATE visitors SET (pagesID, host, ref, location, useros, browser, visits) VALUES (%s, %s, %s, %s, %s, %s, %s) WHERE host LIKE "%s"''', (pID, domain, ref, location, useros, browser, lastvisit, domain) ) prints out: UPDATE visitors SET

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
ow try this: > > cur.execute('''UPDATE visitors SET pagesID=%s, host=%s, ref=%s, location=%s, > useros=%s, browser=%s, visits=%s WHERE host LIKE %s''', (pID, domain, ref, > location, useros, browser, lastvisit, domain_query) ) OMG!!! It actually worked! Can't believe that 3 days in a r

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Κυριακή, 26 Μαρτίου 2017 - 10:56:07 μ.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: > On Mon, Mar 27, 2017 at 6:33 AM, Νίκος Βέργος wrote: > > Since i'm incopetent as you suggest i'am show us your level of skills and > > expertise and provide a solution, otherwise you are

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Chris Angelico
On Mon, Mar 27, 2017 at 6:33 AM, Νίκος Βέργος wrote: > Since i'm incopetent as you suggest i'am show us your level of skills and > expertise and provide a solution, otherwise you are also what you claim of me. It's not his problem. An expert does not have to provide

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Κυριακή, 26 Μαρτίου 2017 - 10:23:27 μ.μ. UTC+3, ο χρήστης bream...@gmail.com έγραψε: > On Sunday, March 26, 2017 at 4:11:54 PM UTC+1, Νίκος Βέργος wrote: > > Τη Κυριακή, 26 Μαρτίου 2017 - 5:49:00 μ.μ. UTC+3, ο χρήστης Ian έγραψε: > > > > > The database wrapper won't do substitution into the

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Mar 27, 2017 at 4:54 AM, Νίκος Βέργος <me.on@gmail.com> wrote: > >> > Τη Κυριακή, 26 Μαρτίου 2017 - 8:06:07 μ.μ. UTC+3, ο χρήστης INADA Naoki > >> > έγραψε: > >> >> Read my mail again. > >> >> > >> >>

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Chris Angelico
τίου 2017 - 8:06:07 μ.μ. UTC+3, ο χρήστης INADA Naoki >> > έγραψε: >> >> Read my mail again. >> >> >> >> > This error came from MySQL. If there are no logs in error_log, it's >> >> > your configuration issue. >> >> >

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Κυριακή, 26 Μαρτίου 2017 - 8:58:55 μ.μ. UTC+3, ο χρήστης alister έγραψε: > On Sun, 26 Mar 2017 07:43:51 -0700, Νίκος Βέργος wrote: > > > Τη Κυριακή, 26 Μαρτίου 2017 - 5:38:57 μ.μ. UTC+3, ο χρήστης alister > > έγραψε: > >> On Sun, 26 Mar 2017 07:24:49 -0700, Νίκος Βέργος wrote: > >> > >> > Τη

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
again. > >> > >> > This error came from MySQL. If there are no logs in error_log, it's > >> > your configuration issue. > >> > >> > See https://dev.mysql.com/doc/refman/5.7/en/update.html for Update > >> > statement syntax. > >

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread breamoreboy
On Sunday, March 26, 2017 at 3:11:50 PM UTC+1, Ian wrote: > On Sun, Mar 26, 2017 at 7:39 AM, MeV wrote: > > On Sunday, March 26, 2017 at 6:34:30 AM UTC-7, Νίκος Βέργος wrote: > >> with import cgitb; cgitb.enable() > >> > >> ProgrammingError(1064, "You have an error in your SQL syntax; check the >

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Chris Angelico
On Mon, Mar 27, 2017 at 4:54 AM, Νίκος Βέργος <me.on@gmail.com> wrote: > Τη Κυριακή, 26 Μαρτίου 2017 - 8:06:07 μ.μ. UTC+3, ο χρήστης INADA Naoki > έγραψε: >> Read my mail again. >> >> > This error came from MySQL. If there are no logs in error_log, i

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread alister
On Sun, 26 Mar 2017 07:43:51 -0700, Νίκος Βέργος wrote: > Τη Κυριακή, 26 Μαρτίου 2017 - 5:38:57 μ.μ. UTC+3, ο χρήστης alister > έγραψε: >> On Sun, 26 Mar 2017 07:24:49 -0700, Νίκος Βέργος wrote: >> >> > Τη Κυριακή, 26 Μαρτίου 2017 - 5:19:27 μ.μ. UTC+3, ο χρήστης Ian >> > έγραψε: >> > >> >> You

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Κυριακή, 26 Μαρτίου 2017 - 8:06:07 μ.μ. UTC+3, ο χρήστης INADA Naoki έγραψε: > Read my mail again. > > > This error came from MySQL. If there are no logs in error_log, it's > > your configuration issue. > > > See https://dev.mysql.com/doc/refman/5.7/en/update.ht

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
in that is causing all this trouble How would you write it?! Στις Κυρ, 26 Μαρ 2017 στις 8:05 μ.μ., ο/η INADA Naoki < songofaca...@gmail.com> έγραψε: > Read my mail again. > > > This error came from MySQL. If there are no logs in error_log, it's > > your configuratio

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread INADA Naoki
Read my mail again. > This error came from MySQL. If there are no logs in error_log, it's > your configuration issue. > See https://dev.mysql.com/doc/refman/5.7/en/update.html for Update > statement syntax. -- https://mail.python.org/mailman/listinfo/python-list

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Any ideas on how to make progress on that? After all its just an UPDATE with a WHERE clause?! Do you also think is DBI related issue? -- https://mail.python.org/mailman/listinfo/python-list

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Joel Goldstick
On Sun, Mar 26, 2017 at 11:48 AM, Νίκος Βέργος wrote: > Τη Κυριακή, 26 Μαρτίου 2017 - 6:39:01 μ.μ. UTC+3, ο χρήστης Steve D'Aprano > έγραψε: >> On Mon, 27 Mar 2017 02:11 am, Νίκος Βέργος wrote: >> >> > I just tried: >> > >> > domain = '.'.join( host.split('.')[-2:] ) >> >

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Currently to avoid any misinformations my code looks as follows: domain = '.'.join( host.split('.')[-2:] ) domain_query = '%%%s' % domain cur.execute('''UPDATE visitors SET (pagesID, host, ref, location, useros, browser, visits) VALUES (%s, %s, %s, %s, %s, %s, %s) WHERE host LIKE %s''', (pID,

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Chris Angelico
On Mon, Mar 27, 2017 at 2:48 AM, Νίκος Βέργος wrote: >> > which you can see at http://superhost.gr >> >> Ah, Nikos, its been a long time! I thought I recognised your style of >> posting. > > > Howdy Steve! > Yes its me and yes its have been a long time! How are you?! > Irony

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Κυριακή, 26 Μαρτίου 2017 - 6:39:01 μ.μ. UTC+3, ο χρήστης Steve D'Aprano έγραψε: > On Mon, 27 Mar 2017 02:11 am, Νίκος Βέργος wrote: > > > I just tried: > > > > domain = '.'.join( host.split('.')[-2:] ) > > domain = '%' + domain + '%' > > > > cur.execute('''UPDATE visitors SET (pagesID,

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
Τη Κυριακή, 26 Μαρτίου 2017 - 6:28:12 μ.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: > On Mon, Mar 27, 2017 at 2:11 AM, Νίκος Βέργος wrote: > > Τη Κυριακή, 26 Μαρτίου 2017 - 5:49:00 μ.μ. UTC+3, ο χρήστης Ian έγραψε: > > > >> The database wrapper won't do substitution into the

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Steve D'Aprano
On Mon, 27 Mar 2017 02:11 am, Νίκος Βέργος wrote: > I just tried: > > domain = '.'.join( host.split('.')[-2:] ) > domain = '%' + domain + '%' > > cur.execute('''UPDATE visitors SET (pagesID, host, ref, location, useros, > browser, visits) VALUES (%s, %s, %s, %s, %s, %s, %s) WHERE host LIKE "%s"

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Chris Angelico
On Mon, Mar 27, 2017 at 2:11 AM, Νίκος Βέργος wrote: > Τη Κυριακή, 26 Μαρτίου 2017 - 5:49:00 μ.μ. UTC+3, ο χρήστης Ian έγραψε: > >> The database wrapper won't do substitution into the middle of a string >> like that. Either concatenate the literal %'s on in the SQL statement

Re: Escaping confusion with Python 3 + MySQL

2017-03-26 Thread Νίκος Βέργος
domain = '.'.join( host.split('.')[-2:] ) domain = '%' + domain + '%' domain = '%%%s%%' % domain domain = '%{}%'.format(domain) cur.execute('''UPDATE visitors SET (pagesID, host, ref, location, useros, browser, visits) VALUES (%s, %s, %s, %s, %s, %s, %s) WHERE host LIKE "%s" ''',

  1   2   3   4   5   6   7   8   9   10   >