title: How to allow remote access to my database?
body: <p>I am currently accessing the database by <code>$_SESSION['connection'] = odbc_connect('Driver={MySQL ODBC 5.1 Driver};Server=localhost;Database=mysql;Option=3;', 'root', '');</code></p>
  
  <p>Apart fromt the fact that I need to get a password put on that account (and maybe even use another account than root? And probably change the databse name?), I want to write some code which I can disrtribute to be installed at several sites. </p>
  
  <p>I want to use the same code at each site, although I can't know the IP addresses in advance. How do I go about that? Do I just tell their IT guy to set a DNS trandlation for something like <code>myDatabaseServer</code> and then substitue <code>Server=localhost</code> by <code>Server=myDatabaseServer</code> in the odbc_connect() call?  Or do I need to do somehing with the ODBC manager in the Windows control panel?</p>
  
  <p>Hmmm, I should probably obfuscate or comple the code before ditributing it...</p>
  
  <hr>
  
  <p>Update: I found <a href="https://stackoverflow.com/questions/1713429/remote-mysql-access">this question</a> which said   </p>
  
  <pre><code>In your MySQL configuration file (my.cnf), you need the following at least:
  port         = 3306          # Port MySQL listens on 
  bind-address = 192.168.1.15  # IP address of your server 
  # skip-networking            # This should be commented out to enable networking
  </code></pre>
  
  <p>I presume that<code>bind-address</code> coudl be <code>myDatabaseServer</code>, so that I don't need to edit the config file for each remote site(?)</p>
  
  <p>It also said <code>GRANT ALL ON test.* TO 'root'@'192.168.1.15' IDENTIFIED BY '';</code> So that is a command that has to be run once on the databse?  But I can't know the IP adress in advance? In fact, multiple users may need access - can I wildcard it to 192.168.<em>.</em>?  Is thus really, really needed? Is there any way that I can dconfigure it once, not knowing in advance which range of netwrok addresses each user will use (I know that it sounds insecure, but could I just grant access to everyone and rely on password protection, plus no outsiders knowing that the databse is there?)</p>