I am not proficient in MySQL and phpMyAdmin and got this error when trying to import my SQL file to a new installation of WAMP. I was developing a joomla website on my local pc and after completion, decided to launch it online with Rochen web hosting. When importing this into my Cpanel, it gave me the error below.
Error
Static analysis:
errors were found during analysis.
A closing bracket was expected. (near ")" at position 276)
SQL query:
Database: kwadi.
Table structure for table iq2rf_assets:
CREATE TABLE `iq2rf_assets`
(
`id` int(10) UNSIGNED NOT NULL COMMENT 'Primary Key',
`parent_id` int(11) NOT NULL DEFAULT '0'COMMENT
)
MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to use
near ')' at line 14
I tried to resolve with their support but their advice was for me to upgrade my WAMP Server on my local pc to the one that has MariaDB in it and try extract. Now after installing the new WAMP server i am faced with the same issue when trying to import my back up db using phpmyadmin.
It is giving me the same error. I do not know what to do.
Need assistance.
CREATE TABLE iq2rf_assets ( id int(10) UNSIGNED NOT NULL COMMENT 'Primary Key', parent_id int(11) NOT NULL DEFAULT '0')
You do not have a comment on the second field (parent_id), yet you are using the keyword "COMMENT" only to be closing the query after that. Remove it and you're good to go
The assets table has more fields than the 2 fields shown in your post.
This is the reason for the failed import, check your export.
Related
I'm trying to containerize an app so I'm trying to write an init file for a MariaDB database for an existing database that exists on a remote server. I'm using VS Code to connect to the remote server and the .sql file with the contents of the dump has no errors, but when I try and copy it to a different workspace on my local computer, I get many syntax errors.
Examples of the syntax errors:
DROP TABLE IF EXISTS `accounts`;
CREATE TABLE `accounts` (
`table_number` int(11) NOT NULL AUTO_INCREMENT,
`account_id` varchar(12) NOT NULL,
`account_name` varchar(5) NOT NULL,
PRIMARY KEY (`table_number`)
) ENGINE=InnoDB AUTO_INCREMENT=261 DEFAULT CHARSET=latin1;
Incorrect syntax near '`'. Expecting '(', or SELECT.
Incorrect syntax near '11'. Expecting '(', or SELECT.
The error about the ` character is present before "accounts" and before both instances of "table_number" but not before "account_id" and "account_name". Every number in the CREATE has the incorrect syntax warning. I've tried retyping rather than copy and pasting to see if there's hidden characters responsible for these issues, but no luck.
Is this an OS issue? The remote server is a CentOS machine and my local is macOS Catalina. A setting in VS Code I need to specify or change?
i need some help regarding how to downgrade my sql database file from 5.6 to 5.5, because i did changed my hosting.my old hosting server was 5.6 and new server version was 5.5, i am getting error while i am importing the data base file..
support says:"you are running MySQL Server version: 5.5.51-38.2. Which is why you are having issues importing the database. You would need MySQL 5.6 for that database." ..any one can please help me in it ??
i have uploaded my sql file here please check: http://www88.zippyshare.com/v/bbzjmvCJ/file.html
and please fix it if you can. i am very thankful to you...
error i am getting while uploading is here :
CREATE TABLE `wpqc_o3n8w99opanda_leads_fields` (
`wpqc_o3n8w99opanda_leads_fields`.`lead_id` int(10) unsigned,
`wpqc_o3n8w99opanda_leads_fields`.`field_name` varchar(255),
`wpqc_o3n8w99opanda_leads_fields`.`field_value` text,
`wpqc_o3n8w99opanda_leads_fields`.`field_custom` bit(1) DEFAULT 'b\'0\'',
UNIQUE `UK_wp_opanda_leads_fields` (`lead_id`,`field_name`),
KEY `IDX_wp_opanda_leads_fields_field_name` (`field_name`)
)/*! engine=MyISAM */;
MySQL said:
#1067 - Invalid default value for 'field_custom'
The default value for a bit field should be DEFAULT b'0' this is not a difference between v5.5 and 5.6, it is probably an issue with the export, which considered b'0' as a string and encapsulated it into extra single quotes and escaped the original single quotes.
I am trying to duplicate one of my databases on a remote bluehost server in order to setup a dev and stage environment for my drupal website. Dev is already setup/populated and working fine, so I am now simply trying to duplicate the dev database. Using phpmyadmin on windows (PHP 5.2.17, MySQL 5.5.42). I have done the following steps:
created site_stage database
exported/dumped all tables from site_dev db into compressed sql.gz file
imported all tables into site_stage db
Import fails with $1064 error:
INSERT INTO `cache_bootstrap` (`cid`, `data`, `expire`, `created`, `serialized`, `tags`, `checksum`) VALUES
('system_list', 0x613a323a7b733a353a227468656d65223b613a31333a7b733a363a2262617274696b223b433a33313a2244727570616c5c436f72655c457874656e73696f6e5c457874656e73696f6e223a323339343a7b613a31363a7b733a343a2274797065223b733a353a227468656d65223b733a383a22706174686e616d65223b733a33343a22636f72652f7468656d65732f62617274696b2f62617274696b2e696e666f2e796d6c223b733a383a2266696c656e616d65223b733a31323a2262617274696b2e7468656d65223b733a373a2273756270617468223b733a31333a227468656d65732f62617274696b223b733a363a226f726967696e223b733a343a22636f7265223b733a363a22737461747573223b693a313b733a343a22696e666f223b613a31393a7b733a343a226e616d65223b733a363a2242617274696b223b733a343a2274797065223b733a353a227468656d65223b733a31303a2262617365207468656d65223b733a363a22636c61737379223b733a31313a226465736372697074696f6e223b733a38363a224120666c657869626c652c207265636f6c6f7261626c65207468656d652077697468206d616e79[...]
#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 '?' at line 2
Thought maybe it didn't like the length of that value, so I just deleted that cache_bootstrap query from uncompressed version of dump file (shouldn't need this cache table anyways) and tried to import again, this time, it failed with the following error:
CREATE TABLE IF NOT EXISTS `key_value` (
`collection` varchar(128) CHARACTER SET ascii NOT NULL DEFAULT '' COMMENT 'A named collection of key and value pairs.'
`value` longblob NOT NULL COMMENT 'The value.',
PRIMARY KEY (`collection`,`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Generic key-value storage table. See the state system for…';
#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 '`value` longblob NOT NULL COMMENT 'The value.',
PRIMARY KEY (`collection`,`nam' at line 9
I've read a lot of '1064 error on import' threads, but none of them help and most of them pertain to moving sql data between servers. Very strange that I would get syntax errors copying tables from one database to another on same server, with same mysql version, etc. Any ideas? Thanks in adv.
So I am trying to deploy my play Framework 2.3.5 on my Server. I have connected it with the MySQL database (newest version) and use EBean for persistence.
My 1.sql script looks like:
# --- Created by Ebean DDL
# To stop Ebean DDL generation, remove this comment and start using Evolutions
# --- !Ups
create table input (
id varchar(255) not null auto_increment,
text TEXT not null,
mode varchar(255) not null,
theme varchar(255) not null,
title varchar(255) not null,
PRIMARY KEY (id)
)
;
# --- !Downs
drop table input;
and for the reason i post this my error message:
[info] play - database [default] connected at jdbc:mysql://localhost/pastedemo
[error] play - 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 'sequence input_seq' at line 1 [ERROR:1064, SQLSTATE:42000]
Oops, cannot start the server.
#6kaijj99g: Database 'default' is in an inconsistent state!
Can someone tell me where my fault is? :)
Ok I solved the problem. It is pretty easy.
When you want to use your application in production mode, you have to delete the 1.sql. Then use activator dist for packing your application and upload it on your server. Don't test it with run again. After that you can deploy it and it works.
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.