Jump to content

[SOLVED] Accessing mySQL Database From Another Website


Recommended Posts

Yes as long as the firewall is configured to have the port open (usually 3306) and the user is allowed access. On my system I created a user id specific to the server that is coming in. Say you are calling the mysql server from 192.168.1.75 then on the mysql server you create a user of username@192.168.1.75 and give it permission to access the table it needs access to.

 

Hope this helps

Steve

 

Hey,

 

Thanks for the reply. I'm not sure how to create a user like user@ip, but heres what I get after replacing localhost with the IP.

 

 

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'blah_edward'@'66.147.240.179' (using password: YES) in /home7/public_html/ipodtouchmaster/db test.php on line 5

Access denied for user 'blah_edward'@'66.147.240.179' (using password: YES)

 

Do you know if this is an indication of the firewall not being open, and do you know how I can check?

 

Thanks.

Thanks again for my newbie questions.

 

That's alright, thats not my real username ;)

 

I use cPanel to create my users, and I'm not sure how to create the user with the IP. The user has appends the cpanel username underscore database user, and truncates after a certain limit - I believe it's 8 letters. Thoughts?

This should do it (Thanks to Google, I am on a Windows server)..

 

CREATE USER 'new_username'@'localhost' IDENTIFIED BY 'password_for_new_username';

GRANT ALL ON *.* TO 'new_username'@'localhost';

 

I am not sure about the permissions.. I dont think you need to grant that much access but you should be able to google it and figure it out.

 

Steve

 

 

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.