0

I have some queries that work 100% when I run on my localhost, but they give me syntax error when I try to run then remotely.

Here is one of the queries:

CREATE TABLE IF NOT EXISTS `customer` (
  `id` int(11) NOT NULL,
  `phone` text,
  `date_modified` datetime(6) DEFAULT NULL,
  `first_name` text,
  `customer_id` int(11) DEFAULT NULL,
  `store_credit` text,
  `registration_ip_address` text,
  `last_name` text,
  `tax_exempt_category` text,
  `date_created` datetime(6) DEFAULT NULL,
  `email` text,
  `notes` text,
  `company` text,
  `customer_group_id` int(11) DEFAULT NULL
)

Here is the error:

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 '(6) DEFAULT NULL, `first_name` text, `customer_id` int(11) DEFAULT NULL,' at line 4 

The weird thing is that it's the exact same query! I tried to run remotely on two different hosting services I have, and they both give me the same syntax error.

I have no clue how to solve it. Anyone has any idea what might be?

1 Answer 1

4

I think your Mysql version is lower. Can you execute and see.

CREATE TABLE IF NOT EXISTS `customer` (
  `id` int(11) NOT NULL,
  `phone` text,
  `date_modified` datetime DEFAULT NULL,
  `first_name` text,
  `customer_id` int(11) DEFAULT NULL,
  `store_credit` text,
  `registration_ip_address` text,
  `last_name` text,
  `tax_exempt_category` text,
  `date_created` datetime DEFAULT NULL,
  `email` text,
  `notes` text,
  `company` text,
  `customer_group_id` int(11) DEFAULT NULL
)

Thank you.

Sign up to request clarification or add additional context in comments.

3 Comments

It worked! Is there any other change you made besides removing the parenthesis and the numbe after datetime? And is there a way to export from phpmyadmin a database for a lower version?
Sorry that questions i don't have any answers. Thank you please accept my answer.
In 5 minutes, I just accepted another and have to wait a bit =)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.