CentOS6.5下RPM安装Mysql5.6

一、升级操作

1、卸载旧版本

  • 查看MySQL旧版本

  rpm -qa|grep mysql

  rpm -qa|grep mariadb

  
  • 卸载MySQL
  rpm -e --nodeps mysql-5.1.73-7.el6.x86_64
  rpm -e --nodeps mysql-connector-odbc-5.1.5r1144-7.el6.x86_64
  rpm -e --nodeps mysql-libs-5.1.73-7.el6.x86_64
  rpm -qa|grep mysql
  • 删除数据目录
  ls  -l  /var/lib|grep mysql  rm  -rf  /var/lib/mysql

数据目录可以备份移走。mysqld服务在初始化时会检查数据目录是否存在:如果数据目录不存在,mysqld则会创建它;如果数据目录存在,且不是空目录(即包含有文件或子目录),mysqld会显示一条错误信息并中止:
[ERROR] --initialize specified but the data directory exists. Aborting.

2、安装MySQL5.6

  • 准备好MySQL的安装包

  MySQL-client-5.6.30-1.el6.x86_64.rpm

  MySQL-devel-5.6.30-1.el6.x86_64.rpm
  MySQL-server-5.6.30-1.el6.x86_64.rpm

  • 安装MySQL包

  rpm -ivh MySQL-client-5.6.30-1.el6.x86_64.rpm
  rpm -ivh MySQL-devel-5.6.30-1.el6.x86_64.rpm  rpm -ivh MySQL-server-5.6.30-1.el6.x86_64.rpm
3、初始化数据库

  • 启动数据库

  [[email protected] software]# /etc/init.d/mysql start
  Starting MySQL                                             [  OK  ]
  [[email protected] software]#

  • 检查数据库运行状态

  [[email protected] software]# /etc/init.d/mysql status
  MySQL running (5753)                                     [  OK  ]
  至此可以判断MySQL基本安装成功了!!!!

  • 找到临时密码

  [[email protected] software]# more /root/.mysql_secret
  # The random password set for the root user at Wed Sep 28 15:55:25 2016 (local time): LSM8vTnqNGr9ArQs

  • 登陆修改密码

  mysql> SET PASSWORD=PASSWORD(‘Atae123$‘);
  Query OK, 0 rows affected (0.00 sec)
  mysql> exit
  Bye

4、设置root用户远程访问

  • 设置root远程访问

  use mysql;
GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘[email protected]‘ WITH GRANT OPTION;  ‘%‘代表任意地址,也可以指定IP

  select host, user from user;
  FLUSH PRIVILEGES;
  • 设置防火墙

  在-A RH-Firewall-1-INPUT -j REJECT –reject-with icmp-host-prohibited之前,添加

  -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
  • 重启防火墙
  service iptables restart
时间: 2024-11-03 22:31:23

CentOS6.5下RPM安装Mysql5.6的相关文章

CentOS6.5_64bit下编译安装MySQL-5.6.23

转载请注明出处:http://blog.csdn.net/guoyjoe/article/details/44785511 ************************************************************         CentOS6.5_64bit下编译安装MySQL-5.6.23 **************************************************************一.关闭防火墙chkconfig iptable

centos6.7下 编译安装MySQL5.7

centos6.7下编译安装MySQL5.7 准备工作 #-----依赖包及MySQL和boost安装包----- #yum包安装: shell> yum -y install gcc-c++ ncurses-devel cmake make perl gcc autoconf automake zlib libxml libgcrypt libtool bison #获取boost类库(5.7编译需要boost类库,编译时指定boost路径): shell> wget http://down

Centos6下rpm安装MySQL5.6

Centos6在rpm安装 rpm -ivh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm yum install mysql-server –y 启动 service mysqld start 初始化 mysql_secure_installation Enter current password for root (enter for none): Set root password? [Y/n] Remo

centos6.5下yum安装mysql5.5

第一步就是看linu是否安装了mysql,经过rpm -qa|grep mysql查看到centos下安装了mysql5.1,那就开始卸载咯 2 接下来就是卸载mysql5.1了,命令:rpm -e mysql-libs --nodeps   yum中之后mysql5.1,安装还是5.1,现在就要去增加一个新的repo rpm -Uvh http://mirror.steadfast.net/epel/6/i386/epel-release-6-8.noarch.rpm   一共需要增加两个re

centos6.4下编译安装MySQL-5.5.33

若想在6.4版本下的centos编译安装MySQL必须使用新的编译器cmake. 1)安装cmake 直接yum安装 2)编译安装参数 使用cmake编译安装mysql-5.5.33,选项的方式有所改变: ./configure                cmake .            编译   ./configure –help         cmake . -LH or ccmake .   获取帮助 指定安装文件的安装路径时常用的选项:    -DCMAKE_INSTALL_P

CentOS6.9 下编译安装MySQL5.7.19

官网:https://www.mysql.com/ 下载地址:https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.19.tar.gz 一.准备工作 1.下载mysql并解压 [[email protected] ~]# wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.19.tar.gz [[email protected] ~]# tar xf mysql-5.7.19.ta

centos6.6下编译安装mysql5.6之后启动失败:Starting MySQL... ERROR! The server quit without updating PID file (/var/lib/mysql/localhost.localdomain.pid).

今天在编译安装mysql5.6时候出现Starting MySQL... ERROR! The server quit without updating PID file (/var/lib/mysql/localhost.localdomain.pid).,当时就心碎了,之前安装时候好好的,在网上搜索帮助方法,可是没有和我一样的,有的说我没有给mysqld赋权限,可是我赋予他权限了,试了一堆方法,最后心灰意冷,准备删除mysql重新安装,就在我执行:yum remove mysql mysql

redhat下rpm安装mysql5.1

1.官网下载mysql5.1的rpm包 服务端:MySQL-server-community-5.1.44-1.rhel4.i386.rpm 客户端:MySQL-client-community-5.1.44-1.rhel4.i386.rpm 2.执行rpm命令安装rpm -ivh MySQL-server-community-5.1.44-1.rhel4.i386.rpm;rpm -ivh MySQL-client-community-5.1.44-1.rhel4.i386.rpm; 3.查看

centos下RPM安装mysql5.7.13

1.查看已有mysql rpm -qa | grep mysql 2.卸载 #yum -y remove mysql-libs-5.1.66-2.el6_3.x86_64 检查并删除老版本mysql的开发头文件和库 命令:#rm -fr /usr/lib/mysql #rm -fr /usr/include/mysql 注意:卸载后/var/lib/mysql中的数据及/etc/my.cnf不会删除,如果确定没用后就手工删除 #rm -f /etc/my.cnf #rm -fr /var/lib