Isidore Posted March 12, 2006 Share Posted March 12, 2006 I run a site that was recently upgraded to MySQL 5 (last week). Now this very simple script won't run:[code]<?phpecho '<p>before connection</p>';$please_connect = 1;if ($please_connect == 1){ mysql_connect ("localhost", "username", "pass") or die(mysql_error()); mysql_select_db ("dbname");} else { echo '<p>you did not ask to connect.</p>'; }echo '<p>after connection</p>';?>[/code]If $please_connect is set, then there is no output, and no error. If not, then everything prints properly.I notice that there is a new setting in 5 regarding strict mode. Would this be the culprit?It's very strange, because the site has partial availability-- some pages and the stylesheet seem to be unavaialble, but other things are still there. I'm very perlplexed.:( Quote Link to comment https://forums.phpfreaks.com/topic/4780-mysql-5-possible-problems/ Share on other sites More sharing options...
wickning1 Posted March 12, 2006 Share Posted March 12, 2006 Try resetting your password using:[code]SET PASSWORD FOR youruser@localhost = OLD_PASSWORD('yourpw')[/code]See this for more information: [a href=\"http://dev.mysql.com/doc/refman/5.0/en/php.html\" target=\"_blank\"]http://dev.mysql.com/doc/refman/5.0/en/php.html[/a] Quote Link to comment https://forums.phpfreaks.com/topic/4780-mysql-5-possible-problems/#findComment-16804 Share on other sites More sharing options...
fenway Posted March 12, 2006 Share Posted March 12, 2006 The old pasword issue is from 4.0 to 4.1+ -- but that usually results in a "client doesn't support authentication" error. So if there's no error, there's something else going on here. Quote Link to comment https://forums.phpfreaks.com/topic/4780-mysql-5-possible-problems/#findComment-16810 Share on other sites More sharing options...
wickning1 Posted March 12, 2006 Share Posted March 12, 2006 Some people upgrade from 4.0 to 5.0, but you're right, it should be spitting out an error. Something must be crashing the thread because it should be printing the "after connection" part no matter what. Quote Link to comment https://forums.phpfreaks.com/topic/4780-mysql-5-possible-problems/#findComment-16816 Share on other sites More sharing options...
Isidore Posted March 13, 2006 Author Share Posted March 13, 2006 [!--quoteo(post=354331:date=Mar 12 2006, 06:38 PM:name=wickning1)--][div class=\'quotetop\']QUOTE(wickning1 @ Mar 12 2006, 06:38 PM) [snapback]354331[/snapback][/div][div class=\'quotemain\'][!--quotec--]Some people upgrade from 4.0 to 5.0, but you're right, it should be spitting out an error. Something must be crashing the thread because it should be printing the "after connection" part no matter what.[/quote]That's the not-so-funny part. It doesn't even print the stuff before the connection.And that old password stuff, this is on a shared host that uses cPanel, so setting the password isn't a problem.Thanks for your help. Quote Link to comment https://forums.phpfreaks.com/topic/4780-mysql-5-possible-problems/#findComment-16852 Share on other sites More sharing options...
wickning1 Posted March 13, 2006 Share Posted March 13, 2006 Let's try this and see what happens. Put "error_reporting(E_ALL);" at the top of your script, and remove the "or die()" from the mysql_connect() call. Quote Link to comment https://forums.phpfreaks.com/topic/4780-mysql-5-possible-problems/#findComment-16855 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.