To talk on Icrontic, just register!

It only takes 30 seconds.

Have an account? Sign in:

Forgot?
Clutch
I'm the man in the box
Clutch
4,805 Posts

Arghhh mysql help

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)'
Shorty
Sniping teh enterpwise!
Shorty
9,543 Posts
Did you originally setup a password for root??

If not..

Type..

mysql -uroot

It should let you straight into MySQL..

then type :

set password for root@localhost = password ('greencow');

Clutch
I'm the man in the box
Clutch
4,805 Posts
I tried that short but now it gives me this

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
__________________ PV2 Hewett
Ft. Carson, Co
1-22 Infantry Regiment
4th Infantry Division
Shorty
Sniping teh enterpwise!
Shorty
9,543 Posts
Go into C:/mysql/bin .. and look for a file called Winmysqladmin

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
Clutch
I'm the man in the box
Clutch
4,805 Posts
Thanks for the help shorty, you are the man no doubt. I'm going to un-install mysql and try to install it agian to see if I can get it to work. I'll report back in later.
Shorty
Sniping teh enterpwise!
Shorty
9,543 Posts
Here if ya need.. I've walked a few peeps through it in recent weeks following my learning when we were just putting Short-media together
a2jfreak
madasiemanym
a2jfreak
3,351 Posts
Too bad I've never found a Windows Installer for PostrgreSQL. I'd love to try that out. The only computer I have Linux on is my laptop and that old thing ain't gonna be booted up unless I'm desparately seeking toture.

K62-333 w/ 64MB of RAM.
It's super slow!
__________________
One thing kids like is to be tricked. For instance, I was going to take my little nephew to Disneyland, but instead I drove him to an old burned-out warehouse. "Oh, no," I said. "Disneyland burned down." He cried and cried, but I think that deep down, he thought it was a pretty good joke. I started to drive over to the real Disneyland, but it was getting pretty late.
Jack Handey
[folding_sig1]Child Search Ministries.
A Christian Charity for Missing Children.

Get Firefox!
Go Back   Icrontic Forums > Tech: Software > Web & Digital Media
Jump to
This Thread Search this Thread
Search this Thread:

Advanced Search


Current time: 6:11pm (GMT)
Powered by vBulletin®
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Get Vanilla instead. Trust me.