Mysql5.7.28安装问题总结

文件权限问题

  1. # mysqld_safe error: log-error set to '/var/log/mariadb/mariadb.log', however file don't exists. Create writable for user 'mysql'.
  2. # 解决
  3. mkdir /var/log/mariadb
  4. touch /var/log/mariadb/mariadb.log
  5. chown -R mysql:mysql /var/log/mariadb/
  1. # [ERROR] SSL error: Unable to get private key from 'server-key.pem'
  2. # 解决
  3. find / -name server-key.pem
  4. chown -R mysql:mysql /var/lib/mysql/
  1. # [ERROR] Can't start server: Bind on TCP/IP port: Address already in use
  2. # 解决 关闭占用的端口即可
  3. 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