MySQL Workbench alter table after updating to Windows 11 - mysql

I updated from Windows 10 to Windows 11. Now I can not alter any table anymore on MySQL Workbench.
I increased the timeout to 600 seconds, but still same error. My DB is quiet empty, so it should be no problem of size.
Do I have to change something in the configuration after updating to Win11 for MySQL Workbench?
I have a Python script, which is using this MySQL-DB to use some entries from this DB, that is still working.
I can not share error code as text, because of no copy-paste-functionality.
EDIT: I add the text a can be seen in the screenshot:
Error: There was an error while applying the SQL script to the database.
Executing:
ALTER TABLE 'map'.
ADD COLUMN `route_location` VARCHAR(45) NULL DEFAULT NULL AFTER `route_event`;
Operation failed: There was an error applying thee SQL script to the database.
ERROR 2013: Lost connection to MySQL server during query
SQL Statement:
ALTER TABLE `map`.`routepoints`
ADD COLUMN `route_location` VARCHAR(45) NULL DEFAULT NULL AFTER `route_event`
I tried it with SQL-Script and also with GUI.

After restarting MySQL-Workbench and several times of trying to rerun the SQL-Script it creates the column in the table. Since then I have no problem and its working properly, even if I add a new column.

Related

Error "Error parsing DDL" when trying to ALTER TABLE with ENCRYPTION = 'Y' (keyring plugin) in MySQL 5.7.22

I configured my MySQL 5.7.22 instance with
early-plugin-load = keyring_file.dll
in my.ini, restarted the service (on Windows Server 2016 Standard)
then I created a table:
CREATE TABLE t1 (c1 INT) ENCRYPTION='Y';
Table was created correctly and it looks like the data is really encrypted (by looking into MySQL data folder).
But when I try to ALTER the table (in Workbench) I see this:
Why do I get this "Error parsing DDL"?
Other statements like INSERT or SELECT works okay on this encrypted table.
Also ALTER on a non-encrypted table works normally.
I updated MySQL workbench and it works fine now :-)

Mysql Import Error 1293 Timestamp Issue

This has been asked before, but I cannot seem to find a solution that'll work.
I created a database on my localhost server using Mysql, Version information: 4.2.7.1
I have export the .sql file many times and imported it into other localhost servers without any problems.
Now I'm ready to go live, and I am trying to import the .sql file into my hosted server phpMyAdmin. Version information: 4.3.8, latest stable version: 4.6.4
When I do I get error 1293:
SQL Error (1293): Incorrect table definition; there can be only one
TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
I have many tables that have the same 2 columns:
date_created which is set to type timestamp, default current_timestamp
last_update which is set to type timestamp, default NULL, on update CURRENT_TIMESTAMP
This way I can track when a row is added and updated.
How can I change these rows to make the import file work ok?

workbench editor warns of false error

I haven't found an answer to this issue, so I'm posting here. I'll be the first to admit I may not have conducted the search with the correct terms.
I'm using MySQL Workbench 6.3 Community Edition to connect to the local instance of 5.6.26 MySQL Community Server on my Mac running Yosemite.
My issue is that some commands get underlined in red with an 'x' on the line indicating an error, but they execute without error. Here is an example:
ALTER TABLE products MODIFY created_ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP;
The word "DEFAULT" is underlined in red and hovering over it reviews the message "Syntax error: unexpected 'DEFAULT' (default)". However, the statement executes without error.
Here is the DDL for the table:
CREATE TABLE products (
product_id INT,
prod_name VARCHAR(30),
prod_weight DECIMAL(6,3),
created_ts TIMESTAMP
);
Any help would be greatly appreciated.
Workbench showing underlined text indicating error
It was a bug fixed in MySQL Workbench 6.3.5: bug report link
Posted by developer: Fixed as of the upcoming MySQL Workbench 6.3.5 release, and here's the changelog entry:
The SQL parser and grammar was updated; some queries would emit bogus
errors.
Thank you for the bug report.

MySQL Errcode: 13 - Permission denied

I'm using MySQL 5.7.10 and Flyway to handle my database migrations. Everything works fine on Linux and Mac but on Windows 10 I am getting this error:
Error on rename of '.\mydb\#sql-1da0_a.frm' to '.\mydb\proc_error_table.frm' (Errcode: 13 - Permission denied)
This is part of the SQL in question causing the error:
DROP TABLE IF EXISTS `proc_error_table`;
DROP TABLE IF EXISTS `error_import`;
CREATE TABLE `proc_error_table` (
`procedure_name` varchar(30) NOT NULL,
`sql_state` varchar(20) NOT NULL,
`sql_message` varchar(100) NOT NULL,
`error_timestamp` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
create index idx_proc on proc_error_table(procedure_name);
#
# This is the line causing the error.
#
create index idx_file_id on proc_error_table(data_set_file_id);
I tried explicitly defining a tmpdir with sufficient privileges but that didn't work:
tmpdir = C:/temp
I tried to give explicit FULL ACCESS to the data FULL ACCESS to the MySQL Data directory but that didn't work:
C:\ProgramData\MySQL\MySQL Server 5.7\Data\mydb
I tried changing the user that MySQL runs as to my personal account and that didn't work.
Something, somewhere is preventing MySQL from gaining access to this directory and or file(s). The Windows Event Log, nor the MySQL show any indications as to what is preventing it.
What tool can I use to figure this out?
it could be a conflict with antivirus software. try to turn it off

How to run a .sql file as part of a MySQL Workbench 6.2 query?

I'm using MySQL Workbench 6.2 [Windows7] and I want to create a script with all my steps. Among the steps, I have a series of .sql files stored from on my computer that create and populate tables.
I want to run these files from the query tab but every time I use this command:
source C:/Users/[username]/Desktop/sampdb/create_president.sql;
I get an Error 1064, which says
"Error Code: 1064. You have an error in your
SQL syntax; check the manual that corresponds to your MySQL server
version for the right syntax to use near 'mysql> source
C:/Users/[username]/Desktop/sampdb/create_president.sql at line 1 "
Can anyone tell me what I'm doing wrong? How can I refer to a .sql file within a MySQL Workbench script?
What code should I use in the MySQL Workbench instead of source? I have tried LOAD DATA LOCAL INFILE 'C:/Users/[username]/Desktop/sampdb/create_president.sql'; but it didn't work either. Any idea what can be wrong?
*Just for additional information, create_president.sql contains the following code:
DROP TABLE IF EXISTS president;
## _CREATE_TABLE_
CREATE TABLE president
(
last_name VARCHAR(15) NOT NULL,
first_name VARCHAR(15) NOT NULL,
suffix VARCHAR(5) NULL,
city VARCHAR(20) NOT NULL,
state VARCHAR(2) NOT NULL,
birth DATE NOT NULL,
death DATE NULL
);
The source command is a pure (command line) client specific command which MySQL Workbench does not support. Just load the sql file to run it.
Update (after you edited your question)
Your SQL file contains DDL. LOAD DATA INFILE however only imports DML. There's no replacement for the MySQL commandline client's SOURCE command. Support for that in MySQL Workbench is however on our todo list.
You can run scripts on MySqlWorkBench as follows:
From the file menu, Select "Run SQL Script".
Then, In the popup window, Open the script from your machine.
Then Select the schema name which you are going to execute this script. (Previously i created the schema using the command "create database REGISTRY_LOCAL1;")
Then execute the script.