系统版本:# cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)
1.sudo yum install mysql-community-server安装 找不到包,添加了源也没有
2.通过rpm安装了
rpm -ivh MySQL-server-5.6.36-1.el7.x86_64.rpm
这这只是sever 还需要client、lib的下载安装太麻烦
rpm -ivh MySQL-server-5.6.15-1.el6.x86_64.rpm
rpm -ivh MySQL-devel-5.6.15-1.el6.x86_64.rpm
rpm -ivh MySQL-client-5.6.15-1.el6.x86_64.rpm
见http://www.cnblogs.com/xs104/p/4589041.htm
不想安装了,安装未完成删除mysql:
yum -y remove mysql-community*
rpm -qa | grep -i mysql
3.安装tar:官网https://dev.mysql.com/downloads/file/?id=468924下载:MySQL-5.6.36-1.el7.x86_64.rpm-bundle.rar 有200多M包含了所有文件
开始安装rar:
一、安装目录下创建目录:mkdir mysql cd mysql
二、tar -xf MySQL-5.6.36-1.el7.x86_64.rpm-bundle.tar -C mysql/ ###C大写,后面是解压目录
三、cd mysql 查看要安装文件
root@xx mysql]# ls
MySQL-client-5.6.36-1.el7.x86_64.rpm MySQL-shared-5.6.36-1.el7.x86_64.rpm
MySQL-devel-5.6.36-1.el7.x86_64.rpm MySQL-shared-compat-5.6.36-1.el7.x86_64.rpm
MySQL-embedded-5.6.36-1.el7.x86_64.rpm MySQL-test-5.6.36-1.el7.x86_64.rpm
MySQL-server-5.6.36-1.el7.x86_64.rpm
四、安装,这些rpm有包依赖,有先后安装顺序:
[root@xx mysql]# rpm -ivh MySQL-devel-5.6.36-1.el7.x86_64.rpm
Preparing... ################################# [100%]
Updating / installing...
1:MySQL-devel-5.6.36-1.el7 ################################# [100%]
[root@xx mysql]# rpm -ivh MySQL-shared-5.6.36-1.el7.x86_64.rpm
Preparing... ################################# [100%]
Updating / installing...
1:MySQL-shared-5.6.36-1.el7 ################################# [100%]
[root@xx mysql]# rpm -ivh MySQL-shared-compat-5.6.36-1.el7.x86_64.rpm
Preparing... ################################# [100%]
Updating / installing...
1:MySQL-shared-compat-5.6.36-1.el7 ################################# [100%]
[root@xx mysql]# rpm -ivh MySQL-embedded-5.6.36-1.el7.x86_64.rpm
Preparing... ################################# [100%]
Updating / installing...
1:MySQL-embedded-5.6.36-1.el7 ################################# [100%]
[root@xx mysql]# rpm -ivh MySQL-client-5.6.36-1.el7.x86_64.rpm
Preparing... ################################# [100%]
Updating / installing...
1:MySQL-client-5.6.36-1.el7 ################################# [100%]
[root@xx mysql]# rpm -ivh MySQL-server-5.6.36-1.el7.x86_64.rpm
自此安装完成
五、安装成功后会有一个随机密码/root/.mysql_secret,供初次登录,配置文件路径/usr/my.cnf。初始化mysqld --initialize --user=mysql保证数据库目录为与文件的所有者为 mysql 登陆用户
六、启动mysql:systemctl start mysql.service 登录输入随机密码 登录成功后修改密码;set password = password('密码');
七、完成