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?
MySQL Root & Password
Moderator: General Moderators
depends
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.
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.
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.
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.
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.
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.