advancedfuture Posted November 10, 2008 Share Posted November 10, 2008 Okay so here is the situation. I keep getting generic runaround answers from godaddy and it is extremely frustrating. So I am a web developer, and I designed a site for a customer in PHP5 and MySQL4.1 and everything was working perfect on my godaddy account. I transferred the files and database over to my clients godaddy account and the setup is exactly the same. However the database is jacked up! I have tried creating several databases all with the same problem. The query I am running against the database is SELECT DISTINCT city FROM `zip_code` WHERE state_name='$state' ORDER BY city ASC works fine on my account. However the page displays: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) The connection works no problem, or DIE is not executing on the mysql connection. To further add to the problem when I try to run that query on the database itself through phpmyadmin I get an error saying "the table does not exist"... Well thats funny, it does exist, and in fact it has 89k records in it! Why would this work no problems on my account, but on my clients account it doesnt? Godaddy support is a joke BTW, its all canned responses that dont answer your questions at all. Quote Link to comment https://forums.phpfreaks.com/topic/132080-godaddy-mysql-problems/ Share on other sites More sharing options...
trq Posted November 10, 2008 Share Posted November 10, 2008 The error you are recieving can usually be avoided by using 127.0.0.1 as the host instead of localhost if it is indeed localhost you are using. The issue however could be any number of things. /var/lib/mysql/mysql.sock not existing on the server or having the wrong permissions to name a few. Quote Link to comment https://forums.phpfreaks.com/topic/132080-godaddy-mysql-problems/#findComment-686386 Share on other sites More sharing options...
advancedfuture Posted November 10, 2008 Author Share Posted November 10, 2008 yeah unforunately its godaddy shared hosting and its not running on localhost. I am using the connection string they gave me in the toolbar, but who knows whats going on. Even godaddy doesnt know whats going on which is really lame. Im wondering if I can point the domain to my shared hosting account because they dont allow remote database connections unfortunately. Quote Link to comment https://forums.phpfreaks.com/topic/132080-godaddy-mysql-problems/#findComment-686398 Share on other sites More sharing options...
trq Posted November 10, 2008 Share Posted November 10, 2008 Im wondering if I can point the domain to my shared hosting account because they dont allow remote database connections unfortunately. Is that a question? I don't understand it. Quote Link to comment https://forums.phpfreaks.com/topic/132080-godaddy-mysql-problems/#findComment-686404 Share on other sites More sharing options...
advancedfuture Posted November 10, 2008 Author Share Posted November 10, 2008 so here is what i have done now. In an effort to tackle this another way. I have a dedicated server with server4you. I setup the database there. edited the my.cnf file to listen in on the public IP of the server. added remote access for the user via command prompt via: GRANT ALL ON dialone.* TO dialone@'%' IDENTIFIED BY '******'; restarted mysql. Now i get a connection error: Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at 'reading initial communication packet', system error: 111 in /home/content/d/i/a/dial1auto/html/dbconnect.php on line 9 Unable to connect to database! Please try again later. I've followed the remote access tutorial to a T, so I'm a bit lost as to what i need to do to get this to work. Now if i telnet to my server ip on port 3306 it connects no problem though. so I'm not sure whats up. This my dbconnect.php file: <?PHP //Connect to Database and write the URL into the profile //Connect To Database $DBhostname='xx.xx.xx.xx'; $DBusername='dialone'; $DBpassword='xxxxxxxxxxx'; $DBdbname='dialone'; mysql_connect($DBhostname, $DBusername, $DBpassword) OR DIE ('Unable to connect to database! Please try again later.'); mysql_select_db('dialone'); ?> Quote Link to comment https://forums.phpfreaks.com/topic/132080-godaddy-mysql-problems/#findComment-686487 Share on other sites More sharing options...
advancedfuture Posted November 10, 2008 Author Share Posted November 10, 2008 a little bit more info. ran a query on the users setup in mysql... all the existing ones @localhost are set to grantable. but the ones @'%' are set non grantable usage... hope that helps Quote Link to comment https://forums.phpfreaks.com/topic/132080-godaddy-mysql-problems/#findComment-686495 Share on other sites More sharing options...
goahawks56 Posted December 24, 2008 Share Posted December 24, 2008 I'm not sure if you've found a solution or not but I was having the same issues connecting. I tried 127.0.0.1, and local host with the same errors. I found that if you look at the Databases tab in your godaddy database page you will see the server IP address at the top. Use that in place of 127.0.0.1 or local host. It worked for me Quote Link to comment https://forums.phpfreaks.com/topic/132080-godaddy-mysql-problems/#findComment-723299 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.