Fmdpa Posted January 31, 2011 Share Posted January 31, 2011 I'm attempting to deploy my website, finally. I'm working on adjusting it since the server is Linux-based. But the current problem I'm having is not Linux-related. It is the simple problem of instantiating mysqli. Using "http://www.mydomainname.com" doesn't work. I've tried everything I can think of. Can you give me a sample? $db = new mysqli('host','user','pass','db'); Link to comment Share on other sites More sharing options...
justsomeguy Posted January 31, 2011 Share Posted January 31, 2011 Is the database server set up to allow remote connections? Link to comment Share on other sites More sharing options...
Fmdpa Posted January 31, 2011 Author Share Posted January 31, 2011 Yes, it has an IP address listed in the "Remote connections" panel. I assume it is the server's. Link to comment Share on other sites More sharing options...
justsomeguy Posted January 31, 2011 Share Posted January 31, 2011 That's an option in MySQL, the MySQL server needs to be configured to allow remote connections. It's a true/false option. Link to comment Share on other sites More sharing options...
justsomeguy Posted January 31, 2011 Share Posted January 31, 2011 For more information, the default port of MySQL is 3306. There happens to be a public MySQL database at ensembldb.ensembl.org. To test that connection on Windows, go to Start -> Run and type "cmd". In the prompt, type this:telnet ensembldb.ensembl.org 3306If your firewall allows access, you'll see an answer from MySQL. If that works, try your domain and see if it connects. If it doesn't work your firewall may be blocking traffic on that port. Link to comment Share on other sites More sharing options...
Fmdpa Posted February 1, 2011 Author Share Posted February 1, 2011 Ok, I figured it out and it was much simpler than I expected. When you are hosting a website, I guess the server is set up so that using 'localhost' will select your database. Thanks for your help, JSG! Link to comment Share on other sites More sharing options...
justsomeguy Posted February 1, 2011 Share Posted February 1, 2011 The name localhost always maps to the same computer it's used on. You can also use 127.0.0.1. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.