Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>There is a set of commands that are builtin to the mysql client. They're documented under "<a href="http://dev.mysql.com/doc/refman/5.1/en/mysql-commands.html" rel="nofollow noreferrer"><code>mysql</code> Commands</a>." These include DELIMITER, SOURCE, HELP, CONNECT, USE, QUIT, etc.</p> <p>The <code>\.</code> (or <code>SOURCE</code>) command is one of these builtins. <strong>You can't execute these builtin commands programmatically, nor from within a stored procedure.</strong></p> <p>It'd be like trying to run a UNIX shell builtin from a C program using <code>execl()</code>.</p> <p>A different analogy might be in a web browser, where you can type in special requests like "<code>about:</code>" that are handled by the browser app itself; these don't result in any HTTP request to a remote web site.</p> <p>Also, it wouldn't help if you could source a script from within a stored procedure, because the script itself likely contains a bunch of commands that are mysql client builtins, and thus cannot be run by the stored proc.</p> <hr> <p>See also my answers to these related questions:</p> <ul> <li><a href="https://stackoverflow.com/questions/4027769/running-mysql-sql-files-in-php/4028289#4028289">Running MySQL *.sql files in PHP</a></li> <li><a href="https://stackoverflow.com/questions/147821/loading-sql-files-from-within-php/149456#149456">Loading .sql files from within PHP</a></li> <li><a href="https://stackoverflow.com/questions/345637/php-multiple-sql-queries-in-one-mysql-query-statement/345712#345712">PHP: multiple SQL queries in one mysql_query statement</a></li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload