红联Linux门户
Linux帮助

rhel6.4安装mysql-5.6

发布时间:2015-11-03 10:14:11来源:linux网站作者:cheungmine

下载(临时地址, 如不可用,请到oracle官网下载)


采用rpm安装. mysql服务端要安装:

ftp://pepstack.com/pub/rpm/MySQL-server-5.6.27-1.el6.x86_64.rpm


mysql客户端要安装:

ftp://pepstack.com/pub/rpm/MySQL-client-5.6.27-1.el6.x86_64.rpm

ftp://pepstack.com/pub/rpm/MySQL-devel-5.6.27-1.el6.x86_64.rpm


服务端安装过程:


删除旧的:

# rpm -qa | grep -i mysql

mysql-libs-5.1.66-2.el6_3.x86_64

# rpm -ev --nodeps mysql-libs-5.1.66-2.el6_3.x86_64


慎重: 可能需要删除旧的文件(如果有):

# rm -f /etc/my.cnf
# rm -rf /usr/var/lib/mysql


安装新版本:

# rpm -ivh ./MySQL-server-5.6.27-1.el6.x86_64.rpm


客户端安装过程:

# rpm -ivh ./MySQL-client-5.6.27-1.el6.x86_64.rpm

# rpm -ivh ./MySQL-devel-5.6.27-1.el6.x86_64.rpm


服务端启动和登录:

# service mysql start

# mysql -u root

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)


解决此错误:

1、停止mysql服务:

# service mysql stop

2、启动mysql服务,跳过验证:

# mysqld_safe --skip-grant-tables&

3、登录mysql:

# mysql --user=root mysql

4、设置root用户密码:

mysql > update user set Password=PASSWORD('abcd1234');

mysql > flush privileges;

mysql > exit;

5、现在可以杀死mysqld_safe进程:

# killall mysqld_safe&

6、重启mysql服务:

# service mysql start

查看端口:

# netstat -nat | grep 3306

客户端登录(ipaddr为mysql服务所在的服务器ip地址):

# mysql -u root -h ipaddr -pabcd1234


Linux下查看MySQL的安装路径:http://www.linuxdiyf.com/linux/14760.html

ubuntu15.04手动安装MySQL5.6.27数据库:http://www.linuxdiyf.com/linux/14699.html

Ununtu 15.04安装MySql(Django连接Mysql):http://www.linuxdiyf.com/linux/13783.html

Ubuntu15.04下MySQL5.6安装过程:http://www.linuxdiyf.com/linux/13250.html

Ubuntu 14.10下编译安装MySQL 5.6.23:http://www.linuxdiyf.com/linux/12221.html