<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>MySql on MarkJacobsen.net</title><link>https://test.markjacobsen.net/categories/mysql/</link><description>Recent content in MySql on MarkJacobsen.net</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Mon, 19 Mar 2018 10:24:00 +0000</lastBuildDate><atom:link href="https://test.markjacobsen.net/categories/mysql/index.xml" rel="self" type="application/rss+xml"/><item><title>Execute MySql script from the command line</title><link>https://test.markjacobsen.net/2018/03/execute-mysql-script-from-the-command-line/</link><pubDate>Mon, 19 Mar 2018 10:24:00 +0000</pubDate><guid>https://test.markjacobsen.net/2018/03/execute-mysql-script-from-the-command-line/</guid><description>&lt;p&gt;This tip is very similar to how to “[Execute a SQL file via the MySQL command line in one line][1]” only this time specifying the DB you want to execute the script against and being prompted for your password…&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;mysql -u user -p -h localhost MyDb &amp;lt; ~/SQL/script.sql[1]: http://markjacobsen.net/2012/12/execute-a-sql-file-via-the-mysql-command-line-in-one-line/
&lt;/code&gt;&lt;/pre&gt;</description></item><item><title>Execute a SQL file via the MySQL command line in one line</title><link>https://test.markjacobsen.net/2012/12/execute-a-sql-file-via-the-mysql-command-line-in-one-line/</link><pubDate>Wed, 12 Dec 2012 03:04:40 +0000</pubDate><guid>https://test.markjacobsen.net/2012/12/execute-a-sql-file-via-the-mysql-command-line-in-one-line/</guid><description>&lt;p&gt;Have a large script (like a DB dump) you want to execute from the command line in one line so you can just drop it in a batch/shell script and run with it?  Assuming MySql is on your system path, here’s the command…&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;mysql -u user -ppass &amp;lt; C:\temp\myscript.sql
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Where &amp;ldquo;user&amp;rdquo; is the username, and &amp;ldquo;pass&amp;rdquo; is the password (note, there&amp;rsquo;s no space or other delimiter between the &amp;ldquo;-p&amp;rdquo; and the password)&lt;/p&gt;</description></item></channel></rss>