天道酬勤,学无止境

mysql-workbench

Is it possible to read list of files using mysql

I am trying to read list of files in a directory and store all of them in a table using mysql For e.g I have thousand image files in this folder /User/Images I want to store all the file names into a table in mysql. Is it possible to do this using using just mysql, I dont want to use any programming language that has API for File read and write.

2021-10-27 03:57:20    分类:问答    mysql   mysql-workbench

Getting error 1822 in MySQL when trying to create a foreign key

I am getting an error when creating a foreign key. The error is 1822 and it says the following: Error Code: 1822. Failed to add the foreign key constraint. Missing index for constraint 'Changes_ibfk_4' in the referenced table 'Recipe' I have read similar question and the problem seems to be, that the column that we need to create a foreign key on, does not have same datatype as the column that is referenced to. However, I have no idea how the two columns are different to one another. Both are primary keys, with same name and type varchar(255). Below is the MySQL code. Is there a difference

2021-10-27 03:47:18    分类:问答    mysql   sql   mysql-workbench

MySQL query slows down when another query is concurently sent

I am using an InnoDB table that currently has 16m of records. When I run the following query by using MySQL Workbench, it returns in about 14 seconds: SELECT countryCode AS label, SUM(count) AS value FROM AnalyticsPieCharts GROUP BY label ORDER BY value DESC; When I run the same query from a different computer, while the first one is running, both return in about 23-24 seconds. I haven't created any indexes (except of the primary key) or put transaction rules. I am using Amazon RDS. Do you have any clue on what could be the problem?

2021-10-27 02:53:03    分类:问答    mysql   mysql-workbench   amazon-rds

Can't Connect to MySQL instance Remotely that is running on EC2 Instance (Not RDS)

I have seen a lot of posts that claim they are running an RDS instance of MySql in which they cannot connect to, but I am not running RDS. I used my EC2 insance to host my wordpress blog which was installed using the Web Platform Installer. This setup the wordpress schema and data that I needed and I have been running it for a couple years. I want to be able to access this database remotely instead of only logging into my server. I have checked and have the following users root wpadmin I have also verified that the port specified in the mysql config is the standard 3306 and I have setup an

2021-10-26 16:25:01    分类:问答    mysql   sql   wordpress   amazon-ec2   mysql-workbench

如何在 MySQL Workbench 上针对 .sql 数据库运行脚本(How to run a script against a .sql database on MySQL Workbench)

问题 对不起,我是一个新手,我知道这看起来像一个愚蠢的问题。 我正在尝试遵循这个非常初学者的教程。 似乎讲师正在使用此示例数据库中的employees.sql .sql 数据库。 如果我只是运行命令: select * from employees; 我收到错误 错误代码:1046。未选择数据库 通过在侧边栏中的 SCHEMAS 列表中双击其名称来选择要使用的默认数据库。 我试着在一边打开employees.sql : 但是然后运行它会返回错误消息: 错误代码:1064。您的 SQL 语法有错误; 检查与您的 MySQL 服务器版本相对应的手册,了解在第 1 行的“source load_departments.dump”附近使用的正确语法 他们 GitHub 存储库上的这个类似问题也没有多大帮助。 我尝试按照示例数据库存储库上的安装说明进行操作: mysql < employees.sql 但是,我收到另一个错误: 错误 1045 (28000):用户 'foobar'@'localhost' 访问被拒绝(使用密码:否) 如果您能帮助我了解分步表单中的先决条件,以便能够遵循本教程的其余部分,我将不胜感激。 PS我在 macOS Catalina 上,我的 Workbench 版本是 8.0,还有 MySQL mysql Ver 8.0.19 for osx10.15 on x86

2021-10-26 15:51:54    分类:技术分享    mysql   sql   mysql-workbench

Mysql Workbench 整数数据类型错误(INT 更改 > (11) )(Mysql Workbench integer datatype bug(INT changes > (11) ))

问题 当我设置列的“INT”数据类型时,它在 Mysql Workbench 更改表上看起来像“(11)”。 所以我不能设置自动增量,外键......但是输入像整数这样的数据没有问题。 这是一个错误吗? Mysql Workbench 版本:6.1 (6.1.4.117773 build 1454) 操作系统:Windows 7 64 位 Mysql 服务器版本:5.6 回答1 我假设 aleblebi 是土耳其成员。 但我想,这个问题也可以在其他语言环境中看到。 首先我会尝试解释问题,然后我会在最后写下我的解决方案。 当您尝试使用 Workbench GUI 更改表时,您会看到问题(我使用的是 8.0.15 版)。 网格的“数据类型”列和“数据类型:”文本框将显示(11)而不是INT(11) ,在DATETIME列中可以看到同样的问题,但这次数据类型框将完全为空。 如果您尝试使用 Workbench 的“与任何源同步...”向导,也会出现问题。 在向导结束时,您可以看到如下内容: ALTER TABLE `TEST_1`.`TABLE_1` CHANGE COLUMN `ID` `ID` (11) NULL DEFAULT NULL , DROP PRIMARY KEY; 代替: ALTER TABLE `TEST_1`.`TABLE_1` CHANGE COLUMN `ID`

2021-10-26 13:24:55    分类:技术分享    mysql   mysql-workbench

连接表 MySQL(Join Tables MySQL)

问题 我有多个表并做了 2 个子选择(UserRecord、CustomerRecord),我想将它们合并到 1 个表中 UserRecord ======================== | RecordID | UserName | ======================== | 1 | Sara | | 1 | Tom | | 2 | Sara | | 2 | Kurt | | 3 | Fre | ======================== Table: CustomerRecord ============================ | RecordID | CustomerName | ============================ | 1 | Jef | | 2 | Alex | | 2 | Peter | ============================ Table: This should be the result ======================================= | RecordID | UserName | CustomerName | ======================================= | 1 | Sara | - | | 1 | Tom | - | | 1 |

2021-10-26 13:24:26    分类:技术分享    c#   mysql   mysql-workbench

MySQL 更改表名大小写(MySQL alters table name case)

问题 当我使用 MySQL Workbench 将我的模型转发到工作簿时,它会创建一个脚本文件,其中表的名称用引号引起来。 表名都是大小写混合的,但是当脚本运行时,只有第一个表以混合大小写创建,其余的只以小写创建。 之前显示了 20 多个表中的前两个表: SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES'; CREATE SCHEMA IF NOT EXISTS `CCBPlus` ; USE `CCBPlus` ; -- ----------------------------------------------------- -- Table `CCBPlus`.`Contacts` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `CCBPlus`.`Contacts` ( `ContactId` INT(11)

2021-10-26 12:54:17    分类:技术分享    mysql   mysql-workbench

Join Tables MySQL

I have multiple tables and made 2 sub-selects (UserRecord,CustomerRecord) that i would like to merge into 1 table UserRecord ======================== | RecordID | UserName | ======================== | 1 | Sara | | 1 | Tom | | 2 | Sara | | 2 | Kurt | | 3 | Fre | ======================== Table: CustomerRecord ============================ | RecordID | CustomerName | ============================ | 1 | Jef | | 2 | Alex | | 2 | Peter | ============================ Table: This should be the result ======================================= | RecordID | UserName | CustomerName | =========================

2021-10-26 06:18:48    分类:问答    c#   mysql   mysql-workbench

Mysql Workbench integer datatype bug(INT changes > (11) )

When I set a "INT" datatype of a column, It's looking like this "(11)" on Mysql Workbench alter table. So I can't set auto increment, foreign key... But There is no issue for enter a data like integer. Is that a bug? Mysql Workbench Version: 6.1 (6.1.4.117773 build 1454) OS: Windows 7 64 bit Mysql Server Version: 5.6

2021-10-26 06:12:41    分类:问答    mysql   mysql-workbench