mysql-connector

How to create a mysql connection pool or any better way to initialize the multiple databases?

廉价感情. 提交于 2019-11-30 15:28:28
In my code I am opening two mysql connections and using HTTP requests to insert data into database g.db = mysql.connector.connect(user=a ,password=password, host=localhost,database=mysq1) g.db1 = mysql.connector.connect(user=b,password=password, host=localhost,database=mysql2) @app.route('/user/<db>') def insert(db): #code for inserting data into mysql1 database #code for inserting data into mysql2 database I am making HTTP requests to select the databases. curl -i 'localhost:5000/user/mysql1' # It is working well, data is getting inserted into the selected database. But I was thinking of

Cannot connect to mysql from visual studio 2015

好久不见. 提交于 2019-11-30 13:21:56
问题 So I have already spent about 2 days trying fix this. I have succeeded in fixing this on my workplace pc and can't get it to work on my home pc. I have read about a dozen SO articles and oracle forums articles and whatnot but still it does not work. I have 1.2.4 msql for visual studio which is supposed to be a release which works on vs2015. I have installed mysql connector 6.8.6 and have first tried to add mysql to my project via nuget but after not being able to find a 6.8.6 version (there

MySQL C++ Connector: undefined reference to `get_driver_instance'

有些话、适合烂在心里 提交于 2019-11-30 09:48:32
I've been trying to get the MySQL connector working I've installed both the connector and the mysql client library but I am still getting this error: obj/Database.obj: In function `Database::connect()': /home/xeross/alpine/src/server/Database.cpp:13: undefined reference to `get_driver_instance' collect2: ld returned 1 exit status make[2]: *** [alpine-server] Error 1 make[1]: *** [.build-conf] Error 2 make: *** [.build-impl] Error 2 Using Ubuntu 10.04 And my makefile is as follows: INCLUDES = -I./src -I./src/shared OUTDIR = bin INTDIR = obj OPTIONS = -ggdb -g3 -Wall -O0 alpine-server : Shared.a

Cannot connect to mysql from visual studio 2015

坚强是说给别人听的谎言 提交于 2019-11-30 09:36:38
So I have already spent about 2 days trying fix this. I have succeeded in fixing this on my workplace pc and can't get it to work on my home pc. I have read about a dozen SO articles and oracle forums articles and whatnot but still it does not work. I have 1.2.4 msql for visual studio which is supposed to be a release which works on vs2015. I have installed mysql connector 6.8.6 and have first tried to add mysql to my project via nuget but after not being able to find a 6.8.6 version (there are 6.8.3 and 6.9.7 for one package and then again something else for the other...) I have referenced to

Getting MySQL error stack trace on Oracle JDBC Connection

我与影子孤独终老i 提交于 2019-11-30 06:02:54
问题 I am facing very odd error while making Oracle JDBC connection using a connection string. I am giving username as "sys"(which should be sys as sysdba) and ideally, it should come through ojdbc6.jar but in my case, it is coming from mysql-connector-java-8.0.11.jar which is also included in my project. Please help as I have to keep both the jars in my project. When I remove the mysql-connector-java-8.0.11.jar, I get the expected oracle error mentioned below. private static Connection

MySQL Exception - Fatal Error Encountered During Data Read

你离开我真会死。 提交于 2019-11-30 05:58:24
问题 I am working on a C# console program that grabs large numbers of records from a table, runs them through a medical grouper, and then updates each of the records. It uses MySQL Connector/NET 5.2.7. The way it works is that I grab chunks of data at a time (i.e. 20,000 rows) using SQL_BUFFER_RESULT to avoid locks. Each record is run through the grouper, and then an individual update query is done on that one record. There are two connections used, a read connection and a write connection. So as

MySql with JAVA error. The last packet sent successfully to the server was 0 milliseconds ago [duplicate]

喜夏-厌秋 提交于 2019-11-30 05:06:59
This question already has an answer here: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure 34 answers I have read about this exception a lot, but I can't solve my. Mysql server is working. I can connect to it from NetBeans, but I can't connect to it from java code. Exception in thread "main" com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. at sun.reflect.NativeConstructorAccessorImpl.newInstance0

SSL Exception on Java: Path does not chain with any of the trust anchors

强颜欢笑 提交于 2019-11-29 21:13:56
问题 I am trying to establish a SSL connection with my MySQL database in Java using MySQL Connector/J (version 5.1.45 ) and this AWS RDS certificate here: https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem But I am getting the following Exception : java.security.cert.CertPathValidatorException: Path does not chain with any of the trust anchors I could trace this Exception down to the MySQL Connector/J class ExportControlled.java on line 297 : CertPathValidatorResult result = this

MySQL Connector/C++ OS X 10.9 Mavericks and XCODE 5.0.2

天大地大妈咪最大 提交于 2019-11-29 18:05:18
I've upgraded to XCode 5.0.2 along with OS X 10.9 Mavericks and MYSQL 5.6.16 recently. Has anyone had any luck getting the MySQL Connector/C++ to compile and work properly with this setup? I've been linking with the distributed MySQL Connector/C++ library under Snow Leopard with no problem for a few years now, but when I shifted to the above mentioned setup, I have no luck. When I use the sql::Driver->connect I get EXC_BAD_ACCESS (code=EXC_I386_GPFLT) USING: XCode 5.0.2 Mavericks 10.9.2 MYSQL server 5.6.16 Mac OS X 10.7 (x86, 64-bit), DMG Archive MYSQL Connector/C++ Mac OS X 10.7 (x86, 64-bit)

MySQL C++ Connector crashes my app at ResultSet->getString()

陌路散爱 提交于 2019-11-29 15:35:16
It's me again probably asking noob C++ questions I had MAJOR headaches making the darn (sorry for the language) MySQL C++ connector work. I don't know if it is poorly written or something, but for my experience yet I've never had so much trouble making something to work. Anyhow I got it to connect and throw exceptions on failed connect/query which for me is quite big thing :U :P . The actual problem comes out of me obtaining the result of the query. Regardless of what I do my application always crashes :S I used the 32-bit installer and the libmysql.dll/lib from the 32-bit MySQL server (since