I'm sort of up and running now with mySQL on WinXP. While I can do lots with mySQL I seem unable to create a new database so I'm currently stuck with the test one.
I get an: Error 1044: Access denied for user: '@localhost' to database...
when I try and create a new db. I think (thorugh some fishing about) that its because I have not set a password on mySQL root (what is root by the way).
I tried to do this but failed. is there an easy way to do this or get round this problem. I'm working off localhost
When you log in do you actully log in as root?
mysql -u root
and just
mysql
are different. The latter logs you in as an anymous user that may have privileges to log in but not create tables etc.
Are you doing this on your own machine? I would guess so, but if not logging on as any user or root without a password isn't very secure.
Look up in the manual how to GRANT a user privileges in the database including setting a password for them. Then use a user you specifically set up with the user and password you gave them when you are testing from a PHP application.
For some reason the default in mysql setup is to allow any user to connect from anywhere without a password.
but got this error message? I'm not sure what to do now...
mysql> --user=root mysql
mysql> grant all privileges on *.* to 'myname'@'localhost'
-> identified by 'mypassword' with grant option;
ERROR 1045: Access denied for user: '@localhost' (Using password: NO)
Bookmarks