mysql-connector

Python/MySQL query error: `Unknown column`

a 夏天 提交于 2021-02-05 09:26:15
问题 This script is meant to act as a command-line front-end to add records to a locally hosted MySQL database. I am getting this error: mysql.connector.errors.ProgrammingError: 1054 (42S22): Unknown column 'watermelon' in 'field list' But watermelon is the value I am trying to enter, not the column name! Here is the script: #! /usr/bin/python #use command line as front end to enter new rows into locally hosted mysql database import mysql.connector #create inputs new_fruit = raw_input('What fruit

IO.FileNotFoundException in MySql.Data.dll: Can't load System.Security.Permissions

你说的曾经没有我的故事 提交于 2021-02-02 09:33:36
问题 I am using Visual Studio Code, and I'm trying to connect to my MySql server (5.5). I have downloaded the latest (6.10.6) MySql connector and installed it. I had to research to add references in VS Code, but I managed it. Now my .csproj file looks like this: <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>netcoreapp2.0</TargetFramework> </PropertyGroup> <ItemGroup> <Reference Include="Lib\MySql.Data.dll"> <HintPath>MySql.Data</HintPath>

IO.FileNotFoundException in MySql.Data.dll: Can't load System.Security.Permissions

隐身守侯 提交于 2021-02-02 09:33:07
问题 I am using Visual Studio Code, and I'm trying to connect to my MySql server (5.5). I have downloaded the latest (6.10.6) MySql connector and installed it. I had to research to add references in VS Code, but I managed it. Now my .csproj file looks like this: <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>netcoreapp2.0</TargetFramework> </PropertyGroup> <ItemGroup> <Reference Include="Lib\MySql.Data.dll"> <HintPath>MySql.Data</HintPath>

Raise an event from MySQL and handle it from VB.NET (or something similar)?

孤街醉人 提交于 2021-01-29 19:51:06
问题 I'm working with MySQL 5.1.39 and Visual Studio 2008 and connecting both with MySQL Connector Net 6.1.2. What I'd like to do is once a MySqlConnection object is created, be able to handle the "event raised" when a field in a specific row in a given table is updated. I mean, when that value in that table has been manually changed or modified from any other application, I'd like to receive a signal in my opened VB.NET application. Until now, I do it from opened VB.NET application checking that

Prepared statement in an array and bind() for X DevAPI

我与影子孤独终老i 提交于 2021-01-29 15:00:53
问题 I want the statement to search a number of Ids. Like so. const idsStr = "41, 42, 43"; const sqlStr = `SELECT * FROM table where id IN (${idsStr})`; session.sql(sqlStr).execute() But if I use bind method, it only captures the first instance of the string, the remaining values are ignored. const idsStr = "41, 42, 43"; const sqlStr = `SELECT * FROM table where id IN (?)`; session.sql(sqlStr).bind(idsStr).execute() I want to make prepared statement according to the API currently support so as to

running python and mysql with docker error - cannot connect

做~自己de王妃 提交于 2021-01-29 08:17:08
问题 I am using mysql-connector, when ever I run the container using docker I get this error: mysql.connector.errors.InterfaceError: 2003: Can't connect to MySQL server on 'db:3306' (-5 No address associated with hostname) but when I run the project using python only it executes with no errors I want to use phpmyadmin only for the database please help. 回答1: To create a docker from your linux machine: docker pull mysql:latest To run it and mount a persistent folder with port access on 3306 (std

Table 'dbname.dbname.tablename' doesn't exists error in Visual Studio when adding Mysql Entity Framework

北慕城南 提交于 2021-01-28 12:44:51
问题 I am trying to add MySQL with Entity Framework in Visual Studio. I am using MySQL Server 8.0.12 and also the 8.0.12 Connector/MySql.data. error: MysqlException: Table 'dbname.dbname.tablename' doesn't exists. Normally I have table but dbname name showing twice. My code's very simple, I want to list all datas in my table: using (sakilaEntities db = new sakilaEntities()) { var list = db.country.ToList(); } I'm getting below error. UPDATE: Uninstall MySQL Server 8.0.12 and MySQL Connector 8.0.12

Table 'dbname.dbname.tablename' doesn't exists error in Visual Studio when adding Mysql Entity Framework

こ雲淡風輕ζ 提交于 2021-01-28 12:44:41
问题 I am trying to add MySQL with Entity Framework in Visual Studio. I am using MySQL Server 8.0.12 and also the 8.0.12 Connector/MySql.data. error: MysqlException: Table 'dbname.dbname.tablename' doesn't exists. Normally I have table but dbname name showing twice. My code's very simple, I want to list all datas in my table: using (sakilaEntities db = new sakilaEntities()) { var list = db.country.ToList(); } I'm getting below error. UPDATE: Uninstall MySQL Server 8.0.12 and MySQL Connector 8.0.12

How do I update a value in a row in MySQL using Connector/C++

拟墨画扇 提交于 2021-01-28 11:40:46
问题 I have a simple database and want to update an int value. I initially do a query and get back a ResultSet (sql::ResultSet). For each of the entries in the result set I want to modify a value that is in one particular column of a table, then write it back out to the database/update that entry in that row. It is not clear to me based on the documentation how to do that. I keep seeing "Insert" statements along with updates - but I don't think that is what I want - I want to keep most of the row

Failed to generate code error when compiling a ASP.NET website on a new computer

半世苍凉 提交于 2021-01-28 07:00:24
问题 I moved my ASP.NET 4.5 website to a new computer by copying the whole folder of the website. When I try to build the website on the new computer in Visual Studio 2012 (same version that I have on the first computer) I get a few warnning and Errors. Error: Failed to generate code. Exception of type 'System.Data.Design.InternalException' was thrown. C:\Users\admin\Desktop\website_sample\App_Code\DataSet.xsd There are 21 warnnings , all saying "Unable to update auto-refresh reference" for