• mysql5.58的编译安装(转)


    mysql5.58的编译安装

    cmake-2.8.3.tar.gz
    mysql-5.5.8.tar.gz

    一,cmake-2.8.3的安装:
    tar -zxf cmake-2.8.3.tar.gz
    cd cmake-2.8.3
    [root@localhost cmake-2.8.3]# ./configure
    [root@localhost cmake-2.8.3]#make;make install

    二,mysql5.58的安装:

    1,建立mysql用户和组
    [root@localhost ~]# groupadd -g 2001 mysql
    [root@localhost ~]# useradd -M -s /sbin/nologin -u 2001 -g 2001 mysql

    2,编译mysql的安装
    [root@localhost amp]# tar -zxf mysql-5.5.8.tar.gz
    [root@localhost amp]# cd mysql-5.5.8
    [root@localhost mysql-5.5.8]# cmake . \
    > -DCMAKE_INSTALL_PREFIX=/usr/local/mysql5 \
    > -DINSTALL_DATADIR=/usr/local/mysql5/data \
    > -DDEFAULT_CHARSET=utf8 \
    > -DEXTRA_CHARSETS=all \
    > -DMYSQL_USER=mysql
    [root@localhost mysql-5.5.8]#make;make instal

    [root@localhost ~]# mv /etc/my.cnf /etc/my.cnf.bak
    [root@localhost ~]# cp /usr/local/mysql5/support-files/my-medium.cnf /etc/my.cnf
    [root@localhost ~]# vi /etc/my.cnf
    (在mysqld下方加入两条参数)
    basedir=/usr/local/mysql5 
    datadir=/usr/local/mysql5/data

    [root@localhost ~]# cd /usr/local/mysql5/
    [root@localhost mysql5]# scripts/mysql_install_db \
    --user=mysql  \
    --basedir=/usr/local/mysql5  \
    --datadir=/usr/local/mysql5/data

    [root@localhost mysql5]# chown -R mysql:mysql /usr/local/mysql5/data/
    [root@localhost mysql5]# chgrp -R mysql /usr/local/mysql5/

    [root@localhost mysql5]# bin/mysqld_safe --user=mysql &
    [root@localhost mysql5]# bin/mysqladmin -u root password 123456
    [root@localhost mysql5]# bin/mysql -uroot -p123456  
    mysql> show databases;

    3,把mysql加入到系统服务中
    [root@localhost mysql5]# cp support-files/mysql.server /etc/rc.d/init.d/mysqld
    [root@localhost mysql5]# chkconfig --add mysqld
    [root@localhost mysql5]# chkconfig --list | grep mysql
    mysqld          0:off   1:off   2:on    3:on    4:on    5:on    6:off

    [root@localhost mysql5]# service mysqld status
    MySQL running (20047)                                      [  OK  ]
    [root@localhost mysql5]# service mysqld restart
    Shutting down MySQL.                                       [  OK  ]
    Starting MySQL..                                           [  OK  ]

    [root@localhost mysql5]# /etc/rc.d/init.d/mysqld restart
    Shutting down MySQL.                                       [  OK  ]
    Starting MySQL..                                           [  OK  ]

  • 相关阅读:
    CSDN社区之星专訪:我的蜕变之路
    Linux中运行.sh脚本,异常/bin/sh^M: bad interpreter: No such file or directory。
    00075_BigInteger
    Delphi中Interface接口的使用方法
    Delphi结构体的扩展,可以自动初始化,反初始化,自定义拷贝函数.
    关于指针和堆栈
    Delphi 中的 procedure of object
    MikroTik RouterOS防火墙与过滤详解
    用 ROS 做内网DNS服务器
    GR32 TImage32的图层绘制原理
  • 原文地址:https://www.cnblogs.com/vicowong/p/1946449.html
Copyright © 2020-2023  润新知