centos安裝或者卸載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
以上是我配置文件,,保存以後就可以正常使用了