本机登录不上加上这个 先停止mysql 服务 添加
/bin/sh /usr/local/mysql/bin/mysqld_safe --user=mysql --skip-grant-tables
--skip-networking 跳过监听端口 启动mysql 不会启动监听接口
登录 修改mysql 密码
-- update user set password=PASSWORD("bugfree") where user='bugfree';
-- UPDATE user SET PASSWORD=MD5('123456') WHERE USER='root' and HOST='%';
远程访问
my.cnf
bind-address = 0.0.0.0 所有ip能访问
my.cnf locate my.cnf 找位置