linux安装mysql5.5.2

心不动则不痛 提交于 2019-12-05 06:59:00

基本按着这篇博文来操作的,如下

linux centos7.6 安装mysql5.5.62 详细图文安装学习记录

https://blog.csdn.net/StenisGate/article/details/90740163

-------------------------------------------------------------------------------------------------------------------

然后是一些其他的操作

为远程连接添加权限跟开放端口:

https://blog.csdn.net/qq_19987491/article/details/86484749

1.查看防火墙是否开启:systemctl status firewalld

2.开启防火墙:systemctl start firewalld.service

   如果出现Failed to start firewalld.service: Unit is masked的错误,说明firewalld服务被锁定了
可执行:systemctl unmask firewalld解除锁定

3.查看防火墙监听的端口号:firewall-cmd --list-ports

4.防火墙开启80端口访问:firewall-cmd --zone=public --add-port=80/tcp --permanent    这里面80可以换其他端口号,mysql就是3306

5.重启防火墙:firewall-cmd --reload

-------------------------------------------------------------------------------------------------------------------

因为添加远程访问后本地登陆密码报错:

grant all privileges on *.* to root@'localhost' identified by '密码';
flush privileges;

-------------------------------------------------------------------------------------------------------------------

修改mysql默认字符集:

show variables like 'character%';  查看字符集编码情况

先停掉mysql服务
修改/etc/my.cnf文件
[client]
default_character_set=utf8
[mysqld]
collation_server = utf8_general_ci
character_set_server = utf8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!