centos 7安装或者卸载mysql 5.7

可以直接参考这篇文章

个人参考第一个
https://blog.csdn.net/zhwyj1019/article/details/80274269
https://blog.csdn.net/github_38336924/article/details/82188860

安装好以后可能会出现以下错误

在这里插入图片描述
这个问题纠缠了我好久,最后是在/etc/my.cnf这个里面加了一个 port=3306
就可以正常启动了

[mysqld]
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
skip-name-resolve
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
character_set_server=utf8
init_connect='SET NAMES utf8'
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
port=3306

以上是我配置文件,,保存以后就可以正常使用了

猜你喜欢

转载自blog.csdn.net/weixin_43691942/article/details/94436108
今日推荐