hackercompany Posted June 22, 2009 Share Posted June 22, 2009 Well I am trying to connect my Online Sql database with CMS(Wordpress) present at my home. But as I was installing it I had some problems. First it was not establishing connection with my database. Like in my case of wordpress I edited the wp-config file and filled in the database location as the url of the website. As in that case was localhost(on the internet). Now the problem comes that it shows an error could not connect to database. Can any one tell me what to write in place of localhost to get me connected to the net database Quote Link to comment https://forums.phpfreaks.com/topic/163195-connecting-to-sql-database-on-internet-from-home/ Share on other sites More sharing options...
Fog Juice Posted June 22, 2009 Share Posted June 22, 2009 Well I am trying to connect my Online Sql database with CMS(Wordpress) present at my home. But as I was installing it I had some problems. First it was not establishing connection with my database. Like in my case of wordpress I edited the wp-config file and filled in the database location as the url of the website. As in that case was localhost(on the internet). Now the problem comes that it shows an error could not connect to database. Can any one tell me what to write in place of localhost to get me connected to the net database Try to make sure you have remote access to the database first. Many times mysql is setup to only accept connections from the localhost and so you will have to add your IP address to the list of permitted connections. Are you using cPanel, directadmin, or do you have phpmyadmin installed on the server? Quote Link to comment https://forums.phpfreaks.com/topic/163195-connecting-to-sql-database-on-internet-from-home/#findComment-861053 Share on other sites More sharing options...
hackercompany Posted June 22, 2009 Author Share Posted June 22, 2009 I am using cpanel. But as your are saying that I need to add my IP HOw can I do that I haven't seen any option like that in the cpanel Quote Link to comment https://forums.phpfreaks.com/topic/163195-connecting-to-sql-database-on-internet-from-home/#findComment-861059 Share on other sites More sharing options...
Fog Juice Posted June 22, 2009 Share Posted June 22, 2009 I am using cpanel. But as your are saying that I need to add my IP HOw can I do that I haven't seen any option like that in the cpanel If you are using the latest version of cPanel go to Databases -> Remote MySQL and from there add your IP address in the Host textbox and then click Add Host. You can get your ip address from http://whatismyip.com. One thing to be aware of is that your home ip address may not be static. Many ISP's charge premium for a static ip, so that means everytime your IP changes you'll have to add it to the host list (and preferably remove the old one you input last time). Also, make sure you never remove "192.168.1.%" which is in your host list by default. If you remove that, your server will not be able to connect to its databases. Quote Link to comment https://forums.phpfreaks.com/topic/163195-connecting-to-sql-database-on-internet-from-home/#findComment-861073 Share on other sites More sharing options...
hackercompany Posted June 22, 2009 Author Share Posted June 22, 2009 I think you are saying right but still I am not able to do that. I am still getting the error "Error Establishing Connection to Database" what can be the problem behind it!!! Quote Link to comment https://forums.phpfreaks.com/topic/163195-connecting-to-sql-database-on-internet-from-home/#findComment-861082 Share on other sites More sharing options...
gizmola Posted June 22, 2009 Share Posted June 22, 2009 Did you try and install the mysql command line client on your home machine, and connect to the remote database? mysql -u user -p -h youripaddress Quote Link to comment https://forums.phpfreaks.com/topic/163195-connecting-to-sql-database-on-internet-from-home/#findComment-861094 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.