1. mysql默认没有密码,设置root密码流程

    1. 通过 mysqld_safe --user=mysql --skip-grant-tables --skip-networking & 跳过密码验证
    2. mysql -uroot无密码登录 mysql
    3. 修改mysql密码 SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpass');
    4. 刷新权限 FLUSH PRIVILEGES;
  2. mysql允许远程地址链接

    1. use mysql
    2. GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
    3. FLUSH PRIVILEGES;