CentOS5.6以RPM方式安装MySQL5.6

1.检查MySQL及相关RPM包,是否安装,如果有安装,则移除(rpm –e 名称)

[root@localhost ~]# rpm -qa | grep -i mysql

mysql-libs-5.1.66-2.el6_3.x86_64

[root@localhost ~]# yum -y remove mysql-libs*

如果卸载不掉提示异常,则可以强制卸载依赖

rpm -e --nodeps mysql-libs-5.1.66-2.el6_3.x86_64

2.下载Linux对应的RPM包,如:CentOS6.4_64对应的RPM包,如下:

[root@localhost rpm]# ll

total 74364

-rw-r--r--. 1 root root 18442536 Dec 11 20:19 MySQL-client-5.6.15-1.el6.x86_64.rpm

-rw-r--r--. 1 root root 3340660 Dec 11 20:06 MySQL-devel-5.6.15-1.el6.x86_64.rpm

-rw-r--r--. 1 root root 54360600 Dec 11 20:03 MySQL-server-5.6.15-1.el6.x86_64.rpm

3.安装MySQL

[root@localhost rpm]# rpm -ivh MySQL-server-5.6.15-1.el6.x86_64.rpm

[root@localhost rpm]# rpm -ivh MySQL-devel-5.6.15-1.el6.x86_64.rpm

[root@localhost rpm]# rpm -ivh MySQL-client-5.6.15-1.el6.x86_64.rpm

出现以下文字表示安装成功

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.

Also, the account for the anonymous user has been removed.

In addition, you can run:

/usr/bin/mysql_secure_installation

which will also give you the option of removing the test database.

This is strongly recommended for production servers.

See the manual for more instructions.

Please report any problems with the /usr/bin/mysqlbug script!

The latest information about MySQL is available on the web at

http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

New default config file was created as /usr/my.cnf and

will be used by default by the server when you start it.

You may edit this file to change server settings

4.配置MySQL配置

#修改配置文件位置

[root@localhost rpm]# cp /usr/share/mysql/my-default.cnf /etc/my.cnf

#修改配置参数(vim /etc/my.cnf 或者是/usr/my.cnf具体看MySQL安装之后的提示)

[client]

password = 123456

port = 3306

default-character-set=utf8

[mysqld]

port = 3306

character_set_server=utf8

character_set_client=utf8

collation-server=utf8_general_ci

#(注意linux下mysql安装完后是默认:表名区分大小写,列名不区分大小写; 0:区分大小写,1:不区分大小写)

lower_case_table_names=1

#(设置最大连接数,默认为 151,MySQL服务器允许的最大连接数16384; )

max_connections=1000

[mysql]

default-character-set = utf8

5.初始化MySQL及设置密码

[root@localhost rpm]# /usr/bin/mysql_install_db

[root@localhost rpm]# service mysql start

[root@localhost rpm]# cat /root/.mysql_secret #查看root账号密码

# The random password set for the root user at Wed Dec 11 23:32:50 2013 (local time): qKTaFZnl

[root@localhost ~]# mysql -uroot –pqKTaFZnl

mysql> SET PASSWORD = PASSWORD('123456'); #设置密码为123456

mysql> exit

[root@localhost ~]# mysql -uroot -p123456

6.查看字符集

#查看字符集

mysql> show variables like '%collation%';

mysql> show variables like '%char%';

7.允许远程登陆

mysql> use mysql;

mysql> select host,user,password from user;

+-----------------------+------+-------------------------------------------+

| host | user | password |

+-----------------------+------+-------------------------------------------+

| localhost | root | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 |

| localhost.localdomain | root | *1237E2CE819C427B0D8174456DD83C47480D37E8 |

| 127.0.0.1 | root | *1237E2CE819C427B0D8174456DD83C47480D37E8 |

| ::1 | root | *1237E2CE819C427B0D8174456DD83C47480D37E8 |

+-----------------------+------+-------------------------------------------+

mysql> update user set password=password('123456') where user='root';

mysql> update user set host='%' where user='root' and host='localhost';

mysql> flush pr

7.1新建数据库账号

GRANT ALL PRIVILEGES ON *.* TO yhroot@"%" IDENTIFIED BY 'xxx密码' WITH GRANT OPTION;

8.设置开机自启动

[root@localhost ~]# chkconfig --levels 235 mysql on

[root@localhost ~]# chkconfig --list | grep mysql

mysql 0:off 1:off 2:on 3:on 4:on 5:on 6:off

9.MySQL的默认安装位置

/var/lib/mysql/ #数据库目录

/usr/share/mysql #配置文件目录

/usr/bin #相关命令目录

/etc/init.d/mysql #启动脚本

参考:http://blog.csdn.net/liumm0000/article/details/18841197

------------------------------------------------进阶的分割线--------------------------------------------

在线安装:

CentOS 7的yum源中没有正常安装mysql时的mysql-sever文件,需要去官网上下载

# wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

# rpm -ivh mysql-community-release-el7-5.noarch.rpm

# yum install mysql-community-server

安装成功之后参考上面的配置方法即可。

更新:2017.03.14

ipad上能安装mysql_CentOS以RPM方式安装MYSQL相关推荐

  1. mysql rpm 安装6_linux6.5 RPM方式安装 mysql5.6

    步骤一.检查下linux是不是已经安装了MySQL # rpm -qa|grep mysql mysql-libs-5.1.71-1.el6.x86_64 # rpm -e --nodeps mysq ...

  2. MySQL安装 - Linux7下. rpm方式安装

    https://blog.csdn.net/fanshujuntuan/article/details/78077433 转载于:https://www.cnblogs.com/shijunjie/p ...

  3. RPM方式安装MySQL5.6和windows下安装mysql解压版

    下载地址: http://cdn.MySQL.com/archives/mysql-5.6/MySQL-server-5.6.13-1.el6.x86_64.rpm http://cdn.mysql. ...

  4. linux下rpm方式安装mysql(2012-5-12)

    由于感觉前几篇博客中关于linux下rpm方式安装mysql的方法问题太多,今天抽时间重新实践和整理了一下,现在拿出来和大家分享,希望对家有用. 系统环境: Rat had enterprise li ...

  5. linux gcc 缺少 libmpfr.so,rpm方式安装gcc缺少依赖项的解决方法

    dpkg安装deb缺少依赖包的解决方法 [先贴出解决方案(基于Ubuntu)]: 使用dpkg -i   *.deb 的时候出现依赖没有安装 使用apt-get -f -y install  解决依赖 ...

  6. CentOS7内网使用rpm方式安装MySQL5.6数据库

    CentOS7内网使用rpm方式安装MySQL5.6数据库 生成环境为内网环境,无法通过互联网使用Yum方式安装MySQL数据库时,可以参考本文进行安装. 系统环境 当前演示操作系统为最小化安装的Ce ...

  7. linux rpm方式安装jdk+mysql

    linux rpm方式安装jdk+mysql 文章目录 linux rpm方式安装jdk+mysql 1.安装JDK 1.1查看当前linux是否安装java 1.2 上传jdk到linux文件目录 ...

  8. 通过RPM方式安装,升级,卸载,以及配置使用MySQL

    通过RPM方式安装,升级,卸载,以及配置使用MySQL 一.下载 MySQL是一种开源的关系数据库管理系统,被广泛应用于各种业务应用中.本文将讲解如何下载和安装MySQL的rpm安装包. 下载rmp安 ...

  9. RPM方式安装MySQL5.6

    RPM方式安装MySQL5.6 rpm -ivh MySQL-server-5.6.25-1.linux_glibc2.5.x86_64.rpm rpm -ivh MySQL-client-5.6.2 ...

最新文章

  1. 技巧: 用 JAXM 发送和接收 SOAP 消息—Java API 使许多手工生成和发送消息方面必需的步骤自动化...
  2. linux 定时器中断 imx,NXP iMX8 存储性能测试
  3. Spark Streaming(二)Flume
  4. 实用帖 | 使用Visual Studio开发.NET Core推荐设置
  5. c语言1E3是什么数据类型,C语言课件第2章数据类型和表达式.ppt
  6. 把双系统的linux删除,双系统删除linux
  7. 《人月神话》读书笔记之第1章焦油坑
  8. 将rgba图片信息转换为bmp图片文件
  9. latex附录中放python代码_LaTeX 里「添加程序代码」的完美解决方案
  10. vue-better-scroll引用报错[BScroll warn]: Can not resolve the wrapper DOM.
  11. 【湖南集训 4.2】正12面体
  12. 写文档时经常用到的图标(对勾、叉号)
  13. Turtle库画小猫咪
  14. php 获取用户是否关注微信公众号
  15. 解决运行python脚本报错:ModuleNotFoundError: No module named ‘numpy‘
  16. mac远程控制pc电脑的方法 pc控制mac
  17. 51单片机(五)独立键盘检测与矩阵键盘检测
  18. android studio json格式化,Android json格式化显示,可展开与折叠
  19. 哈工大软件构造课程知识点总结(三)
  20. Error:In PaddlePaddle 2.x

热门文章

  1. 九十年代计算机及应用,全国计算机等级考试历史发展
  2. 一张图看懂java 堆和栈
  3. JAVAEE框架整合技术之Spring02-AOP面向切面编程技术
  4. vo在自动驾驶中的应用(二)
  5. 「ZigBee模块」协议栈-Z-Stack协议栈基础和数据传输实验
  6. 什么是云防火墙?云防火墙有什么产品优势?
  7. H3C 交换机设备维护技术之——异常检查项
  8. [附源码]Nodejs计算机毕业设计基于售楼系统Express(程序+LW)
  9. 关闭 trados 2019 自动更正
  10. mars-3d 如何在你的页面炫一个3d的飞机