SitePoint Sponsor |
|
User Tag List
Results 1 to 6 of 6
-
Feb 11, 2005, 13:29 #1
- Join Date
- Jul 2003
- Location
- London
- Posts
- 189
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
create database problem (and almost solution!)
hi guys, thanks for the help with my last query.
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
thanks so much
JP
-
Feb 11, 2005, 13:53 #2
-
Feb 12, 2005, 09:31 #3
- Join Date
- Jul 2003
- Location
- London
- Posts
- 189
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
hey i think i log in as just mySQL
i use a php program and it logs in as such:
$host="localhost";
$user="";
$password="";
how do i log in as root via this way or another way?
Thanks again - ill be glad to sort this out so i can do something!!
JP
-
Feb 12, 2005, 13:50 #4
- Join Date
- Oct 2003
- Location
- St. Catharines, ON Canada
- Posts
- 1,708
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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.
-
Feb 12, 2005, 18:48 #5
- Join Date
- Jul 2003
- Location
- London
- Posts
- 189
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
thanks so much dave
i am using my machine. I went to the sql manual and tried to follow info fromt his page:
http://dev.mysql.com/doc/mysql/en/adding-users.html
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)
-
Feb 13, 2005, 15:43 #6
- Join Date
- Jul 2003
- Location
- London
- Posts
- 189
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
anyone got any idea? its a nightmare not being able to create a database but everything i try doesnt work!
Bookmarks