现在密码是空,可以用mysqladmin: mysqladmin -u root password 密码或者update user set password=PASSWORD("密码") where user='root'退出,重启数据库服务
mysql> use mysql;mysql> UPDATE user SET password=PASSWORD("123456") WHERE user='root';mysql> FLUSH PRIVILEGES;