文章来源:http://jingyan.baidu.com/article/fec7a1e5f8d3201190b4e782.html
-
开启3306端口并保存
/sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
/etc/rc.d/init.d/iptables save
END
修改密码并设置远程访问
-
1
连接mysql数据库
设置密码
use mysql;
update user set password=password('密码') where user='root';
flush privileges;
-
-
-
2
设置Mysql远程访问
grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option;
END
解决Mysql乱码问题
-
找一个配置文件,复制到/etc/目录,命名为my.cnf
(有时候没有my.cnf)
cp /usr/share/doc/mysql-server-5.1.73/my-medium.cnf /etc/my.cnf
-
-
-
-
vim my.cnf
在[client]和[mysqld]下面都添加上
default-character-set=utf8
-
-
-
-
-
3
END
重启mysql服务
-
1
最后重新启动服务就可以了
service mysqld restart