[How to] set password for MySQL 5.5.16

Post all your tuts or request for tuts here.
Post Reply
User avatar
cassnyd
Posts: 9
Joined: Mon Oct 31, 2011 4:29 pm

[How to] set password for MySQL 5.5.16

Post by cassnyd »

I had to use google to figure this out and found the answer here:

http://www.sitepoint.com/forums/showthr ... ssword-NO)

I'll sum up what to do.

1 - open mysql console
2 - assuming you haven't set a password, just press enter on the keyboard

Next, press enter after typing each step. note commands are case sensetive. Also add the semi-colon on step 6 and 7

3 - type use mysql
4 - type UPDATE mysql.user
*5 - type SET Password=PASSWORD("YOUR_PASSWORD_HERE")
6 - type WHERE User="root";

*make sure to change YOUR_PASSWORD_HERE to your actual password

7 - type FLUSH PRIVILEGES;

8 - type exit

Now on to the next part!

9 - go to C:\wamp\apps\phpmyadmin3.4.5 , or where you installed WAMP and OPEN config.inc.php

10 - on line 16, add your password to:

$cfg['Servers'][$i]['password'] = 'YOUR_PASSWORD_HERE';

11 - save and close config.inc.php

Now go to localhost/phpmyadmin. The default name is 'root' and you should kow your password ;)

Enjoy!
stop();//in the name of love
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: [How to] set password for MySQL 5.5.16

Post by Jackolantern »

Very nice!

While keeping "root" password-less is not such a tragedy on your development machine (provided no one else uses your computer), it is absolutely vital if you are going to host your game yourself. Even on your development machine, it could prevent a script from accidentally changing something it shouldn't because you have walled-off the master MySQL account behind a password. It will also make phpMyAdmin stop complaining :D

EDIT: Oops! Used "production machine" instead of "development machine". Big difference there! Fixed it.
The indelible lord of tl;dr
User avatar
Chris
Posts: 1580
Joined: Wed Sep 30, 2009 7:22 pm

Re: [How to] set password for MySQL 5.5.16

Post by Chris »

Great tutorial! This is always a nice task for beginners to teach them how to configure programs and APIs through a command line. And you explained it step by step, keeping it nice and simple.
Fighting for peace is declaring war on war. If you want peace be peaceful.
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: [How to] set password for MySQL 5.5.16

Post by Jackolantern »

Chris wrote:Great tutorial! This is always a nice task for beginners to teach them how to configure programs and APIs through a command line. And you explained it step by step, keeping it nice and simple.
Yep, definitely a good thing to know.

As a slight off-topic aside, did you see that Windows 8 is going to have GUI-free server versions? Hello, stable server Windows!
The indelible lord of tl;dr
User avatar
cassnyd
Posts: 9
Joined: Mon Oct 31, 2011 4:29 pm

Re: [How to] set password for MySQL 5.5.16

Post by cassnyd »

Jackolantern wrote:Very nice!
...It will also make phpMyAdmin stop complaining
This is exactly why I posted this tut. People who get WAMP now are likely to face the same issue I ran into which was not being able to jump in with mysql. The newest version practically forces you to set a password before allowing you to access your localhost/phpmyadmin page. Although looking back Ithink it was because I don't allow cookies on my dev machine...
stop();//in the name of love
User avatar
Chris
Posts: 1580
Joined: Wed Sep 30, 2009 7:22 pm

Re: [How to] set password for MySQL 5.5.16

Post by Chris »

Jackolantern wrote:As a slight off-topic aside, did you see that Windows 8 is going to have GUI-free server versions? Hello, stable server Windows!
Yeah, I think I already posted about that in a thread. If the licenses aren't so expensive windows might become worth while.
Fighting for peace is declaring war on war. If you want peace be peaceful.
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: [How to] set password for MySQL 5.5.16

Post by Jackolantern »

Ohhh, not sure how I missed that then lol. Who knows? Maybe you were the one who told me about it haha! I have been known to tell people things that they told me lol.
The indelible lord of tl;dr
Post Reply

Return to “Tutorials”