[HELP!] MySQL Access denied

Problems with the Windows version of XAMPP, questions, comments, and anything related.

[HELP!] MySQL Access denied

Postby cpeter » 13. July 2009 06:10

There is some new "bug" that you must specify Host for new MySQL user, "Any host" won't work and will get access deny error when try to connect.

1) Fresh new install XAMPP

2) phpMyAdmin -> Create new user demo with password demo for Any host, also check "Create database with same name and grant all privileges"

3) Create test php file "demo.php"
Code: Select all
$link = mysql_connect('localhost', 'demo', 'demo');
if (!$link) {
    die('Could not connect: ' . mysql_error());
echo 'Connected successfully';

4) Browse "demo.php", get error
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'demo'@'localhost' (using password: YES) in D:\xampp\htdocs\demo.php on line 3
Could not connect: Access denied for user 'demo'@'localhost' (using password: YES)

5) Change user demo to localhost

6) Browse "demo.php", get echo
Connected successfully

This is new "bug" since XAMPP v1.7 (or 1.6x), why?
Posts: 1
Joined: 13. July 2009 06:02

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 105 guests