MySQL5.6在RHEL下用RPM包安装遇到的问题

来源:互联网 发布:英菲克i9软件下载 编辑:程序博客网 时间:2024/05/15 21:35
[root@mysql56 mysql]# cat /etc/issue
Red Hat Enterprise Linux Server release 6.5 (Santiago)
Kernel \r on an \m

【问题一】遇到could not be looked up with /usr/bin/resolveip

[root@mysql56 soft]# /usr/bin/mysql_install_db 
WARNING: The host 'mysql56' could not be looked up with /usr/bin/resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MySQL version. The MySQL daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MySQL privileges !

解决方法:修改/etc/hosts
[root@mysql56 mysql]# hostname
mysql56
[root@mysql56 mysql]# vi /etc/hosts
192.168.114.13  mysql56

【问题二】:遇到 TIMESTAMP with implicit DEFAULT value is deprecated.

[root@mysql56 mysql56]# /usr/bin/mysql_install_db --user=mysql  --datadir=/var/lib/mysql56 
。。。。。。。。。。。
Installing MySQL system tables...2014-12-02 09:49:56 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
。。。。。。。。。。。
解决方法:加上参数 --explicit_defaults_for_timestamp,如下:
[root@mysql56 mysql56]# /usr/bin/mysql_install_db --user=mysql  --datadir=/var/lib/mysql56 --explicit_defaults_for_timestamp

【问题三】:遇到rsa问题

[root@mysql56 mysql56]# /usr/bin/mysql_install_db --user=mysql  --datadir=/var/lib/mysql56 --explicit_defaults_for_timestamp
。。。。。。。。
2014-12-02 10:39:11 8892 [Note] RSA private key file not found: /var/lib/mysql56//private_key.pem. Some authentication plugins will not work.
2014-12-02 10:39:11 8892 [Note] RSA public key file not found: /var/lib/mysql56//public_key.pem. Some authentication plugins will not work.
。。。。。。。。
解决过程:

[root@mysql56 lib]#rpm -qa openssl
openssl-1.0.1e-15.el6.x86_64
[root@mysql56 lib]# openssl genrsa -out mykey.pem 1024               
Generating RSA private key, 1024 bit long modulus
.....++++++
......++++++
e is 65537 (0x10001)
[root@mysql56 lib]# openssl rsa -in mykey.pem -pubout > mykey.pub
writing RSA key
[root@mysql56 lib]# chmod 440 mykey.pem
[root@mysql56 lib]# chmod 444 mykey.pub
[root@mysql56 lib]# chown mysql:mysql mykey.pem
[root@mysql56 lib]# chown mysql:mysql mykey.pub


[root@mysql56 lib]# vi /etc/my.cnf
[mysqld]
sha256_password_private_key_path=/var/lib/mykey.pem
sha256_password_public_key_path=/var/lib/mykey.pub

【问题四】:安装完成后无法启动:

[root@mysql56 mysql56]# service mysql start
Starting MySQL..... ERROR! The server quit without updating PID file (/var/lib/mysql/mysql56.pid).
解决办法:
由于安装的时候指定了datadir: --datadir=/var/lib/mysql56 ,而/etc/my.cnf中未指定,在启动时,在默位置查找,
添加后问题解决
[root@mysql56 lib]# vi /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql56

【问题五】:无法连接

[root@mysql56 local]# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
解决办法:
由于未使用默认的datadir造成的,修改[mysql]下的socket,如下:
[root@mysql56 lib]# vi /etc/my.cnf
[mysql]                      
socket = /var/lib/mysql56/mysql.sock
0 0