LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   MySQL Connect problems (https://www.linuxquestions.org/questions/programming-9/mysql-connect-problems-435096/)

vnb400 04-23-2006 07:48 AM

Hi

i made the following change to the /etc/php.d/mysql.ini

original was
extension=mysql.so

extension=/usr/lib/php/modules/mysql.so

now it works, was this the problem, i would like to think so.

anyway thanks to all who replied.

vnb400

graemef 04-23-2006 08:10 AM

Hi,

You said that it is working so that is great! There are two ways to get an extension in php, the windows approach is to load the extension, whilst the typical Linux approach is to compile it into the code. However since your system has the library it can be loaded, which is what you have just done with that change.

The .ini file has a directive called extension_dir you can set that up to the path of your extensions meaning that, so long as all your .so files are in the same directory you will not need to change the extension part of the ini file. Giving you something like:

extension_dir="/usr/lib/php/modules/"

...

extension=mysql.so
extension=mysqli.so

vnb400 04-25-2006 03:16 AM

Hi

It seems that specifying the location of .so file was not the actual problem.

Next day after after i had succeded i get the connect to MySQL, i tried it again and it got stuck again on the line mysql_connect("", "" "").

So i did the one thing i am good at, re-installed Linux O/S afresh and it worked the first time i tried , but on the next try it again go stuck on mysql_connect("", "", "");

The only reason this ccould be happening is maybe due to the connection not being closed. Is that possible, funniest thing is even if i reboot again it still does not work.

Any helpful advice is welcome.

vnb400

zeitounator 04-25-2006 04:06 AM

The helpfull advice was already given in this thread. You are using fedora core 4 (you should put that in your profile by the way so that can be seen instantly). Guessing
  • you use 'yum' as your package manager
  • 'yum' is configured correctly
In a shell logued in as root type:
Code:

yum install php-mysql
done.

smallville 04-26-2006 01:41 AM

add this i your connect line

or die(mysql_error());


so the whole line will look like this

mysql_connect("host","password", "root") or die(mysql_error());


then, it will show what's the real error... if you can't solve it, try posting it here again and we'll see what we can do...

smallville 04-26-2006 01:43 AM

sorry not like that but like this ;-)

mysql_connect("host","user", "password") or die(mysql_error());


All times are GMT -5. The time now is 10:35 AM.