Page 1 of 1

[How to] set password for MySQL 5.5.16

Posted: Thu Nov 03, 2011 4:08 pm
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!

Re: [How to] set password for MySQL 5.5.16

Posted: Thu Nov 03, 2011 10:07 pm
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.

Re: [How to] set password for MySQL 5.5.16

Posted: Fri Nov 04, 2011 3:01 am
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.

Re: [How to] set password for MySQL 5.5.16

Posted: Fri Nov 04, 2011 3:33 am
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!

Re: [How to] set password for MySQL 5.5.16

Posted: Fri Nov 04, 2011 3:26 pm
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...

Re: [How to] set password for MySQL 5.5.16

Posted: Fri Nov 04, 2011 3:50 pm
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.

Re: [How to] set password for MySQL 5.5.16

Posted: Fri Nov 04, 2011 8:18 pm
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.