How to read .sql file by dictionary on MacOS?

89 views Asked by At

I got error 2 when exec sql file by dictionary

I tried to exec mysql file on Mac OS at this dictionary: "/Users/kato/Desktop/world_mysql_script.sql"

source /Users/kato/Desktop/world_mysql_script.sql;

Then I got this error: Failed to open file '/Users/kato/Desktop/world_mysql_script.sql', error: 2

Do you have any solution? 1.

1

There are 1 answers

0
bluestar0505 On

Please try to use mysql command.

mysql -u DB_USER -p -h DB_HOST DB_NAME < /Users/kato/Desktop/world_mysql_script.sql