版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/macfac/article/details/51868712
 0. 到官网下载好,想要安装的rpm包,本人使用的是
MySQL-server-5.5.50-1.linux2.6.x86_64.rpm  和 MySQL-client-5.5.50-1.linux2.6.x86_64.rpm
下载完之后可以放在/usr/local/mysql 里(个人习惯,只要找的到就行)
1.查看系统是否有安装过的rpm包
      rpm -qa | grep -i mysql
2.查看CentOS自带mysql是否已安装。
yum list installed | grep mysql
3.卸载所有安装
    yum -y remove mysql-libs*(删除mysql-libs开头的所以安装文件,如有其他文件可直接更换文件名进行删除)

4.删除其他文件(如果没有不用操作)

rm -rf /var/lib/mysql*
rm -rf /usr/share/mysql*

5.删除其他文件

卸载后 /etc/my.cnf 会重命名为 my.cnf.rpmsave,/var/log/mysqld.log 会重命名为 /var/log/mysqld.log.rpmsave,删除两个文件
6.安装服务端

rpm -ivh MySQL-server-5.5.50-1.linux2.6.x86_64.rpm (执行此命令要到MySQL-server-5.5.50-1.linux2.6.x86_64.rpm所在目录)
以下是成功日志内容:
Preparing... ########################################### [100%] 
1:MySQL-server ########################################### [100%] 
warning: user mysql does not exist - using root 
warning: group mysql does not exist - using root 
2014-08-10 22:43:44 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 
2014-08-10 22:43:44 23012 [Note] InnoDB: Using atomics to ref count buffer pool pages 
2014-08-10 22:43:44 23012 [Note] InnoDB: The InnoDB memory heap is disabled 
2014-08-10 22:43:44 23012 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 
2014-08-10 22:43:44 23012 [Note] InnoDB: Memory barrier is not used 
2014-08-10 22:43:44 23012 [Note] InnoDB: Compressed tables use zlib 1.2.3 
2014-08-10 22:43:44 23012 [Note] InnoDB: Using Linux native AIO 
2014-08-10 22:43:44 23012 [Note] InnoDB: Not using CPU crc32 instructions 
2014-08-10 22:43:44 23012 [Note] InnoDB: Initializing buffer pool, size = 128.0M 
2014-08-10 22:43:44 23012 [Note] InnoDB: Completed initialization of buffer pool 
2014-08-10 22:43:45 23012 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created! 
2014-08-10 22:43:45 23012 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB 
2014-08-10 22:43:45 23012 [Note] InnoDB: Database physically writes the file full: wait... 
2014-08-10 22:43:45 23012 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB 
2014-08-10 22:43:46 23012 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB 
2014-08-10 22:43:46 23012 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0 
2014-08-10 22:43:46 23012 [Warning] InnoDB: New log files created, LSN=45781 
2014-08-10 22:43:46 23012 [Note] InnoDB: Doublewrite buffer not found: creating new 
2014-08-10 22:43:46 23012 [Note] InnoDB: Doublewrite buffer created 
2014-08-10 22:43:46 23012 [Note] InnoDB: 128 rollback segment(s) are active. 
2014-08-10 22:43:46 23012 [Warning] InnoDB: Creating foreign key constraint system tables. 
2014-08-10 22:43:47 23012 [Note] InnoDB: Foreign key constraint system tables created 
2014-08-10 22:43:47 23012 [Note] InnoDB: Creating tablespace and datafile system tables. 
2014-08-10 22:43:47 23012 [Note] InnoDB: Tablespace and datafile system tables created. 
2014-08-10 22:43:47 23012 [Note] InnoDB: Waiting for purge to start 
2014-08-10 22:43:47 23012 [Note] InnoDB: 5.6.22 started; log sequence number 0 
A random root password has been set. You will find it in '/root/.mysql_secret'. 
2014-08-10 22:43:48 23012 [Note] Binlog end 
2014-08-10 22:43:48 23012 [Note] InnoDB: FTS optimize thread exiting. 
2014-08-10 22:43:48 23012 [Note] InnoDB: Starting shutdown... 
2014-08-10 22:43:50 23012 [Note] InnoDB: Shutdown completed; log sequence number 1625977

2014-08-10 22:43:50 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 
2014-08-10 22:43:50 23039 [Note] InnoDB: Using atomics to ref count buffer pool pages 
2014-08-10 22:43:50 23039 [Note] InnoDB: The InnoDB memory heap is disabled 
2014-08-10 22:43:50 23039 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 
2014-08-10 22:43:50 23039 [Note] InnoDB: Memory barrier is not used 
2014-08-10 22:43:50 23039 [Note] InnoDB: Compressed tables use zlib 1.2.3 
2014-08-10 22:43:50 23039 [Note] InnoDB: Using Linux native AIO 
2014-08-10 22:43:50 23039 [Note] InnoDB: Not using CPU crc32 instructions 
2014-08-10 22:43:50 23039 [Note] InnoDB: Initializing buffer pool, size = 128.0M 
2014-08-10 22:43:50 23039 [Note] InnoDB: Completed initialization of buffer pool 
2014-08-10 22:43:50 23039 [Note] InnoDB: Highest supported file format is Barracuda. 
2014-08-10 22:43:50 23039 [Note] InnoDB: 128 rollback segment(s) are active. 
2014-08-10 22:43:50 23039 [Note] InnoDB: Waiting for purge to start 
2014-08-10 22:43:50 23039 [Note] InnoDB: 5.6.22 started; log sequence number 1625977 
2014-08-10 22:43:50 23039 [Note] Binlog end 
2014-08-10 22:43:50 23039 [Note] InnoDB: FTS optimize thread exiting. 
2014-08-10 22:43:50 23039 [Note] InnoDB: Starting shutdown... 
2014-08-10 22:43:52 23039 [Note] InnoDB: Shutdown completed; log sequence number 1625987

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 at http://bugs.mysql.com/

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

7.启动服务

service mysql start
以下是成功日志:
Starting MySQL.......... SUCCESS!

8.安装客户端

rpm -ivh MySQL-client-5.5.50-1.linux2.6.x86_64.rpm(执行此命令要在MySQL-client-5.5.50-1.linux2.6.x86_64.rpm所在目录)
以下是成功日志
Preparing...                ########################################### [100%]
1:MySQL-client           ^C########################################### [100%]   安装完成

9.文件配置

找到my.cnf配置文件
如果"/etc/"目录下没有my.cnf配置文件,请到 "/usr/share/mysql/" 下找到 my-default.cnf  文件,拷贝其中一个合适的配置文件到 "/etc/" 并改名为 "my.cnf" 中。命令如下:
cp /usr/share/mysql/my-medium.cnf  /etc/my.cnf

10.修改上一步拷贝的my.cnf文件(配置/etc/my.cnf文件,修改数据存放路径、mysql.sock路径以及默认编码utf-8.)
[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

11.设置Mysql开机启动
chkconfig mysqld on

12.开启3306端口并保存
1./sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
2./etc/rc.d/init.d/iptables save
13.连接mysql数据库
mysql -uroot -p 
此时会提示你输入密码,直接enter 键;
14.修改mysql密码
1.update user set password=password('密码') where user='root';
2.flush privileges;
15.设置Mysql远程访问
grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option;
其中123456是你设置的远程连接密码。
16.. MySQL的默认rpm安装位置
1
/var/lib/mysql/               #数据库目录
2
/usr/share/mysql              #配置文件目录
3
/usr/bin                     #相关命令目录
4
/etc/init.d/mysql              #启动脚本

---------------------
作者:Y_JY
来源:CSDN
原文:https://blog.csdn.net/macfac/article/details/51868712
版权声明:本文为博主原创文章,转载请附上博文链接!

Centos6 rpm 安装mysql5.5(转)的更多相关文章

  1. CentOS6.5安装MySQL5.6

    CentOS6.5安装MySQL5.6,开放防火墙3306端口,允许其他主机使用root账户密码访问MySQL数据库 查看操作系统相关信息 ** 该查看方法只适用于CentOS6.5 (lsb_rel ...

  2. centos6.5安装Mysql5.6及更改密码

    (一) centos6.5安装Mysql5.6 二进制文件安装的方法分为两种: 第一种是不针对特定平台的通用安装方法,使用的二进制文件是后缀为.tar.gz的压缩文件: 第二种是使用RPM或其他包进行 ...

  3. Centos6.5安装MySQL5.6备忘记录

    Centos6.5安装MySQL5.6 1. 查看系统状态 [root@itzhouq32 tools]# cat /etc/issue CentOS release 6.5 (Final) Kern ...

  4. CentOS6.5安装mysql5.7

    CentOS6.5安装mysql5.7 查看mysql的安装路径: [root@bogon ~]# whereis mysql mysql: /usr/bin/mysql /usr/lib/mysql ...

  5. 第三百九十九节,Django+Xadmin打造上线标准的在线教育平台—生产环境部署CentOS6.5安装mysql5.6

    第三百九十九节,Django+Xadmin打造上线标准的在线教育平台—生产环境部署CentOS6.5安装mysql5.6 1.检测系统是否已经安装过mysql或其依赖,若已装过要先将其删除,否则第4步 ...

  6. centos6.8安装mysql5.6【转】

    首先先要去看看本机有没有默认的mysql, 本地默认有的,我们应先卸载,在安装新的这个逻辑. rpm -qa | grep mysql 我本机默认安装的mysql5.1.73 下一步删除 rpm -e ...

  7. linux 环境RPM 安装MYSQL5.6

    linux 环境RPM 安装MYSQL5.6 系统环境 CentOS7.2 1.关闭selinux 服务[SELinux是一种基于域-类型 模型(domain-type)的强制访问控制(MAC)安全系 ...

  8. RPM安装MYSQL5.7

    RPM安装MYSQL5.7 1:YUM安装依赖库 yum install perl libaio numactl 2:下载安装需要的RPM包 https://dev.mysql.com/get/Dow ...

  9. RPM安装MySQL5.7并更改数据目录

    RPM安装MySQL5.7并更改数据目录 文末附MySQL完整配置文件 官网地址:https://dev.mysql.com/downloads/mysql/5.7.html#downloads 注意 ...

随机推荐

  1. Oracle中从控制文件读取的视图

    Oracle中有一些数据字典视图需从控制文件中读取信息,如下所示.用户在数据库打开之前就可以访问这些视图,因为这些视图的内容存储在控制文件中. v$archived_log:归档日志信息,如大小,SC ...

  2. css 实现的网页布局

      css 实现网页布局,上中下三部分,中间为固定宽度且分为左右两部分 <!DOCTYPE html> <html> <head> <meta charset ...

  3. 【Python】unittest-4

    #练习1: import random import unittest from TestCalc import TestCalcFunctions class TestSequenceFunctio ...

  4. Java中的List集合和迭代器

    一.Java中的List集合. 终于有时间来好好整理一下Java中的集合. 首先要讲的就是List集合.Java中List集合主要将两个: 第一个是底层使用数组维护的ArrayList,第二个是底层是 ...

  5. Python之路PythonThread,第二篇,进程2

    python3   进程2 僵尸进程处理方法: 3,创建二级子进程处理 4,在父进程中使用信号处理的方法忽略子进程发来的信号: signal(SIGCHLD,DIG,IGN) # 创建二级子进场解决僵 ...

  6. Unity 3D UGUI Toggle用法教程

    UGUI Toggle用法教程 本文提供全流程,中文翻译. Chinar 坚持将简单的生活方式,带给世人!(拥有更好的阅读体验 -- 高分辨率用户请根据需求调整网页缩放比例) Chinar -- 心分 ...

  7. HDU - 2892:area (圆与多边形交 求面积)

    pro:飞行员去轰炸一个小岛,给出炸弹落地点的位置信息,以及轰炸半径:按顺时针或者逆时针给出小岛的边界点. 求被轰炸的小岛面积. sol:即是求圆和多边形的面积交. (只会套板子的我改头换面,先理解然 ...

  8. CodeForces - 441E:Valera and Number (DP&数学期望&二进制)

    Valera is a coder. Recently he wrote a funny program. The pseudo code for this program is given belo ...

  9. 安装排错 max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]

    https://blog.csdn.net/cookzrk/article/details/80179006 转载:https://my.oschina.net/u/2510243/blog/8105 ...

  10. LeetCode - Max Area of Island

    Given a non-empty 2D array grid of 0's and 1's, an island is a group of 1's (representing land) conn ...