Export to MySQL not working

Discussions about Diving Log 6.0 - questions and hints
Post Reply
ebnerjoh
Posts: 27
Joined: Fri Jul 06, 2012 17:59

Export to MySQL not working

Post by ebnerjoh » Thu Jun 15, 2017 07:33

Hi,

I have installed the latest phpmydiving solution and I wanted to upadte the website with my latest dives.

Afte some errors I just created a new (empty) database and tried to import the sql file I got from divinglog.

Unfortunatley I am getting the following errors:

Code: Select all

Static analysis:

2 errors were found during analysis.

Unexpected beginning of statement. (near "EATE" at position 0)
Unrecognized statement type. (near "TABLE" at position 5)
SQL query:

EATE TABLE Brevets (ID int(11) auto_increment, Brevet varchar(255) default '', Org varchar(255) default '', CertDate date default NULL, Number varchar(255) default '', Instructor varchar(255) default '', InstructorNo varchar(255) default '', Scan1Path varchar(255) default '', Scan1 blob default NULL, Scan2Path varchar(255) default '', Scan2 blob default NULL, UUID char(36) default '', Updated date default NULL, SortOrd int(11) default NULL, PRIMARY KEY (ID)) ENGINE=MyISAM DEFAULT CHARSET=UTF8

MySQL said: Documentation

#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 'EATE TABLE Brevets (ID int(11) auto_increment, Brevet varchar(255) default '', O' at line 1
Here are the two mentioned lines from the sql-file:

Code: Select all

CREATE TABLE Brevets (ID int(11) auto_increment, Brevet varchar(255) default '', Org varchar(255) default '', CertDate date default NULL, Number varchar(255) default '', Instructor varchar(255) default '', InstructorNo varchar(255) default '', Scan1Path varchar(255) default '', Scan1 blob default NULL, Scan2Path varchar(255) default '', Scan2 blob default NULL, UUID char(36) default '', Updated date default NULL, SortOrd int(11) default NULL,  PRIMARY KEY (ID)) ENGINE=MyISAM DEFAULT CHARSET=UTF8;

CREATE TABLE Buddy (ID int(11) auto_increment, FirstName varchar(255) default '', LastName varchar(255) default '', Street varchar(255) default '', Address2 varchar(255) default '', Zip varchar(50) default '', City varchar(255) default '', State varchar(255) default '', Country varchar(255) default '', Phone varchar(255) default '', Mobile varchar(255) default '', Fax varchar(255) default '', Email varchar(255) default '', Birthdate date default NULL, PhotoPath varchar(255) default '', Photo blob default NULL, Comments text, UUID char(36) default '', Updated date default NULL, LinkID int(11) default NULL, URL varchar(255) default '',  PRIMARY KEY (ID)) ENGINE=MyISAM DEFAULT CHARSET=UTF8;
Any Ideas?

Br,
Johannes

divinglog
Site Admin
Posts: 4699
Joined: Sat Feb 08, 2003 21:02
Location: Coburg
Contact:

Re: Export to MySQL not working

Post by divinglog » Thu Jun 15, 2017 13:31

Hi Johannes

Looks like the first 2 characters of "CREATE TABLE" are skipped, so the command is just "EATE TABLE", which is wrong.

I guess this has to do with the file encoding or something like that. You can switch between UTF8 and ANSI in the export settings. Make sure you've selected the same encoding during import.

ebnerjoh
Posts: 27
Joined: Fri Jul 06, 2012 17:59

Re: Export to MySQL not working

Post by ebnerjoh » Thu Jun 15, 2017 13:40

Hi,

In the export file I can see the full command - nothing is missing...

I am exporting it as UTF and in the import it is also set to utf...

divinglog
Site Admin
Posts: 4699
Joined: Sat Feb 08, 2003 21:02
Location: Coburg
Contact:

Re: Export to MySQL not working

Post by divinglog » Thu Jun 15, 2017 13:46

Yes the export file contains the full command, but the phpMyAdmin does not read the full command for some reason. And the only reason I could imagine is an encoding problem.

ebnerjoh
Posts: 27
Joined: Fri Jul 06, 2012 17:59

Re: Export to MySQL not working

Post by ebnerjoh » Thu Jun 15, 2017 13:48

The DB Collacolation is set to utf8_general_ci

Is this correct? Anything else I can check?

divinglog
Site Admin
Posts: 4699
Joined: Sat Feb 08, 2003 21:02
Location: Coburg
Contact:

Re: Export to MySQL not working

Post by divinglog » Sat Jun 17, 2017 17:39

You have to make sure UTF-8 is selected during file import. You can also try to enable gzip compression during export

Post Reply