title: How to connect remote mysql database in Ubuntu using Mono and XSP
body: <p>first, I install mono, xsp server, mysql-server, mysql-client in Ubunut. In my C# code, I use the following connection.</p>
  
  <pre><code>const string constr = "Server=localhost;" +
            "Database=test;" +
            "User ID=root;" +
            "Password=root;" +
            "Pooling=false";
  </code></pre>
  
  <p>Then, I publish the project in Windows visual studio C# project. Then copy these files to Ubuntu <code>/home/sea/web_host</code>   I also import the database to Ubuntu, and make the database as localhost.</p>
  
  <p>In Ubuntu, I run</p>
  
  <pre><code>sea@virtual-machine:~/web_host$ xsp --port 8125
  xsp4
  Listening on address: 0.0.0.0
  Root directory: /home/sea/web_host
  Listening on port: 8125 (non-secure)
  Hit Return to stop the server.
  </code></pre>
  
  <p>In my browser, I can see the webpage using <code>localhost:8125/index.aspx</code>
  However, the web cannot connect to the database. I have already imported the data into MySQL database in Ubuntu and I can view them in the Ubuntu MySQL workbench. But the web cannot access MySQL database.</p>
  
  <p>What is the problem?</p>