A horsie named bruceaj demonstrated surprising intellligence and its
ability to use morse code on Sun, 07 Sep 2003 22:21:44 -0500 when it
tapped <3f********@news1.prserv.net> with its hoof:
Okay. I created a new user with a password on my XP machine and issued
the following command under mysql,
Grant all on *.* to newuser@localhost identified as "newpw";
and got the same error, ERROR 1045: Access denied for user"
'@localhost' (Using password: NO)
I don't use WinXP, but I'm assuming that the situation
is similar to my Slackware Linux machine.
The operating system's list of users is completely
separate from mysql's list of users. The fact that
you logged in to XP as an administrator does not
carry over to mysql. You would have to log into
mysql's administrator account(s) to create new users.
On my Slackware system, the only such account is
called "root"; this root account is completely separate
from the OS root account.
Read up on the GRANT command in the mysql manual, and
also read the section on privileges.
You probably want to create a user for php. You probably
do *not* want that user to have all powers. You probably
do *not* want that user to have access to all databases.
The grant command you gave above would give "newuser" all
rights to all databases. And so if someone compromised
the "newuser" account, they could change the passwords
of all accounts and lock you out of your db server. They
could also SHUTDOWN the server.
Instead, create the database and its tables under the
root user; then create a "newuser" with limited rights
*only* to that database.