1、首先查看linux版本:cat /etc/redhat-release

Red Hat Enterprise Linux Server release 7.2 (Maipo)

2.Linux查看版本说明当前CPU运行在32bit模式下, 但不代表CPU不支持64bit):

getconf LONG_BIT

64.

3.关闭防护墙
查看:
chkconfig --list | grep iptables

chkconfig iptables off (设置自动启动为关闭)

(# chkconfig --del iptables (移除开机自动启动))

4.当官方网站上下载对应的mysql, 根据上面信息

https://dev.mysql.com/downloads/mysql/5.5.html?os=31&version=5.1

下载(mysql-5.7.20-1.el7.x86_64.rpm-bundle.tar)

bundle版本的 是要安装的全部包括了,方便

5.用 ssh 工具上次的linux 上对应一个文件

[root@node04 Downloads]# ll
total 235312
-rw-r--r-- 1 root root 172994560 Oct 21 15:33 MySQL-5.5.58-1.el7.x86_64.rpm-bundle.tar

6. 注意:的是要切换的root用户  使用 su root切换用户

解压之后就是出现了好多的rpm文件

解压mysql5.5的安装包

tar -xvf MySQL-5.5.39-2.el6.x86_64.rpm-bundle.tar

但是安装只需要需要如下几个文件:

[root@node04 Downloads]# ll
-rw-r--r-- 1 7155 31415 16025016 Sep 14 14:24 MySQL-client-5.5.58-1.el7.x86_64.rpm
-rw-r--r-- 1 7155 31415 4394260 Sep 14 14:24 MySQL-devel-5.5.58-1.el7.x86_64.rpm
-rw-r--r-- 1 7155 31415 47529380 Sep 14 14:24 MySQL-server-5.5.58-1.el7.x86_64.rpm

7. 利用 rpm  安装 文件

rpm  -ivh   MySQL-client-5.5.58-1.el7.x86_64.rpm

rpm  -ivh   MySQL-devel-5.5.58-1.el7.x86_64.rpm

rpm  -ivh  MySQL-server-5.5.58-1.el7.x86_64.rpm

8. 接着就是初始化数据库。十分简单

/usr/bin/mysql_install_db

如图:

9.接下来就是查看mysql的状态

service mysql status

可能是应为 有进程在占用 ,或者 磁盘已满 (查看命令df -h)

查看进程:netstat -anp | grep mysql

将里面 启动的进程杀死 。  kill -9  进程id

11. 启动一下

/etc/init.d/mysql start

[root@node04 Downloads]# /etc/init.d/mysql start
Starting MySQL SUCCESS!

12.进入mysql

[root@node04 Downloads]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.58 MySQL Community Server (GPL)

Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> update mysql.user set password=PASSWORD('xxxxx') where user='root';   --将root 的密码改为 xxxx  (xxxx 是你自己设置的密码)
Query OK, 4 rows affected (0.00 sec)
Rows matched: 4 Changed: 4 Warnings: 0

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> grant all on *.* to root@'%' identified by '123456' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)

mysql> FLUSH PRIVILEGES
-> ;
Query OK, 0 rows affected (0.00 sec)

mysql> exit

-- 本地登录一下,可以,远程登录也可以

[root@node04 Downloads]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 144
Server version: 5.5.58 MySQL Community Server (GPL)

Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

好的,安装成功!

最新文章

  1. mysql求最大第二,最大第三个数
  2. 【组合数学】 02 - Möbius反演公式
  3. MongoDB介绍及安装
  4. 解决php configure: error: Cannot find ldap libraries in /usr/lib.错误
  5. SparkContext.setCheckpointDir()
  6. ZPPR032-批量展BOM
  7. html5 canvas 旋转扩大
  8. 怎样基于android4.4.2的源代码和android-4.3.1_r1的驱动编译I9250的ROM
  9. 红帽 Enterprise Linux OpenStack Platform 4.0全面上市
  10. 【转】setAnimation和startAnimation区别
  11. OC中的@interface和java中的区别以及 @implementation @protocol
  12. model first,DB first,code first
  13. mysql数据库开启慢查询日志
  14. JDK8 BigDecimal API-创建BigDecimal源码浅析二
  15. RS485转USB插电脑上通讯不上
  16. SQL中 like 通配符 特殊字符处理
  17. P4248 [AHOI2013]差异
  18. java.lang.IllegalArgumentException: Service Intent must be explicit 解决办法
  19. C++使用Mysql的详细步骤及各个常用方法的代码演示:select,insert,update,delete
  20. mysql安装卸载-windows

热门文章

  1. poj 4468Spy(kmp算法)
  2. Asp.net web Control Enable 属性设置
  3. Valid Number leetcode java
  4. Spring Boot Maven Plugin打包异常及三种解决方法:Unable to find main class
  5. 用css3实现风车效果
  6. C#,深入浅出全接触(一)
  7. Octave环境的安装
  8. python3 特殊字符处理 \x06\x05\x07
  9. 【架构】ServiceMesh初步了解
  10. java中正则表达式基本用法(转)