RogerRAZ Posted June 2, 2006 Share Posted June 2, 2006 I cannot get MySQL and PHP to communicate and therefore I cannot create a simple query. I was getting the Fatal error message "call to undefined function mySQL_connect() in C:\...", but after I recently downloaded and installed a new version of Apache or maybe MySQL that error disappeared. Before downloading the new version of Apache or MySQL, when I ran the PHPInfo script I could not see an area of information regarding MySQL, but now I do. Now when I run the query, I receive the die message "couldn't connect to server" that I have entered in the script. I have enabled so many extensions and tried so many other things, I just don't know what to try next. Any suggestions? Thanks!Roger Quote Link to comment https://forums.phpfreaks.com/topic/11048-mysql-and-php-communicating/ Share on other sites More sharing options...
poirot Posted June 2, 2006 Share Posted June 2, 2006 Probably the MySQL server is not running, or is misconfigured.If you don't want to deal with this level of maintenance, you can use a ready-made "LAMP-like" package, like EasyPHP or UniformServer:[a href=\"http://www.uniformserver.com/\" target=\"_blank\"]http://www.uniformserver.com/[/a][a href=\"http://www.easyphp.org/\" target=\"_blank\"]http://www.easyphp.org/[/a] Quote Link to comment https://forums.phpfreaks.com/topic/11048-mysql-and-php-communicating/#findComment-41266 Share on other sites More sharing options...
wildteen88 Posted June 2, 2006 Share Posted June 2, 2006 Look at my thread here:[a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=87276\" target=\"_blank\"]http://www.phpfreaks.com/forums/index.php?showtopic=87276[/a]All what you need to do is enable the mysql extension which requires you to edit two lines within the php.ini nothing too complicated Quote Link to comment https://forums.phpfreaks.com/topic/11048-mysql-and-php-communicating/#findComment-41269 Share on other sites More sharing options...
poirot Posted June 2, 2006 Share Posted June 2, 2006 wildteen, MySQL is actually enabled [based on what I see].If you try to do something like:mysql_connect(...) or die(mysql_error()) it may tell you what is wrong. Quote Link to comment https://forums.phpfreaks.com/topic/11048-mysql-and-php-communicating/#findComment-41270 Share on other sites More sharing options...
RogerRAZ Posted June 2, 2006 Author Share Posted June 2, 2006 [!--quoteo(post=379434:date=Jun 2 2006, 02:17 PM:name=poirot)--][div class=\'quotetop\']QUOTE(poirot @ Jun 2 2006, 02:17 PM) [snapback]379434[/snapback][/div][div class=\'quotemain\'][!--quotec--]wildteen, MySQL is actually enabled [based on what I see].If you try to do something like:mysql_connect(...) or die(mysql_error()) it may tell you what is wrong.[/quote]poirot:The error message I receive is the following:"Access denied for user 'Roger'@'localhost' (using password: YES)"Note: One other thing I changed is the PHP.ini file is the following:extension_dir="c:/php/ext" it was extension_dir="c:\php\ext" I has seen this both ways.What do I do? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/11048-mysql-and-php-communicating/#findComment-41281 Share on other sites More sharing options...
poirot Posted June 2, 2006 Share Posted June 2, 2006 Probably because "Roger" has no privileges or maybe there's not even a user called "Roger".You must Grant privileges to this user "Roger".[a href=\"http://dev.mysql.com/doc/refman/5.0/en/grant.html\" target=\"_blank\"]http://dev.mysql.com/doc/refman/5.0/en/grant.html[/a] Quote Link to comment https://forums.phpfreaks.com/topic/11048-mysql-and-php-communicating/#findComment-41283 Share on other sites More sharing options...
RogerRAZ Posted June 2, 2006 Author Share Posted June 2, 2006 [!--quoteo(post=379447:date=Jun 2 2006, 03:26 PM:name=poirot)--][div class=\'quotetop\']QUOTE(poirot @ Jun 2 2006, 03:26 PM) [snapback]379447[/snapback][/div][div class=\'quotemain\'][!--quotec--]Probably because "Roger" has no privileges or maybe there's not even a user called "Roger".You must Grant privileges to this user "Roger".[a href=\"http://dev.mysql.com/doc/refman/5.0/en/grant.html\" target=\"_blank\"]http://dev.mysql.com/doc/refman/5.0/en/grant.html[/a][/quote]Well, I/We finally got everything to work. It is amazing how there are so many different ways people have written in books and stated about what files should go where and what needs to be enabled.Although I granted privileges to myself I had the host name set to, now don't laugh to hard, "My Computer" as oppose to localhost. I created a new User and set it up the correct way and now everything works fine. Thanks!!!!!!!!!!!!!!!!!!Roger [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /] Quote Link to comment https://forums.phpfreaks.com/topic/11048-mysql-and-php-communicating/#findComment-41308 Share on other sites More sharing options...
wildteen88 Posted June 3, 2006 Share Posted June 3, 2006 [!--quoteo(post=379434:date=Jun 2 2006, 07:17 PM:name=poirot)--][div class=\'quotetop\']QUOTE(poirot @ Jun 2 2006, 07:17 PM) [snapback]379434[/snapback][/div][div class=\'quotemain\'][!--quotec--]wildteen, MySQL is actually enabled [based on what I see].If you try to do something like:mysql_connect(...) or die(mysql_error()) it may tell you what is wrong.[/quote]Not with PHP5 isn't. As you have to enable the mysql extension in the php.ini file in order for PHP5 to use the mysql library of functions.But any way I misread the orginal post. Quote Link to comment https://forums.phpfreaks.com/topic/11048-mysql-and-php-communicating/#findComment-41435 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.