笔者下载的

MySQL-5.6.32-1.el6.x86_64.rpm-bundle.tar

解压以后如图

启动终端步入解压目录

scp -r * root@192.168.1.104:~/

可以通过命令一个一个安装

rpm -ivh xxx.rpm

可能出现的相关错误

1.出现

error: Failed dependencies:
    libnuma.so.1()(64bit) is needed by MySQL-server-5.6.32-1.el6.x86_64
    libnuma.so.1(libnuma_1.1)(64bit) is needed by MySQL-server-5.6.32-1.el6.x86_64
    libnuma.so.1(libnuma_1.2)(64bit) is needed by MySQL-server-5.6.32-1.el6.x86_64

centos 6.5 x64_MySQL 5.6.32 安装教程 _ Numactl 安装错误

须要安装numactl

yum install numactl

2.出现

error: Failed dependencies:
    /usr/bin/perl is needed by MySQL-server-5.6.32-1.linux_glibc2.5.x86_64

须要安装perl

yum install perl

3.出现

Preparing...                ########################################### [100%]
    file /usr/share/mysql/czech/errmsg.sys from install of MySQL-server-5.6.32-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
    file /usr/share/mysql/danish/errmsg.sys from install of MySQL-server-5.6.32-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
    file /usr/share/mysql/dutch/errmsg.sys from install of MySQL-server-5.6.32-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
    file /usr/share/mysql/english/errmsg.sys from install of MySQL-server-5.6.32-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64
...

须要移除之前的libs

rpm -qa|grep mysql
#mysql-libs-5.1.71-1.el6.x86_64
rpm -e mysql-libs-5.1.71-1.el6.x86_64 --nodeps
#或者直接
yum -y remove mysql-libs-*

笔者的安装脚本如下

yum -y remove mysql-libs-*
yum install perl
yum install numactl
rpm -ivh MySQL-client-5.6.32-1.el6.x86_64.rpm
rpm -ivh MySQL-devel-5.6.32-1.el6.x86_64.rpm
rpm -ivh MySQL-shared-5.6.32-1.el6.x86_64.rpm
rpm -ivh MySQL-embedded-5.6.32-1.el6.x86_64.rpm
rpm -ivh MySQL-shared-compat-5.6.32-1.el6.x86_64.rpm
rpm -ivh MySQL-test-5.6.32-1.el6.x86_64.rpm

MySQL 5.6.32 安装教程 _centos 6.5 x64_ Numactl 安装错误

rpm -ivh MySQL-server-5.6.32-1.el6.x86_64.rpm

安装好mysql-server以后

会出现这样一段话

A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER !
You will find that password in '/root/.mysql_secret'.
You must change that password on your first connect,
no other statement but 'SET PASSWORD' will be accepted.
See the manual for the semantics of the 'password expired' flag.

大约意思就是一个随机的密码早已生成可以在’/root/.mysql_secret’.中找到

cat /root/.mysql_secret

# The random password set for the root user at Mon Aug  1 17:07:32 2016 (local time): Vt5dWVuEDafMVmsW

这个Vt5dWVuEDafMVmsW就是随机的密码

启动服务

service mysql start

更改密码数据库密码

MySQL 5.6.32 安装教程 _ Numactl 安装错误 _centos 6.5 x64

mysqladmin -uroot -pVt5dWVuEDafMVmsW password 'haoroot'
#修改成功之后可以登陆了
mysql -uroot -phaoroot

开启远程联接

默认mysql是没有开启远程联接的

为安全起见,看亲戚们都是ssh远程登录以后直接操作数据库的

1.开启mysql的远程联接

mysql>grant all privileges on *.*  to  'root'@'%'  identified by 'haoroot'  with grant option;
mysql>flush privileges;

开启防火墙端口

#vim /etc/sysconfig/iptables  
#在-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT之后添加
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 7575 -j ACCEPT

重启防火墙

 Numactl 安装错误 _centos 6.5 x64_MySQL 5.6.32 安装教程

service iptables restart 

Navicat新建联接

2.SSH远程联接

建议先瞧瞧之前的一篇《SSH远程登录》

这儿的localhost指的是连上服务器以后的localhost

联接以后的信息

注意:

ubuntu下可以使用命令查看远程的版本
sudo apt-cache showpkg mysql-server

最后编辑于:2017.12.0400:45:34

©专著权归作者所有,转载或内容合作请联系作者

Tagged:
Author

这篇优质的内容由TA贡献而来

刘遄

《Linux就该这么学》书籍作者,RHCA认证架构师,教育学(计算机专业硕士)。

发表回复