title: How can I execute "source FileName.sql" in a python script?
body: <p>I would like to execute the MySQL query <code>source FileName.sql</code> in a Python script on Linux.</p>
  
  <p>I am able to execute other queries like <code>SELECT * FROM table_name</code> but this one is giving an error. I am executing this on a Linux server with a MySQL database using Python. The frontend I am using is Putty.</p>
  
  <p>The Python script I have used is:</p>
  
  <pre><code>import MySQLdb
  db = MySQLdb.connect("hostname","username","pswrd","dbname")
  cursor = db.cursor()
  cursor.execute("source FileName.sql")
  db.close()
  </code></pre>
  
  <p>How can I execute the query <code>source FileName.sql</code> on the location where this file-> <code>FileName.sql</code> is located?</p>