mysql> set password for root@localhost = password('123456');
mysqladmin -uroot -p123456 password 123
mysql> use mysql;
mysql> update user set password=password('123') where user='root' and host='localhost';
mysql> flush privileges;
update user set password=password("123") where user="root";