设置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;

posted @ 2016-03-30 10:13  张同光  阅读(97)  评论(0编辑  收藏  举报