Friday, December 28, 2007
mysql easy security.
Set password for root,
run "mysql mysql" with following statement,
mysqladmin passwordPut in /etc/my.cnf (chmod 600), so it's convenient for admin, it's not a good practice, though.
[client]For individual database, grant rights to its owner,
user=root
password=newpasswd
grant all on database1.* to 'user1'@'%' identified by 'password';If you did not record down password for root and forgot it, start mysqld with --skip-grant-tables
flush privileges;
run "mysql mysql" with following statement,
UPDATE user SET Password=PASSWORD('YOUR_PASSWORD')The restart mysqld normally.
WHERE Host='localhost' AND User='root';
exit