Jump to content

connecting to sql database on internet from home


hackercompany

Recommended Posts

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.