Go Back   CodingForums.com > :: Server side development > MySQL

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-25-2007, 03:15 AM   PM User | #1
Troy297
Regular Coder

 
Troy297's Avatar
 
Join Date: Oct 2006
Location: Earth
Posts: 314
Thanks: 10
Thanked 0 Times in 0 Posts
Troy297 is an unknown quantity at this point
Question GoDaddy MySQL Stuff

Hey,

I have just finished making a large-scale project for a client of mine and when I went to move it over to his servers I got a little confused. He uses GoDaddy and their control panel is completely different than what I'm used to (cPanel 11)... so I need some help :P

I have successfully transfered the database over but now I can't seem to connect to it... oddly enough? Do I have to use some different kind of php connection script to connect to their databases or something? Here's what I currently use:

PHP Code:
$dbhost "h50mysql9.secureserver.net";
$dbuser "user_here";
$dbpass "password_here";
$dbname "name_here";
$db mysql_pconnect($dbhost,$dbuser,$dbpass); 
mysql_select_db("$dbname",$db); 
Is that okay? I'm not sure... a quick reply would be greatly appreciated! Thanks!
__________________
Everyone hears what you say, friends listen to what you say, best friends listen to what you don't say.
Radio DJ Panel v3 - It's Here!
Troy297 is offline   Reply With Quote
Old 05-25-2007, 03:42 AM   PM User | #2
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,292
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
I don't know if you can use pconnect on godaddy. I use mysql_connect and I'm able to connect to my database. Open the database manager to be sure you are selecting the right database. echo out mysql_error() to see if something is wrong.
__________________
||||If you are getting paid to do a job, don't ask for help on it!||||
_Aerospace_Eng_ is offline   Reply With Quote
Old 05-25-2007, 04:08 AM   PM User | #3
CFMaBiSmAd
Senior Coder

 
CFMaBiSmAd's Avatar
 
Join Date: Oct 2006
Location: Denver, Colorado USA
Posts: 2,744
Thanks: 2
Thanked 256 Times in 248 Posts
CFMaBiSmAd is a jewel in the roughCFMaBiSmAd is a jewel in the roughCFMaBiSmAd is a jewel in the roughCFMaBiSmAd is a jewel in the rough
Someone correct me if I am wrong, but godaddy runs PHP as a CGI wrapper.

If the above statement is true, then pconnect won't work as expected. I believe a mysql_pconnect would behave exactly like a mysql_connect under these conditions.

Adding the error reporting that _Aerospace_Eng_ suggested will help pinpoint if this is the case. Also, check the web server log file for errors and/or put the following two lines in after your first opening <?php tag -
PHP Code:
ini_set ("display_errors""1");
error_reporting(E_ALL); 
__________________
If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.
CFMaBiSmAd is online now   Reply With Quote
Old 05-25-2007, 09:09 AM   PM User | #4
NancyJ
Senior Coder

 
NancyJ's Avatar
 
Join Date: Feb 2005
Location: Bradford, UK
Posts: 3,162
Thanks: 19
Thanked 65 Times in 64 Posts
NancyJ will become famous soon enough
Just to probably state the obvious (you never know) did you change the username and password in your script. When you transfered the databases its probable that you didnt also transfer the users and permissions.
__________________
http://www.hazelryan.co.uk
NancyJ is offline   Reply With Quote
Old 05-25-2007, 12:12 PM   PM User | #5
Troy297
Regular Coder

 
Troy297's Avatar
 
Join Date: Oct 2006
Location: Earth
Posts: 314
Thanks: 10
Thanked 0 Times in 0 Posts
Troy297 is an unknown quantity at this point
Quote:
Originally Posted by NancyJ View Post
Just to probably state the obvious (you never know) did you change the username and password in your script. When you transfered the databases its probable that you didnt also transfer the users and permissions.
Lol - yes I did infact change the username/password/db name when I switched it, that was the first thing I checked.

As for the mysql_error reporting thanks! I will try that tonight and see what I get +rep both of you!
__________________
Everyone hears what you say, friends listen to what you say, best friends listen to what you don't say.
Radio DJ Panel v3 - It's Here!
Troy297 is offline   Reply With Quote
Old 05-25-2007, 10:15 PM   PM User | #6
Troy297
Regular Coder

 
Troy297's Avatar
 
Join Date: Oct 2006
Location: Earth
Posts: 314
Thanks: 10
Thanked 0 Times in 0 Posts
Troy297 is an unknown quantity at this point
Okay... tried echoing the error while using mysql_connect instead of pconnect and got this message:

Quote:
Client does not support authentication protocol requested by server; consider upgrading MySQL client
__________________
Everyone hears what you say, friends listen to what you say, best friends listen to what you don't say.
Radio DJ Panel v3 - It's Here!
Troy297 is offline   Reply With Quote
Old 05-25-2007, 10:25 PM   PM User | #7
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,292
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
Try this
PHP Code:
$dbhost "h50mysql9.secureserver.net";
$dbuser "user_here";
$dbpass "password_here";
$dbname "name_here";
$db mysql_connect($dbhost,$dbuser,$dbpassword) or die(mysql_error());
mysql_select_db($dbname) or die(mysql_error()); 
__________________
||||If you are getting paid to do a job, don't ask for help on it!||||

Last edited by _Aerospace_Eng_; 05-25-2007 at 10:39 PM..
_Aerospace_Eng_ is offline   Reply With Quote
Old 05-25-2007, 10:32 PM   PM User | #8
Troy297
Regular Coder

 
Troy297's Avatar
 
Join Date: Oct 2006
Location: Earth
Posts: 314
Thanks: 10
Thanked 0 Times in 0 Posts
Troy297 is an unknown quantity at this point
Still getting the error:

Quote:
Client does not support authentication protocol requested by server; consider upgrading MySQL client
Wait! and now its changed... sometimes I get this:

Quote:
Can't connect to MySQL server on 'localhost' (10061)
But thats only when I use this code:

PHP Code:
$dbhost "h50mysql9.secureserver.net";
$dbuser "user";
$dbpass "pass";
$dbname "name";
$db mysql_connect($dbhost,$dbuser,$dbpass);
mysql_select_db($dbname);
echo 
mysql_error(); 
Heres the page:
http://soulandbluesreport.com/new/index.php
__________________
Everyone hears what you say, friends listen to what you say, best friends listen to what you don't say.
Radio DJ Panel v3 - It's Here!
Troy297 is offline   Reply With Quote
Old 05-25-2007, 10:40 PM   PM User | #9
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,292
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
Just tried your original code on my godaddy account and was able to connect to the database just fine even using pconnect.

I think you need to contact godaddy.
__________________
||||If you are getting paid to do a job, don't ask for help on it!||||
_Aerospace_Eng_ is offline   Reply With Quote
Old 05-25-2007, 10:49 PM   PM User | #10
Troy297
Regular Coder

 
Troy297's Avatar
 
Join Date: Oct 2006
Location: Earth
Posts: 314
Thanks: 10
Thanked 0 Times in 0 Posts
Troy297 is an unknown quantity at this point
Okay - will do Thanks for the help!
__________________
Everyone hears what you say, friends listen to what you say, best friends listen to what you don't say.
Radio DJ Panel v3 - It's Here!
Troy297 is offline   Reply With Quote
Old 05-25-2007, 11:07 PM   PM User | #11
marek_mar
Sensei


 
Join Date: Aug 2003
Location: One step ahead of you.
Posts: 2,815
Thanks: 0
Thanked 3 Times in 3 Posts
marek_mar is on a distinguished road
The "Can't connect to MySQL server on 'localhost' (10061)" is because you check the error after the mysql_select_db() call, which attempts to connect with it's default settings (found in php.ini).
__________________
I'm not sure if this was any help, but I hope it didn't make you stupider.

Experience is something you get just after you really need it.
PHP Installation Guide Feedback welcome.
marek_mar is offline   Reply With Quote
Old 05-26-2007, 02:49 AM   PM User | #12
Troy297
Regular Coder

 
Troy297's Avatar
 
Join Date: Oct 2006
Location: Earth
Posts: 314
Thanks: 10
Thanked 0 Times in 0 Posts
Troy297 is an unknown quantity at this point
I finally figured it out!

After emailing GoDaddy Support they told me that Windows Hosting does not support PHP! I felt so stupid! But anyways... now I have to try and get my client to switch his hosting to Linux :S

Thanks for all the help!!
__________________
Everyone hears what you say, friends listen to what you say, best friends listen to what you don't say.
Radio DJ Panel v3 - It's Here!
Troy297 is offline   Reply With Quote
Old 05-26-2007, 04:16 AM   PM User | #13
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,292
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
I thought their Windows plans had support for php and asp, maybe thats just for some of them.
__________________
||||If you are getting paid to do a job, don't ask for help on it!||||
_Aerospace_Eng_ is offline   Reply With Quote
Old 05-26-2007, 04:35 AM   PM User | #14
Troy297
Regular Coder

 
Troy297's Avatar
 
Join Date: Oct 2006
Location: Earth
Posts: 314
Thanks: 10
Thanked 0 Times in 0 Posts
Troy297 is an unknown quantity at this point
Quote:
Originally Posted by _Aerospace_Eng_ View Post
I thought their Windows plans had support for php and asp, maybe thats just for some of them.
Close but not quite.... their Windows Hosting Plans only have ASP (with Access, MySql, and SQL Databases). If you want PHP, CGI, MySQL, etc. you need their Linux Hosting.

Who knew eh?
__________________
Everyone hears what you say, friends listen to what you say, best friends listen to what you don't say.
Radio DJ Panel v3 - It's Here!
Troy297 is offline   Reply With Quote
Old 05-26-2007, 06:31 AM   PM User | #15
Fumigator
UE Antagonizer


 
Fumigator's Avatar
 
Join Date: Dec 2005
Location: Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
Posts: 7,687
Thanks: 42
Thanked 637 Times in 625 Posts
Fumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of light
You're gong to want to switch hosts once you discover Godaddy is running MySQL 4.0 and has no plans to upgrade.

Quote:
Our support staff has responded to your request, details of which are described below:

Discussion Notes
Support Staff Response
Dear Randy Whitaker,

Thank you for your email. We apologize for the inconvenience, but currently we have no schedule for upgrading MySQL. Please send this suggestion to suggestions@godaddy.com as many of our products and features have either been created or improved by customer suggestions.

Please let us know if we can help you in any other way.

Sincerely,

Aris Q.
Customer Care Specialist
Customer Inquiry
Browser Info : Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6

What are your plans for upgrading MySQL to 4.1 or (preferrably) 5.0? Version 4.0 has many drawbacks I am running into; namely, subselects do not work. Do you have a schedule for upgrades?
__________________
Fumigator is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:38 PM.


Advertisement
Log in to turn off these ads.