新安装默认无密登录进去,设置新密码为123456
mysql -uroot -p
use mysql;
update user set password=password("123456") where user="root";
先登陆myql -uroot -p
set password for root@localhost = password('123');
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'IDENTIFIED BY '123456' WITH GRANT OPTION; //其中123456为数据库root密码
flush privileges; //使配置生效
vi /etc/my.cnf
在[mysqld]下面添加新端口: port=3308