title: How can I a call stored procedure on a remote MySQL Ubuntu server?
body: <p>I have an Ubuntu server with MySQL and many Stored Procedures (server A) and another Ubuntu server with MySQL (server B).</p>
  
  <p>I'd like to populate the database on server B with data from the stored procedures on server A.</p>
  
  <p>At this point I'd like to test the connection with no success.</p>
  
  <p>I tried this on server B:</p>
  
  <pre><code>mysql&gt; EXEC server_A_IP.DB_name.username.sp_courses();
  </code></pre>
  
  <p>But it gives this error:</p>
  
  <blockquote>
    <p>ERROR 1064 (42000): 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 'EXEC
    server_ip.db_name.owner.sp_courses()' at line 1</p>
  </blockquote>
  
  <p>This is an example of what I'd like to do eventually:</p>
  
  <p>On server B I have this table:</p>
  
  <pre><code>mysql&gt; describe Course;
  +-------+-------------+------+-----+---------+-------+
  | Field | Type        | Null | Key | Default | Extra |
  +-------+-------------+------+-----+---------+-------+
  | CID   | int(11)     | NO   | PRI | 0       |       |
  | name  | varchar(50) | YES  |     | NULL    |       |
  +-------+-------------+------+-----+---------+-------+
  2 rows in set (0.00 sec)
  </code></pre>
  
  <p>The Stored Procedure on Server A returns data like this:</p>
  
  <pre><code>call sp_courses();-- where the parameter indicates level 1.Returns [courseID, name]
  
  1   CS1
  2   CS2
  10  CS3
  12  CS4
  13  CS5S
  </code></pre>
  
  <p>Can I fill data into the table from stored procedure on a different server?</p>