MYSQL PHP connection failed

I would say both your php.ini files look okay.

Is MySQL running? :wink:

What is the call you make to mysqli_connect ?

I used my task manager to see if MySQL was running and it is.

I’m using the line from the book…

$link = mysqli_connect('localhost', 'root', 'password');

The only thing that I have changed is my password. Is this correct?

Thanks a lot for the help.

Also, I removed the semicolon from that line… why wasn’t that part of the instructions?

Couldn’t tell, I didn’t write the book :slight_smile:

But, it’s still not working?

Haha I asked myself why I was asking you that question. :slight_smile:

No it’s still not working for some reason. I went and made sure I could access MySQL through the Command Prompt with the username and password I am using and it is correct. I’ve gone through and made sure I followed all of the steps.

I am completely lost as to why this wouldn’t work now. Everything has worked to this point. It’s weird.

Sorry but I’m out. No idea why it wont work.
Anyone else an idea?

Hey thanks a lot for the help so far!

I’m sure Kevin will chime in soon. Mine and CMW’s cases are probably not the first about this!

Going to move you over to the main PHP forum where you should get more answers :slight_smile:

Hey thanks a lot. I was wondering about that but it’s now my thread lol.

I think your php.ini is not configured properly.

Can you give us more info? Two of us have posted our php.ini files. What seems wrong to make you say that?

Thanks

ScallioXTX,
First, thank you, very much, for your help.
Just one more question, however.
Are you able to get this set of instructions to work on your computer?
For that matter, has anyone? If so, what is the difference between their working environment and ours? OS, browser, configuration, what?
We are missing something, here.
Thanks, again.
CMW

I haven’t tried it on my computer, since I don’t run PHP on my windows machine.
I run it on a linux machine and I’m pretty sure that the linux machine and the windows php.ini don’t agree :slight_smile:

Well, I was reading through the PHP manual just now and I think I found your problem. It seems PHP is not able to find the libmysql.dll file (should be somewhere in your php directory).

Long explanation
In order to make PHP find this file you need put it in a directory that it is in your windows PATH.
If you don’t know what the windows PATH is you can read the section “Installation on Windows systems” on this page, where there is an explanation on the windows PATH.

Short explanation
Throw libmysql.dll in your c:\windows\system directory and restart apache (however as the php website points out this is not the recommend approach.)

ScallioXTX,
I approached this suggestion with caution and copied the libmysql.dll file into the C:/Windows as opposed to the C:\Windows\system and IT WORKED!!!
Hey, SDavis, maybe you should try this.

Thank you, ScallioXTX. You are great and greatly appreciated.

CMW what version of PHP are you running?

sdavis,

Version 5.2.10

Can you get it working?

instead of copying the libmysql.dll file to c:\windows, you can instead copy it to the apache\bin directory. this keeps your windows directory clean.

CMW It’s really late here (I’m in Iraq right now) and as I read, I fall asleep lol. I will have to try the suggestions out tomorrow. I also appreciate everyone’s help, though!

Good luck,sdavis. That is not the best place to be right now. My thoughts are with you.
Hope things work out (on all levels).
CMW

Hey thanks a lot man I appreciate it. Still no luck though.