• 【MySQL】二进制分发安装


    操作系统:Red Hat Enterprise Linux Server release 6.5

    Mysql安装包:mysql-5.6.34-linux-glibc2.5-x86_64.tar.gz

     

    1. Linux中创建mysql组和mysql用户

    [root@lgr ~]# groupadd -g 1000 mysql

    [root@lgr ~]# useradd mysql -g mysql -p mysql

     

    2. 上传安装包到/usr/local目录下

      ---上传过程略---

     

    3. 解压安装包

    [root@lgr local]# tar -zxvf mysql-5.6.34-linux-glibc2.5-x86_64.tar.gz

     

    4. 把解压后安装包名称改为'mysql'

    [root@lgr local]# mv mysql-5.6.34-linux-glibc2.5-x86_64 mysql

     

    5. 授权:解压的文件属主属组改为root:root,其中data改为mysql:mysql

    [root@lgr ~]# cd /usr/local/mysql

    [root@lgr mysql]# chown root:root *

    [root@lgr mysql]# chown mysql:mysql data

    [root@lgr mysql]# ll

    total 68

    drwxr-xr-x.  2 root  root   4096 Jan  9 22:26 bin

    -rw-r--r--.  1 root  root  17987 Sep 30 19:41 COPYING

    drwxr-xr-x.  3 mysql mysql  4096 Jan  9 22:26 data

    drwxr-xr-x.  2 root  root   4096 Jan  9 22:26 docs

    drwxr-xr-x.  3 root  root   4096 Jan  9 22:26 include

    drwxr-xr-x.  3 root  root   4096 Jan  9 22:26 lib

    drwxr-xr-x.  4 root  root   4096 Jan  9 22:26 man

    drwxr-xr-x. 10 root  root   4096 Jan  9 22:26 mysql-test

    -rw-r--r--.  1 root  root   2496 Sep 30 19:41 README

    drwxr-xr-x.  2 root  root   4096 Jan  9 22:26 scripts

    drwxr-xr-x. 28 root  root   4096 Jan  9 22:26 share

    drwxr-xr-x.  4 root  root   4096 Jan  9 22:26 sql-bench

    drwxr-xr-x.  2 root  root   4096 Jan  9 22:26 support-files

     

    6. 初始化 建立授权表

    [root@lgr ~]# cd /usr/local/mysql

    [root@lgr mysql]# scripts/mysql_install_db --user=mysql --datadir=/usr/local/mysql/data

     

    7. 编辑配置文件

    [root@lgr ~]# cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf

    [root@lgr ~]# vi /etc/my.cnf

    ---修改其中的如下内容---

    basedir = /usr/local/mysql

    datadir = /usr/local/mysql/data

    port = 3306

     

    8. 映射mysql和mysqladmin目录

    [root@lgr ~]# cd /usr/local/bin

    [root@lgr bin]# ln -fs /usr/local/mysql/bin/mysql mysql

    [root@lgr bin]# ln -fs /usr/local/mysql/bin/mysqladmin mysqladmin

    ##标红部分为MySQL的实际安装目录,根据实际目录修改

     

    9. 拷贝mysql.server启动脚本到init.d目录下

     [root@lgr ~]# cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql

     

    10. 启动MySQL Servier

    [root@lgr bin]# service  mysql start

     

    11. 修改root用户的密码

    [root@lgr ~]# mysqladmin -uroot password

     

    12. 连接MySQL Server

    [root@lgr bin]# mysql -u root -p

    The End!

    2017-08-17

  • 相关阅读:
    Linux 中文件名颜色所代表的属性
    time manage
    NoClassDefFoundError
    swagger在线文档
    2020.8.18
    spring jpa data的关键字
    2020.8.6
    spring data jpa的报错Can not set int field XXX to null value
    deadlock found when trying to get lock ;try restarting transaction
    查找-斐波那契
  • 原文地址:https://www.cnblogs.com/NextAction/p/7376798.html
Copyright © 2020-2023  润新知