Arghhh mysql help
Clutch
North Carolina New
I'm trying to set up mysql on my computer to start learning php, but I can't set the root password. I have typed all the commands in to set it but when I go to type in the password I set I get this
C:\>c:\mysql\bin\mysqladmin -u root -p greencow
Enter password: ********
c:\mysql\bin\mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: 'root@127.0.0.1' (Using password: YES)'
C:\>c:\mysql\bin\mysqladmin -u root -p greencow
Enter password: ********
c:\mysql\bin\mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: 'root@127.0.0.1' (Using password: YES)'
0
Comments
If not..
Type..
mysql -uroot
It should let you straight into MySQL..
then type :
set password for root@localhost = password ('greencow');
C:\>c:\mysql\bin\mysqladmin -u root -p redhorse
Enter password: ********
c:\mysql\bin\mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: 'root@127.0.0.1' (Using password: YES)'
at first when I installed mysql I got rid of the annonymous account then typed in
c:\mysql\bin\mysqladmin -u root password my_password
c:\mysql\bin\mysqladmin -u root -h localhost password my_password
to set up the root account with a password
but I get the same error message over and over
Open it and it will move to the system tray. Open it and edit the my.ini file... to reflect the change. Alternatively.. look in the C:/windows directory for the file and edit it in notepad/wordpad.
A useful tip after you have done this.. reboot the machine and then... when you need to access mysql.. use the -p flag.. but without putting in your password.. so it looks like this..
mysql -uroot -p
It will then ask you for the password
Here is how I setup MySQL... for future reference..
1) Install MySQL
2) Open a DOS window and navigate to C:/mysql/bin
3) Type : mysql -uroot
4) The prompt will change to say mysql>
5) Type set password for root@localhost = password ('password');
6) Exit
Then when you create your db's.. do this..
1) Dos window... and navigate to c:/mysql/bin
2) Type mysql -uroot -p
3) enter password
4) At mysql> prompt type : create database new;
5) Grant all priveleges on new.* to newuser@localhost;
6) set password for newuser@localhost = password ('password');
7) Exit
That creates a db called "new" (or whatever you would prefer).. creates a user with all privileges called "newuser" who can only access the "new" db. It also sets a password.
Edit... btw.. the ('password') is what you want it to be.. eg... ('clutch') or ('sqlisgreatbutconfusing')
This whole process enables a recommended security tip. Avoid using root as a default user as much as possible
K62-333 w/ 64MB of RAM.
It's super slow!