Page 1 of 1
MySQL Root & Password
Posted: Fri Jun 13, 2003 5:38 pm
by soundbwoy
OK I set up MySQL and then ran winmysqladmin right away and it created my new .ini file and I entered in Username & password I used:
username: "root"
Pasword: "MyPassword"
Now when I try and get in using MySQL Promt:
mysql -u root -p
PASSWORD: MyPassword
It denies me access But if I do the same thing and just hit enter when the password comes up I get in. How do I make it always ask me for password? Why do I have to leave the password off?
I even checked my my.ini file and the password I entered is there? Whats going on?
depends
Posted: Fri Jun 13, 2003 10:12 pm
by yamokosk
I believe that it depends on where you are connecting to your DB, either from localhost or not. And you can set the password for each. So you can have:
root@localhost -> no passwd
root@* (from anywhere else) -> Mypasswd
So i would guess that there is no password set for root@localhost? But then I am also not an expert.
You said you have a windows machine? Download and install the mySQL Control Center from mysql.com. It adds a nice graphical interface to mysql. Or phpmyadmin is also really really good if you have php up and running.
Posted: Sat Jun 14, 2003 2:25 am
by soundbwoy
Yeah I guess I just need to specify @localhost when I create the user & pass?
I know about MySQLCC & PHPMAdmin, Im actually writing a tutorial on installing PHP & MySQL, but can't figure out why it doesn't use my password i sepcified using winmysqladmin. Just trying to find out how to set up user & pass without using MySQLCC or PHPMyAdmin. From commad line right when I get done installling.
Posted: Sat Jun 14, 2003 1:21 pm
by soundbwoy
Still trying to figure out how to set up root@localhost so that when I log into MySQL Prompt it asks me for a password. I need to know how to do it in Command Line.
Posted: Sat Jun 14, 2003 1:33 pm
by soundbwoy
Here we go. Once you install MySQL the first thing you should do is set the root@localhost password, because it is the one used when logging into MySQL Prompt using root. Correct me if Im wrong..
mysql> SET PASSWORD FOR root@localhost=PASSWORD('rubberchicken');
Otherwise you won't have to use a password to get into MySQL. Im still confused as to what the other root is for and why winmysqladmin asked me to change the password when I launched it. Right after installing. So the password that is in you my.ini file is not necessarily the pasword for root? Please help me understand someone.