Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Can't get MySQL working with XAMPP

Newbie struggles



11:29 am on Nov 15, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

I installed XAMPP and set a password and username for MySQL. The service is running, but the following problems are occuring:

1. When trying one of the XAMPP demos, a CD Collection, I get an error:

"Warning: mysql_connect() [function.mysql-connect]: Access denied for user '*****'@'localhost' (using password: YES) in C:\Program Files\xampp\htdocs\xampp\cds.php on line 65

Could not connect to database!
Is MySQL running or did you change the password?"

I changed the password initially for security reasons, as advised. I also restarted MySQL from the XAMPP Control Panel. Or do you need to reboot?

It picks up the username and password in the MySQL admin screen, and I've entered the details into the file cds.php as mentioned above, but it still fails.

2. Going into phpMyAdmin, it gives this error:

"phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in config.inc.php and make sure that they correspond to the information given by the administrator of the MySQL server.

Cannot connect: invalid settings."

But I have followed the instructions and entered the username and password in the file config.inc.php.

The only thing I'm not sure about is the setting for auth_type - should I use http, config or cookie? I have set it to config as that requires a password. (It was set to http but that didn't work at all.)

Also, in the MySQL admin screen, I'm not seeing many details shown - nothing for a database or table rows is listed. Do I need to set up a database first, before running any demos? If so, how? I couldn't see any options for doing this anywhere.

I assume I need phpMyAdmin but I can't get it to work!

Also it says under MyODBC "Not Found. Driver 3.51". Am I missing an important file?

Please help this MySQL newbie any way you can...


2:11 pm on Nov 15, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

OK, got it to work. Found a text file that had the username as "root", not the one I'd chosen. So I changed the relevant files to use root instead and now I can log in to phpmyadmin, and the demo works!

But why do you have to use root? Why can't you set your own username? I can't imagine root is very secure!

Note: I've set the whole package to only work on my machine, so no-one else can access the server from the net. The XAMPP directory is also password protected.

JAB Creations

7:01 pm on Nov 15, 2005 (gmt 0)

WebmasterWorld Senior Member jab_creations is a WebmasterWorld Top Contributor of All Time 10+ Year Member

Got it Hester? I came as soon as I got the sticky. Hows it running now?


9:40 pm on Nov 15, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

Great! I'm just confused over what settings to use for the MySQL username. But since I don't know a thing about using MySQL yet, it's not something to worry about too much.

Hard to believe XAMPP installs in only a few minutes! Then you have PHP 4, PHP 5, all the latest versions, SQL Lite, etc, etc, etc!

Love the demos - generate Flash, PDF, Excel on the fly!

Best of all, I've been able to work with PHP all day and not worry about connecting to another server, nor the FTP connection breaking down. All I have to do is save my work in the correct local folder, then just refresh the browser! It's much faster that way.

Now I don't need to build that Linux PHP server I was going to build from an old PC. Instead, I'm thinking of making it into an MP3 server for the living room.

Thanks for recommending XAMPP! I did find an older thread at WebmasterWorld in a Google search, where I was asking about it in 2004, but the thread didn't carry on. Since I didn't get enough answers to my questions back then, I forgot about it. I should have installed it years ago - running PHP locally is great!

Now to learn MySQL... those tables in phpMyAdmin sure look complicated...

JAB Creations

4:31 am on Nov 16, 2005 (gmt 0)

WebmasterWorld Senior Member jab_creations is a WebmasterWorld Top Contributor of All Time 10+ Year Member

I found Xampp when I was trying to figure out how to locally run PHP. I also use it to custom mod my awstats to detect browsers and spiders. Sometimes I'll delete the output and tweak for a single month several times on access logs over 120mb and my host isn't thrilled about me doing that, plus its faster (about 20 seconds as opposed to 15 minutes on the server).

You're just a little ways ahead of me in poking through MySQL. I took a look at it but decided I wasn't quite finished with clientside.

I suggest buying the Visual Quickstart Pro "PHP and MySQL" by Larry Ullman. His book is as clear as I've read of any so far (though not clear enough for me completely) and his site has the scripts online...

I'll probally learn about creating a membership system based off of PHP and MySQL by adapting his script. I guess you're up to something like that? Basically content control with MySQL and a little extra PHP added I suppose. A stepping stone in to the world of databases and modest level serverside. What do you intend to work on with MySQL? I haven't gotten


2:53 pm on Nov 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

To be honest I don't need MySQL right now, but it's something I should learn. We weren't allowed to use it a while back so I learnt how to create databases from flat files instead. Fully functioning, enough to build a forum for our intranet!

It'll be good to play around with MySQL locally, using XAMPP, and not have to worry about making a mess. I'm sure the basics are very easy to learn, and it looks like quite advanced queries are also possible.


Featured Threads

Hot Threads This Week

Hot Threads This Month