Windows XP and MySQL install nightmare


I am trying to install MySQL on a Windows XP Home Machine SP2 and it is not working at all I am getting various error messages....

I also have the latest versions of PHP 5 and Apache installed, they are both working together fine.

I was trying to install MySQL... I can get it installed but I get various error messages

10006 or a 10016 cannot connect to database  

a security error number 1045 security settings could not be applied access denied for user 'root'@localhost' (using password:NO)

this makes no sense to me

everytime I try to get this script to work it says cannot connect to MySQL

<head> <title>MySQL Connection Test</title> </head>

$connection=mysql_connect( "localhost", "root", "" )
or die( "Sorry - unable to connect to MySQL" );
echo( "Congratulations - you connected to MySQL" );
</body> </html>

the book I have tells me to install the my.cnf file which you cannot do it identifies it as a speed dial or something to that affect. when you use the auto configuration it generates an ini file called my.ini according to other websites other then mysql's it should be my.ini not my.cnf as they tell you on the mysql site....

I am completely lost and confused at this point can anyone help I need to get this working

LVL 21
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

UmeshMySQL Principle Technical Support EngineerCommented:

[taken from NET]

This simply means that your username or password are incorrect. If you have not changed the username, try using 'root' as the username and no password. If that works, then you are ok. Otherwise, you need to find the correct username / password combination OR set the proper permissions for that particular user to that database.

Check here for more..

I just installed Apache/PHP5/MySQL on my Windows PC with XP Home OS. I followed the Tut Installing PHP under Windows by Matthew Phillips Referred to in the Post: Easy to understand Apache/PHP/MySQL install on XP box

This worked OK aside from a couple obvious differences. I had the most troube getting MySQL configured with PHP and had to do some searching to find the answer. Here is what I had to do to get it working.

In the Apache httpd.conf File at 'C:\Program Files\Apache Group\Apache2\conf\httpd.conf' You have to add these lines for PHP5

LoadModule php5_module php5apache2.dll
AddType application/x-httpd-php .php

In addition to installing MySQL etc. I had to do this to get MySQL to work:

1. Make sure that you have a valid php.ini in your windows directory.
OR (Per the tut the 'php.ini' can be installed in the 'C:\Program Files\Apache Group\Apache2' folder. This works fine.)
2. copy libmysql.dll to the system32 directory (php_mysql.dll would not load without doing this)
3. set the extension_dir in php.ini to the ext directory of your PHP installation directory (like e.g. extension_dir=C:\php5\ext)
4. enable the MySQL extension in php.ini by uncommenting the line extension=php_mysql.dll
5. Restart Apache Server

For complete how to check this..
SP2 breaks winodows networking maybe thats also causes your grief

If you can try it on a windows sp1 pc  
briancassinAuthor Commented:
Ok I tried what you said and now when I start Apache I get
PHP startup: Unable to load dynamic library 'C:\php\ext\php_mysql.dll' - the specified procedure could not be found.

However apache still starts successfully... and I can see the php info however now if I try the mysql test I get nothing it is like nobody is home nothing happens no error no nothing....
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

briancassinAuthor Commented:
I did this "copy libmysql.dll to the system32 directory" and this is when I got the message above    
briancassinAuthor Commented:
error 2003 <HY000> can't connect to MySQL Server on localhost if I try to run the MySQL administration from the command prompt
briancassinAuthor Commented:
This is a mess...... MySQL's documentation on their site is awful and cryptic, PHP's info is scattered and Apache is about the only one that has some information and direction.
try removing apache and reinstall it with php at the same time that should fix php imho
with php 5.0.2 and mysql 4.1.7 there are some problems using php_mysql extension. you should use the php_mysqli extension.
see the sample code at :
you can also use the php_mysqli extension with the latest versions of phpmyadmin
briancassinAuthor Commented:
psadac I do not know enough about mySQL to have much of an idea of what you are talking about.... I guess I have 3 options as I see it as this point

I have already uninstalled and reinstalled everything however MYSQL Admin is working but the rest of MYSQL seems out to lunch no matter how many different scripts I try with examples none of them seem to work yet MYSQL admin interface says everything is FINE..... PHP and Apache seem to be working the script to run the phpinfo keeps comming up with the information on PHP like it should so I would say Apache and PHP are fine. MySQL I heard lots of good things about but I must say at this point I am not the least bit impressed they have no FAQ's troubleshooting information etc... how do they expect someone to figure out how to make their software work if that person has never worked with it before ???

Unless anyone has any other ideas these are my options I see

1. Give Up on installing this configuration on Windows until someone comes out with some uniform documentation but I don't forsee that happening because this kind of a setup is seen much more on a linux box.

2. Install it on Linux and run it from Linux

3. Find the following versions of PHP MYSQL and APACHE and hope they all work together since it seems the book I bought is based on slightly older versions then the current ones available.... which this book so far has been a waste of my time and money.... they even have the wrong info. in the book stating that the my.ini is my.cnf - not in windows it will not work as a cnf file.   at any rate here are the versions

Apache 1.3.31
MYSQL 4.0.18
PHP     5.0.0 - final release version

the book I have can be found here - PHP 5

the versions I have been trying to use are:

Apache 1.3.33
MySQL  4.1
PHP    5.0.2
ok, i say that if you use mysql 4.1.X you will have some problem with php_mysql.dll extension and you should use php_mysqli.dll instead. in your php.ini you should see :

extension_dir = "c:\php\ext"
extension = php_mysqli.dll

and in your phpinfo() you should see a mysqli extension. the problem with the mysqli extension is that you have to rewrite your code, the syntax is very close to mysql but there are some differences in the connection process (see the link i posted above)
if you have many applications that use the php_mysql extension you should stay with mysql 4.0.22, update your code to work with php_mysqli, and finnally update to mysql 4.1.7.
briancassinAuthor Commented:
I tried this on an XP Pro Machine (clean install) and it worked fine apparently either my firewall, anti virus or the fact that it is home and cannot assign certain permissions to the folders, and files in MYSQL seems to have caused the problem. At any rate it was isolated to being the O.S. and specific machine it was on.
Closed, 500 points refunded.
Friendly Neighbourhood Community Support Admin

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
MySQL Server

From novice to tech pro — start learning today.