0

When I run the following command to import the sql DB into PostgreSQL,

psql -U homestead -h localhost <DB Name> < <backup.sql>

it throws the following syntax error.

ERROR:  unrecognized configuration parameter "sql_mode"
ERROR:  unrecognized configuration parameter "time_zone"
ERROR:  syntax error at or near "`"
LINE 1: CREATE TABLE IF NOT EXISTS `addresses` (

Any idea to resolve this issue. Thanks in advance.

1
  • 1
    There are some small differences in syntax between mysql and postgresql. You will find lots of help while searching mysql to postgresql Commented Mar 17, 2016 at 9:20

1 Answer 1

2

You can simply use mysqldump to create your .sql file.
mysqldump -u username -p --compatible=postgresql databasename > outputfile.sql
Now you can import .sql in your postgresql database without any error.
Hope this help.

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

Comments

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.