So I'm trying to execute the following SQL Code from a C# app
SOURCE Install/Create_Initial_Index
SOURCE Install/Create_Table_Pk
Using the following C# code
public static void installScripts(MySqlConnection conn, String installScriptPath)
{
MySqlScript script = new MySqlScript(conn, File.ReadAllText(installScriptPath));
script.Execute();
}
However it is raising a syntax error for the SOURCE keyword
Error Code: 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 'SOURCE Install/Create_Initial_Index.sql # 20170109 NOT REQUIRED ==>>> SOURCE Inst' at line 1
The SOURCE keyword seems to not work when calling a .sql script from MySQL workbench, but does work when calling it from the mysql> command line. However, it seems that the C# code I'm using is the equivalent to calling it from MySQL workbench. Does anyone know how I can go about changing my C# code in order to equate the call to that of a mysql> command line call. I think this would fix the issue.
Edit 1: I tried doing it by running a shell script from C# but it doesn't work because there's a password required to connect
Edit 2: This question is completely different than what someone identified as a "duplicate". Please read the question fully.