设置mysql密码简单示例,供初学者参考。
[root@localhost ~]# mysqladmin -u root -p password '123456' //密码设为123456
Enter password: //输入原密码
[root@localhost ~]# mysql -u root -p //进入数据库
Enter password: //输入新密码123456
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 16
Server version: 5.0.77 Source distribution
Type 'help;' or 'h' for help. Type 'c' to clear the buffer.
mysql> show databases;