Securing MySQL Server - setup root password
$ mysqladmin -u root password MYPASSWORD
Now try to connect server:$ mysql
Output:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)To connect to MySQL server use following syntax (when prompted for password type newly set password):$ mysql -u root -p
OutputEnter password:Now your server is secured and no one can connect to MySQL server anonymously.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4 to server version: 5.0.9-beta
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
See also:
- MySQL change root password - it covers few other methods for setting up MySQL root/admin password.
About
Your first interaction with MySQL database server


