mysql-connector

Unraised exception using Tweepy and MySQL

橙三吉。 提交于 2019-12-30 11:54:27
问题 I am trying to use Tweepy to store tweets in a MySQL DB. The code works fine, with the exception of once I try to execute the SQL command to insert the data into the database. Code is as follows: #MySQL connection attempt try: cnx = mysql.connector.connect(**config) cursor = cnx.cursor() except mysql.connector.Error as err: if err.errno == errorcode.ER_ACCESS_DENIED_ERROR: print("Something is wrong with your user name or password") elif err.errno == errorcode.ER_BAD_DB_ERROR: print("Database

Python2.7 MySQL Connector Error on LOAD DATA LOCAL INFILE

时间秒杀一切 提交于 2019-12-30 10:43:29
问题 I'm trying to dynamically load census data into a mysql database (from .csv files) using Python and MySQL Connector. I can't figure out why I am getting the error: Traceback (most recent call last): File "miner.py", line 125, in <module> cursor.execute(add_csv_file, csv_info) File "/Library/Python/2.7/site-packages/mysql/connector/cursor.py", line 393, in execute self._handle_result(self._connection.cmd_query(stmt)) File "/Library/Python/2.7/site-packages/mysql/connector/connection.py", line

MySQL Connector for Visual Studio 2012 Update 3

戏子无情 提交于 2019-12-30 09:37:48
问题 since I've installed mysql connector 6.7.4 and Update 3 for Visual Studio 2012 the MySQL Connector is gone away from the Connection Manager dialog. It was a working project, so the data source configuration is correct. But when I open my existing *.edmx file I get an error (see the picture below). I've tried to reinstall the connector with rebooting between each installation step, controlled the GAC but I cannot get the connector working back again. I believe it is related to the Update 3, as

MySQL Entity Framework 4.0 Stored Procedure Field Mapping

纵然是瞬间 提交于 2019-12-29 06:45:49
问题 Has anyone here used MySQL with the entity framework 4.0 and stored procedures? When I add a SP, it does not show any of my fields that I need to input. I also see no way to manually add them. When I click Function Import Mapping, it simply says "Select an Entity or Association on the Entity Designer Model Browser to edit it's mapping". Any help is appreciated. I am using the .NET Connector 6.3.6 回答1: due to the bug #55778 (Stored procedure parameters are omitted during update of the entity

How can I transfer data between 2 MySQL databases?

牧云@^-^@ 提交于 2019-12-29 04:15:11
问题 I want to do that using a code and not using a tool like "MySQL Migration Toolkit". The easiest way I know is to open a connection (using MySQL connectors) to DB1 and read its data. Open connection to DB2 and write the data to it. Is there a better/easiest way ? 回答1: First I'm going to assume you aren't in a position to just copy the data/ directory, because if you are then using your existing snapshot/backup/restore will probably suffice (and test your backup/restore procedures into the

Add List<int> to a mysql parameter

安稳与你 提交于 2019-12-29 03:36:20
问题 I have this question about the MySqlParameter from the .NET connector. I have this query: SELECT * FROM table WHERE id IN (@parameter) And the MySqlParameter is: intArray = new List<int>(){1,2,3,4}; ...connection.Command.Parameters.AddWithValue("parameter", intArray); This is possible? Is possible to pass an array of int to a single MySqlParameter? The other solution will be convert the array of int to a string such like "1,2,3,4", but this, when i pass it to the MySqlParameter and this is

How to use python 3.5.1 with a MySQL database

佐手、 提交于 2019-12-29 03:33:09
问题 I have been trying to use MySQL in a Python project I've been working on. I downloaded the connector: mysql-connector-python-2.1.3-py3.4-winx64 here. I already had Python 3.5.1 installed. When I tried to install the connector, it didn't work because it required python 2.7 instead. I have searched on many sites, even on StackOverflow I couldn't find a solution. Thanks for any help. 回答1: I did the steps below with Python 3.5.1 and it works: Download driver from here Driver installation in cmd,

java.net.ConnectException: Connection refused

我与影子孤独终老i 提交于 2019-12-29 02:02:28
问题 I am trying to connect to a mysql database on remote server and whenever I try to run the code it is giving me connection refused exception. Connection con = null; String driver = "com.mysql.jdbc.Driver"; String url1="jdbc:mysql://IPADDRESS:3306/"; String db = "hola"; String dbUser = "root"; String dbPasswd = "root"; Class.forName(driver).newInstance(); con = DriverManager.getConnection(url1+db, dbUser, dbPasswd); System.out.println("Database Connection Established"); Also, when I telnet with

C# and MySQL .NET Connector - Any way of preventing SQL Injection attacks in a generic class?

时间秒杀一切 提交于 2019-12-28 05:46:27
问题 My idea is to create some generic classes for Insert/Update/Select via a C# (3.5) Winforms app talking with a MySQL database via MySQL .NET Connector 6.2.2. For example: public void Insert(string strSQL) { if (this.OpenConnection() == true) { MySqlCommand cmd = new MySqlCommand(strSQL, connection); cmd.ExecuteNonQuery(); this.CloseConnection(); } } Then from anywhere in the program I can run a query with/without user input by just passing a SQL query string. Reading around on SO is starting

mysql connectorJ character set results does not support utf8mb4

*爱你&永不变心* 提交于 2019-12-25 18:11:33
问题 I m having a tomcat server having a connection pool to mysql. In the connection settings i can see all the character set encodings set to utf8mb4 in *this page except for character_set_results. My connection string being - jdbc:mysql://:3306/abc?character_set_server=utf8mb4&useOldAliasMetadataBehavior=true&character_set_connection=utf8mb4&characterEncoding=utf-8&character_set_results=utf8mb4 In the mysql server i can see character_set_results showing utf8mb4. But in the jsp page it is not