Mysql5.7.28安装问题总结
文件权限问题
# mysqld_safe error: log-error set to '/var/log/mariadb/mariadb.log', however file don't exists. Create writable for user 'mysql'.
# 解决
mkdir /var/log/mariadb
touch /var/log/mariadb/mariadb.log
chown -R mysql:mysql /var/log/mariadb/
# [ERROR] SSL error: Unable to get private key from 'server-key.pem'
# 解决
find / -name server-key.pem
chown -R mysql:mysql /var/lib/mysql/
# [ERROR] Can't start server: Bind on TCP/IP port: Address already in use
# 解决 关闭占用的端口即可
netstat -nat |grep ":port"
文件权限问题
/usr/local/mysql/bin/mysqld: Can’t create/write to file ‘/var/run/mariadb/mariadb.pid’ (Errcode: 2 - No such file or directory)
mkdir /var/run/mariadb/
chown -R mysql:mysql /var/run/mariadb/
一样的问题,没有创建该目录和权限
mysql.sock问题(解决方法很多,这只是其中一个)
Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)
这是可以由于系统默认的文件位置和文件位置不一致,解决办法找到文件创建软链接
find / -name mysql.sock
ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock