0

I have a master sql file that I called in the mysql command prompt:

 mysql>source /tmp/folder/masterFile.sql

In the masterFile.sql, I have some source files:

source players.sql
source teams.sql

The problem is that it gives me this error message saying that it can find the file.

ERROR:
Failed to open file 'players.sql \* to create players table *\', error: 2

The masterFile.sql and the other files are in the same directory.

2
  • It looks like you have comments in your masterfile.sql but you mixed up the comment syntax, using \* *\ where you should have used /* */. Commented Aug 2, 2019 at 18:43
  • I removed it and it's the same Commented Aug 2, 2019 at 19:21

1 Answer 1

1

Note-1: It is better to use the full path of the SQL file file.sql.

Note-2: Use -R and --triggers to keep the routines and triggers of original database. They are not copied by default.

Note-3 You may have to create the (empty) database from mysql if it doesn't exist already and the exported SQL don't contain CREATE DATABASE (exported with --no-create-db or -n option), before you can import it.

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.