mysql-connector

Why mysql.connector works without problem with python2.7 and not with python3?

蓝咒 提交于 2020-04-18 05:45:35
问题 I checked different post like: Is there a way to use 'pool_reset_connection' from mysql-connector-python with MariaDB 10.4.7? But I can't solve my isue, I have a program write in python 2.7; now I'm moving everything to python 3 but I got problems with mysql.connector. In this moment I'm using python 3.8.2 and mysql-connector-python==8.0.19 but I try with different version of python 3, but I was getting always the same error on mysql.connector when I try to close the connection. Traceback

Does MySQL's Connector/J work with MariaDB?

只谈情不闲聊 提交于 2020-03-25 12:32:46
问题 I'm attempting to connect to my MariaDB database using Connector/J from here, but this fails to work and MariaDB logs ` "[Warning] Aborted connection 12 to db: 'enwikt_parsed' user: 'javawiki' host: 'localhost' (Got an error reading communication packets)". ` It occurs to me that I just assumed Connector/J from MySQL would just work with MariaDB, but now I'm not so sure. I know MariaDB has their own Java API/Connector, but I'm using someone else's code to parse wiktionary, and therefore can't

Python mysql connector returns tuple

落爺英雄遲暮 提交于 2020-03-16 05:24:51
问题 I am connecting to mysql database via mysql connector and running a simple query to pull a list of IDs. I need to loop over that list and pass them into some other code. For some reason I am getting a list of tuples. Is this expected behavior? If not, what am I doing wrong? Here is the snippet of my code: import mysql.connector conn = mysql.connector.connect(host='127.0.0.1', database='t', user='r', password='pwd') cursor = conn.cursor() query = ( "select id from T where updated < '%s'" %

Python mysql connector returns tuple

*爱你&永不变心* 提交于 2020-03-16 05:24:27
问题 I am connecting to mysql database via mysql connector and running a simple query to pull a list of IDs. I need to loop over that list and pass them into some other code. For some reason I am getting a list of tuples. Is this expected behavior? If not, what am I doing wrong? Here is the snippet of my code: import mysql.connector conn = mysql.connector.connect(host='127.0.0.1', database='t', user='r', password='pwd') cursor = conn.cursor() query = ( "select id from T where updated < '%s'" %

How to prevent Mysql Connector/J from converting DATE and TIME timezone?

旧时模样 提交于 2020-01-30 11:01:07
问题 I am connecting to a mysql server using the following DSN: jdbc:mysql://localhost/my_database?useUnicode=true&characterEncoding=utf-8&serverTimezone=UTC . The problem I'm getting is that the java.sql.Date instance is getting timezone converted to UTC from my local timezone. My application treats dates as timezone agnostic and this is causing a few problems. For instance, I'm in IST (UTC+05:30), when I set some date field to say '2020-01-22' in code, it gets sent to the server as '2020-01-21'.

Do I need different version of mysql-connector for jdk 8

。_饼干妹妹 提交于 2020-01-17 08:15:08
问题 I'm using mysql-connector-java-5.1.6-bin with jdk 6 currently but I'm moving my project to jdk 8 do I need to download different version of this jar file? 回答1: If you want use JDK 8, you need the latest version of mysql connector, Connector/J 8.0 From the What's New in Connector/J 8.0? page: It is a MySQL driver for the Java 8 platform. For Java 7 or earlier, use Connector/J 5.1 instead. 回答2: You don't require Connector/J 8.0 to run on JRE 8. Connector/J 5.1 works too but 5.1 is getting much

ConnectionString for connecting 3 master nodes to MySQL

安稳与你 提交于 2020-01-16 18:51:43
问题 Backgroud I am developing a .net project, which works with EF6 and MySQL DB. For High Availability, I am using Galera cluster, so I have 3 MySQL Master nodes up and running: master1 , master2 and master3 . According to connectionstring.com I should be able to use the following connection string: Server=master1, master2, master3;Database=myDataBase; Uid=myUsername;Pwd=myPassword; I have tried the above, and it does not work... I have seen this bug which explains multi-host connection string

How to connect mysql to node js using XDevAPI connector with 3306 port

给你一囗甜甜゛ 提交于 2020-01-16 09:03:29
问题 I installed XDevAPI for connecting mysql and nodejs. but it throw error like "The server gone away" because i am using 3306 port. how to solve this. 回答1: Port 3306 defaults to the classic MySQL Wire Protocol. The MySQL X DevAPI Connector for Node.js only supports the X Protocol, which is implemented by the X Plugin (by default on port 33060). You can change this by updating the mysqlx_port server variable or using the --mysqlx-port= option when starting the server. If you want to use the X

Failed to deploy maven project, no connector available

白昼怎懂夜的黑 提交于 2020-01-15 12:15:53
问题 I'm trying to deploy a maven project but I'm getting this error: ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.745 s [INFO] Finished at: 2014-07-14T00:52:07+04:00 [INFO] Final Memory: 12M/222M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin

How do I modify the source code of the MySQL Connector and install it on my PC?

馋奶兔 提交于 2020-01-15 05:03:54
问题 In short, what are the steps that one needs to take in order to modify the source of the connector and install it in Windows? I have the MySQL Connector/.NET Version 6.1.2 installed on my machine, but I'm getting an exception for every DateTime with a value of '0000-00-00'. This exception breaks my application. As I solution, I downloaded the source code for the connector and changed the exception so that instead of throwing an exception, it returns the date '0001-01-01 00:00:00'. Although I