|
MySQL has good security controls, but the default installation is wide open. So, if you're doing a new installation, let's close things up before we go any further.
In the following commands, don't forget that if you changed the ports in the my.cnf file , you'll have to adjust the port numbers here.
MySQL 5.0.x:
Activate the "MySQL 50 Shortcut" we created earlier then type in:
mysql -u root -P 3350 mysql
MySQL 4.1.x:
Activate the "MySQL 41 Shortcut" we created earlier then type in:
mysql -u root mysql
MySQL 4.0.x:
Activate the "MySQL 40 Shortcut" we created earlier then type in:
mysql -u root -P 3340 mysql
(If you get the following error message:
ERROR 2003 (HY000): Can't
connect to MySQL server on 'localhost' (10061)
That means the servers didn't stay started. The most likely reason is the my.cnf file has errors in it. Go back to the Start the services step and carefully read the section about checking the Event Viewer logs.)
Once you are logged in, copy the following queries to Notepad and change NewPw to something unique. Now copy that and paste it into the command prompt window(s) you just opened.
delete from user where Host <> 'localhost' and User <> 'root';
delete from db;
update user set Password=password(' NewPw ') where User='root';
flush privileges; exit |