zoukankan      html  css  js  c++  java
  • centos6.5环境通过rpm包安装mysql5.5.51数据库

    centos6.5环境通过rpm包安装mysql5.5.51数据库


    注意:此方法适用于单独安装数据库的需求,如果在该机器上还需要安装php环境,建议mysql通过编译或yum方式安装


    1.查找已经安装的mysql并删除
    rpm -qa | grep mysql
    mysql-libs-5.1.73-7.el6.x86_64
    mysql-5.1.73-7.el6.x86_64


    rpm -e mysql-libs-5.1.73-7.el6.x86_64 --nodeps
    rpm -e mysql-5.1.73-7.el6.x86_64 --nodeps


    2.rpm安装mysql5.5.51
    rpm -ivh MySQL-server-5.5.51-1.el6.x86_64.rpm 
    rpm -ivh MySQL-client-5.5.51-1.el6.x86_64.rpm 
    rpm -ivh MySQL-devel-5.5.51-1.el6.x86_64.rpm 


    安装:
     rpm -ivh MySQL-devel-5.5.51-1.el6.x86_64.rpm 
    warning: MySQL-devel-5.5.51-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
    Preparing...                ########################################### [100%]
       1:MySQL-devel            ########################################### [100%]


    [root@node2 ~]# rpm -ivh MySQL-server-5.5.51-1.el6.x86_64.rpm 
    warning: MySQL-server-5.5.51-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
    Preparing...                ########################################### [100%]
       1:MySQL-server           ########################################### [100%]
    160901  1:42:12 [Note] /usr/sbin/mysqld (mysqld 5.5.51) starting as process 6139 ...
    160901  1:42:12 [Note] /usr/sbin/mysqld (mysqld 5.5.51) starting as process 6146 ...


    PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
    To do so, start the server, then issue the following commands:


    /usr/bin/mysqladmin -u root password 'new-password'
    /usr/bin/mysqladmin -u root -h node2.chinasoft.com password 'new-password'


    Alternatively you can run:
    /usr/bin/mysql_secure_installation


    which will also give you the option of removing the test
    databases and anonymous user created by default.  This is
    strongly recommended for production servers.


    See the manual for more instructions.


    Please report any problems at http://bugs.mysql.com/


    [root@node2 ~]# rpm -ivh MySQL-client-5.5.51-1.el6.x86_64.rpm 
    warning: MySQL-client-5.5.51-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
    Preparing...                ########################################### [100%]
       1:MySQL-client           ########################################### [100%]


    报错:
    error: Failed dependencies:
    MySQL-devel conflicts with mysql-devel-5.1.73-7.el6.x86_64
    删除原有的mysql5.1
    rpm -e mysql-devel-5.1.73-7.el6.x86_64 --nodeps


    3.验证是否安装成功
    pm -qa|grep -i mysql
    MySQL-client-5.5.51-1.el6.x86_64
    MySQL-server-5.5.51-1.el6.x86_64
    MySQL-devel-5.5.51-1.el6.x86_64


    配置文件
    cp /usr/share/mysql/my-large.cnf /etc/my.cnf


    mkdir /data/mydata
    修改配置文件
    vim /etc/my.cnf
    socket = /data/mydata/mysql.sock
    socket = /data/mydata/mysql.sock
    datadir=/data/mydata


    4.初始化数据库
    /usr/bin/mysql_install_db


    改变/data/的所有者
    chown -R mysql.mysql /data


    启动数据库
    service mysql start
  • 相关阅读:
    03_已解决 [salt.master :2195][ERROR ][6219] Failed to allocate a jid. The requested returner 'mysql' could not be loaded.
    02_已解决 [salt.minion :1758][ERROR ][52886] Returner mysql.returner could not be loaded: 'mysql' __virtual__ returned False: Could not import mysql returner; mysql python client is not installed.
    05_centos7安装python3
    04_mysql安装
    03_mysql-python模块, linux环境下python2,python3的
    02_pip区别: linux环境下python2,python3的
    01 salt平台,软件架构图
    01_初识redis
    list_for_each_entry()函数分析
    趣解什么是网关
  • 原文地址:https://www.cnblogs.com/reblue520/p/6239719.html
Copyright © 2011-2022 走看看