mysql-workbench

creating Tables and columns dynamically using mysql python connector

家住魔仙堡 提交于 2019-12-23 05:42:10
问题 I want to create a table having columns dynamically using python list. Column Names are in the list and I want to refer them in the MySQL query. I am using MySQL.connector with python 3.4.3. Below is the code which I tried: col names: ['Last Name', 'First Name', 'Job', 'Country'] table_name = 'stud_data' query = "CREATE TABLE IF NOT EXISTS"+table_name+"("+"VARCHAR(250),".join (col) + "Varchar(250))" print("Query is:" ,query) cursor.execute(query) conn.commit() But I am getting the following

MySQL Workbench cannot connect to local MySQL Service on MAC OSX

好久不见. 提交于 2019-12-23 04:57:07
问题 I downloaded Mac OSX MySQL Community edition (http://dev.mysql.com/downloads/mysql/), meeting with new issues cannot connect to local MySQL instance using MySQL WorkBench, here are my setup and error, looks access denied and anyone have any ideas? 回答1: The "Access denied for user … (using password: YES)" error message is telling you that your user/pass failed to authenticate. If no user accounts have been configured yet, you will need to log in as the "root" account, which has no password by

How to store time greater than 24 Hours in Mysql?

怎甘沉沦 提交于 2019-12-23 04:00:46
问题 I need to create a column (say idletime ) that will store time value having hours smaller or bigger than 24. When i try to insert such values bigger than 24 (For example '80:00:00', '129:23:12', etc) , am getting the following error code: java.sql.SQLException: Illegal hour value '80' for java.sql.Time type in value '80:00:00. at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:964) ..... I have searched over the Internet and found that the TIME datatype ranges from 00:00:00 to 23:59

Restore unsaved MySQL Workbench scripts?

给你一囗甜甜゛ 提交于 2019-12-23 03:10:03
问题 I had a bunch of unsaved scripts open. Today I restarted MySQL Workbench, there was an error message and now the scripts are gone. Is there a way to restore them somehow? 回答1: You can try to find your script in History Output. Check this answer: MySql workbench query history ( last executed query / queries ) i.e. create / alter table, select, insert update queries 回答2: If the save snapshot option is enable (this can be done by --> Edit>Preferences>SQL Editor>Save snapshot of open editors on

Reverse engineering a mysqldump output with MySQL Workbench gives “statement starting from pointed line contains non UTF8 characters” error

落爺英雄遲暮 提交于 2019-12-23 02:36:47
问题 I have a huge .sql file from a mysqldump command. I ran this file in MySQL workbench and it seems to create the tables fine. But it gives the following error log ERROR: Line 49076: SQL statement starting from pointed line contains non UTF8 characters. Statement skipped. ERROR: Line 49077: SQL statement starting from pointed line contains non UTF8 characters. Statement skipped. ERROR: Line 49078: SQL statement starting from pointed line contains non UTF8 characters. Statement skipped. // Loads

How to define a deferred constraint in MySQL

别等时光非礼了梦想. 提交于 2019-12-22 18:20:32
问题 is it possible to create a primary key in a existing table on a column that have repeated value? I want is previous record not validate but new record will validate with this.Is it possible in mysql. I know it is possible in Oracle (here is an example) but don't have idea about mysql. 回答1: The link you posted as a comment to Nerd-Herd's answer uses deferred constraints. Those constraints are checked at the end of the transaction rather than at the time the statement is executed. MySQL does

MySQL Workbench Load Data Local Infile error

前提是你 提交于 2019-12-22 12:51:18
问题 I have been running into a problem with MySQL's Load Data Local Infile command. I know that they disabled it by default due to a security threat. I have a SQL Script that I would like to run in MySql Workbench. I keep getting the error "1148. The used command is not allowed with this MySQL version." I have been able to get this to work from the command line using command line arguements. However I havent had any success in the Workbench. Any help would be appreciated. Here is my script. DROP

Unable to connect to mysql on digitalocean using workbench over ssh

你说的曾经没有我的故事 提交于 2019-12-22 11:37:40
问题 I have got my droplet set with the laravel app and database. Created my db while on putty ssh. Now when I am trying to connect to my mysql database as in image, i am getting error. Error: Authentication error, unhandled exception caught in tunnel manager, plese refer to logs for details. Note that my credentials are right, as that what I use to connect through putty. Any help on how can I see view my database? 回答1: Got this solved like this. Turns out this is an ssh level issue. The digital

Export Data Dictionary of my database using MySQL Workbench CE?

拟墨画扇 提交于 2019-12-22 08:19:09
问题 I have a database on server with around 60 tables and now I want to export Data Dictionary of the database (including table structures).. I can do that on my local machine which has PHPMyAdmin , however, I am not able to find way to export it on server using Workbench . Any one who can help? 回答1: You may install db_doc.lua, a Lua script plugin for MySQL Workbench that generates data dictionaries, similar to those generated by DBDoc on MySQL Workbench Enterprise. Download it from: https://docs

ST_Distance_Sphere in mysql not giving accurate distance between two locations

∥☆過路亽.° 提交于 2019-12-22 06:59:01
问题 My requirement is to calculate the distance between two locations on a given map using mysql. I found a function in mysql named ST_Distance_Sphere which returns the minimum spherical distance between two locations and/or multi locations on a sphere in meters. When I computed the distance between two locations using ST_Distance_Sphere and the lat_lng_distance function , I found that the ST_Distance_Sphere is not giving the same distance as that of the lat_lng_distance function. My lat_lng