Search code examples
mysqljoomlaphpmyadminmariadb

Error when importing a SQL file using phpMyAdmin


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:

  1. 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.


Solution

  • 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