MySQL issue with source

Hello,

I’m hosting an app with MySQL on my own infastructure. I am trying to run a .sql file.

I set the SQL command to be executed in PHP to be:

$sql = "source create.sql";

However, when I run the app I get this error:

Table Creation Error: source create.sql
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 'source create.sql' at line 1

How can I fix this error?

Hopefully this will help:

Did you export the file?

This is the file:

I am going to try @EddiesTech’s solution later because that looks like it will work.

Still not working. Really confused:


Notice: Undefined index: password in C:\xampp\htdocs\TuckerDesk\install\finish.php on line 21
Table created.Table Creation Error: source create.sql;
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 'source create.sql' at line 1

YESSSS IT WORKED!!!

I just had to capitalize some letters omg

(i think)

1 Like