Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MYSQL Rights and Passwords

Status
Not open for further replies.

rjseals

Technical User
Nov 25, 2002
63
US
Hello,
I just installed MYSQL on a windows machine and everything seems to be working fine except I cant set passwords to any accounts or basically any username can log in (even if I didnt create it). For instance I will type

>mysqladmin -u root password newpassword
and then
>mysql -u root -p
then I will type in the password I just gave it and it says access denied. but when I do the same command and dont enter a password I can get in without any problems.

Also i can put in anything for a user name and get into it. The reason this is such a problem is because I am going to use phpMyAdmin and dont want everyone in the world to get into my database. I have set up MYSQL on Linux and didnt have this problem.

Any suggestions?

Thanks
 
RTFM "
The default privileges on Windows give all local users full privileges to all databases without specifying a password. To make MySQL more secure, you should set a password for all users and remove the row in the mysql.user table that has Host='localhost' and User=''.

You should also add a password for the root user. The following example starts by removing the anonymous user that has all privileges, then sets a root user password:

C:\> C:\mysql\bin\mysql mysql
mysql> DELETE FROM user WHERE Host='localhost' AND User='';
mysql> QUIT
C:\> C:\mysql\bin\mysqladmin reload
C:\> C:\mysql\bin\mysqladmin -u root password your_password
After you've set the password, if you want to shut down the mysqld server, you can do so using this command:

C:\> mysqladmin --user=root --password=your_password shutdown
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top