Error executing sql script

I am trying to run a script to import data into MySQL. When I tried, this error shown up. I have searched for a workaround but none is helping. I deleted all the related .cnf file in the said path ...

I am trying to run a script to import data into MySQL. When I tried, this error shown up. I have searched for a workaround but none is helping. I deleted all the related .cnf file in the said path after a few attempts on trying to run the script but it kept on creating a new one. I have no other means of importing the data besides running that script. Terribly sorry if I somehow really ask a silly question about this but I am new with SQL, stuck and need help on the matter. Thanks in advance.
enter image description here

asked Jan 19, 2021 at 16:14

Nadhirah21's user avatar

3

i have the same error as you, I’ve manage to solve it on my end by following these steps:

  1. Rather than doing «run sql script», do «open sql script»
  2. After the script open, Execute all (the lightning btn beside the save icon)

Hope this will work for you too!

answered Jan 21, 2021 at 2:52

vika's user avatar

vikavika

1141 bronze badge

3

I ran into this problem as well and, like @Alexandre-St-Amant, the size of my script prohibited opening the script as @vika suggests.

Before noticing @Kwaadpepper’s suggestion, I tried using connecting to my database through mysqlsh.exe, then used SOURCE <data_file>. This has the added benefit of allowing linked scripts using SOURCE, solving @Adrian-Moldovan’s issue.

Of course, this does not use mysql-workbench to solve the problem.

Dharman's user avatar

Dharman

29.3k21 gold badges80 silver badges131 bronze badges

answered Dec 15, 2021 at 17:33

Zach Longhofer's user avatar

I had same problem with my sql script.
You may try reinstall the client and workbench. You should follow one version of applications. After that actions my script has worked.

answered Jan 22 at 21:14

keize_kh's user avatar

1

My sql file was really big and I was not able to copy the contents or load the file. Instead, do this :

Server' -> 'Data Import

Dump the data from sql file from here. This worked for me.

answered Feb 6 at 13:26

Himanshu Suthar's user avatar

Himanshu SutharHimanshu Suthar

4072 gold badges8 silver badges22 bronze badges

I run InstallShield 2010 to install my application which uses SQL Server. InstallShield first connects to the SQL Server as SA and then runs a few SQL scripts. The 1st script checks if a specific database exists or not. If it does not exist
it returns immediately, otherwise it updates a table.

I had no problems when I ran the application install using SQL Server 2005 and 2008 R2. But I recently upgraded successfully my SQL Server 2008 R2 express to SQL Server 2012 express. InstallShield still succeeds to connect but throws an error
when trying to execute the 1st script.

The SQL script is as follows:

        IF NOT EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name = N’myDatabase’)
            return;

        UPDATE [myDatabase].dbo.myTable SET current_version =2

        GO

The error:

«Error executing SQL script xy, line 4. Database ‘myDatabase’ does not exist(2702)».

The database did not exist and so the script should have returned. Instead it seems that it tried to execute the next line and complained that the database does not exist.

This error only happens when running the SQL script from InstallShield. It does not happen when I run the script in SSMS, or when I run it from installshield on sql server 2005 and 2008 R2.

I searched all over and couldn’t find anything about this problem. The syntax that this script uses has not changed in Sql Server 2012 as far as I can tell. Is there a known problem in SS 2012 that may be causing this error? Can it be related to the
express edition? Has anyone encountered something similar? Any idea will be appreciated. Thanks.

Запущен MySQL на локальном сервере OpenServer. Создаю Базу Данных в программе Workbench ,создал связи таблиц в диаграмме, не получалось соединится с базой,всегда выбивало ошибку на запрос пароля. Покопавшись в программе нашел другую ошибку:
Executing SQL script in server
ERROR: Error 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 ‘)
REFERENCES `blogDb`.`msgs` ()
ON DELETE NO ACTION
ON UPDATE NO ACT’ at line 14
SQL Code:
CREATE TABLE IF NOT EXISTS `blogDb`.`users` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`login` VARCHAR(45) NULL DEFAULT NULL,
`password` VARCHAR(45) NULL DEFAULT NULL,
`screen_name` VARCHAR(45) NULL DEFAULT NULL,
`email` VARCHAR(45) NULL DEFAULT NULL,
`type` VARCHAR(45) NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `id_UNIQUE` (`id` ASC),
UNIQUE INDEX `login_UNIQUE` (`login` ASC),
UNIQUE INDEX `screen_name_UNIQUE` (`screen_name` ASC),
UNIQUE INDEX `email_UNIQUE` (`email` ASC),
CONSTRAINT `users`
FOREIGN KEY ()
REFERENCES `blogDb`.`msgs` ()
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8
SQL script execution finished: statements: 5 succeeded, 1 failed
Fetching back view definitions in final form.
Nothing to fetch
Просьба помочь исправить данную ошибку.:
P.S. создаю впервые базу данных в программе Workbench.Если нужно могу приложить файл Базы Данных.
P.P.S. Может кто поможет в создании Базы Данных. В интернете инструкции по создании Баз Данных с помощью Workbench на пальцах пересчитать можно :. Спасибо.


  • Вопрос задан

    более трёх лет назад

  • 280 просмотров

There are multiple solutions for this error depending on the cause listed in the installation log.

First, ensure the database user does not exist in the SQL instance.

  1. Log into the SQL Server Management Studio
  2. Expand the instance and go to Security
  3. Go to Logins
  4. If the user account you were attempting to create already exists, delete the account. (Note: This is not the ‘sa’ account.)

Once the account is deleted, proceed with the installation again and ensure that the password you supply the new database user is complex enough.

For the following error:
«Error executing SEEMSDb creation script: database [SEEMSDb] creation failed Cannot create file
‘C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLDATASEEMSDb.mdf’ because it already exists.»

This error can occur if the SEEMSDb is not removed from SQL Server prior to uninstalling SQL Server. The mdf/ldf files will be left in the DATA directory. If you would like to proceed with a fresh installation, you will need to remove these mdf/ldf files from the DATA folder.

For all other errors, please generate a log of the installation using the following command and contact technical support.

MSIEXEC /i «[path]Symantec Endpoint Encryption Management Server.msi» /lvx [logpath]logfile.log

During the installation of Diamonds/ PowerConnect (version 2017 until 2019r02), you get the error:

Error 27506. Error executing SQL script install_authentication.sql. Line 27. CREATE DATABASE failed. Some file names listed could not be created. Check related errors. (1802)

This error is related to the database system (= SQL instance) used by these versions.

Solution 1

  • Install Diamonds/PowerConnect/BIM Expert 2020 or more recent. These versions so a different type of database, which no longer requires the installation of an SQL instance.

Solution 2

  1. Click the error away.
  2. Close the setup.
  3. Go to C:Program FilesMicrosoft SQL Server*NameOfTheDatabase*MSSQLDATA
    *NameOfTheDatabase* is usually ‘MSSQL12.SQLEXPRESS14’ or similar containing ‘BS’ (= short for BuildSoft) in the name.
  4. Delete all files starting with ‘bs’, like:
    • bs_Authentication
    • bs_Exchange
    • bs_Gateway
    • bs_UBSM
  5. Run the Diamonds (or PowerConnect) setup again.During the install Gateway will install again. During the install of Gateway you will be asked to select an SQL instance.
    Install a new SQL instance and change the name to something different than before, for. example ‘SQLEXPRESS14BS2’ or ‘SQLEXPRESS14BS3’.

System information:

  • Windows 10 Pro v10.0.17763 Build 17763
  • DBeaver v7.0.2.202004051509
  • Java v1.8.0_101

Connection specification:

  • Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 — 64bit Production
  • Driver name — Oracle
  • no tunnels

The problem:

Execute SQL Script, when it find slash «/» after plsql block it show error:
SQL Error [17439] [99999]: Invalid SQL type: sqlKind = UNINITIALIZED
Slash «/» after plsql block is required in SQL*Plus, so I believe that Execute SQL Script must work similar to SQL*Plus, because it executes all the code in the file.

Example:

Result on DBever, run Execute SQL Script:

CREATE TABLE test_table(id number);

begin 
	execute immediate 'DROP TABLE test_table'; 
end;
/ 

Error occurred during SQL script execution

Reason:
SQL Error [900] [42000]: ORA-00900: invalid SQL statement

Result on SQL*Plus:

SQL> CREATE TABLE test_table(id number);

Table created.

SQL>
SQL> begin
  2  execute immediate 'DROP TABLE test_table';
  3  end;
  4  /

PL/SQL procedure successfully completed.

Понравилась статья? Поделить с друзьями:
  • Error executing sql pragma synchronous normal
  • Error executing sql in memberdaoimpljdbc create
  • Error executing sql commit database is locked asterisk
  • Error executing program error code 2
  • Error executing maven unable to load cache item