flamey Posted February 11, 2007 Share Posted February 11, 2007 I'm writing C# application to assist me with my website. I want to connect from it to mySQL DB on my hosting account to work with my data. MySQL has a free module I can use to work with mySQL databases, but to connect to it i need an IP/host adress of the server where mysql db is (along with the other data i already know). when I connect from my Perl/php scripts i specify "localhost", but this isn't local. Where can i find out this address? Thanks in advance! Quote Link to comment Share on other sites More sharing options...
TCH-Andy Posted February 11, 2007 Share Posted February 11, 2007 You should be able to use your domain name, or the IP address of the server. Remember to allow remote access in cpanel ( in the mysql databases section) Quote Link to comment Share on other sites More sharing options...
flamey Posted February 11, 2007 Author Share Posted February 11, 2007 ok, thanks for the reply! i also got an answer in chat session. i'll give it a try and be back if i have any issues Quote Link to comment Share on other sites More sharing options...
flamey Posted February 11, 2007 Author Share Posted February 11, 2007 Remember to allow remote access in cpanel ( in the mysql databases section) im getting: Exception: Access denied for user 'my_username'@'blah-blah.my_net_provider.net' to database 'my_database' then I added %.my_net_provider.net to Access Hosts (thats what you ment, right?), but im still getting the same err, only now its ... @'%.my_net_provider.net' ... Quote Link to comment Share on other sites More sharing options...
TCH-Bruce Posted February 11, 2007 Share Posted February 11, 2007 Enter your IP address in the Access Hosts section in cPanel under MySQL databases. Quote Link to comment Share on other sites More sharing options...
TCH-Andy Posted February 11, 2007 Share Posted February 11, 2007 or just put a % in there - and nothing else, which will allow access from anywhere - but should let you test. Quote Link to comment Share on other sites More sharing options...
flamey Posted February 11, 2007 Author Share Posted February 11, 2007 (edited) nope getting the same thing. i just now also tried to connect from a perl script, but got exactly the same error. i tripple checked the user name, pass, and DB name, besides i know they're right cause i copy'pasted it from config file of script thats uses it from the server. IP was given to me in chat session w/ TCH, and i ran whois on my domain - matches. the connection string im using in C# is "server=72.18.xxx.xxx;uid=mylogin_user;pwd=mypass;database=mylogin_testdb" for perl: # database information my $db="mylogin_testdb"; my $host="72.18.xxx.xxx"; my $userid="mylogin_user"; my $passwd="mypass"; my $connectionInfo="dbi:mysql:$db;$host"; # make connection to database my $dbh = DBI->connect($connectionInfo,$userid,$passwd); i also tried different DBs, and i only have one user for all my DBs. do i also need to specify port? what would that be? Edited February 11, 2007 by flamey Quote Link to comment Share on other sites More sharing options...
TCH-Andy Posted February 11, 2007 Share Posted February 11, 2007 port 3306 Quote Link to comment 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.