zoukankan      html  css  js  c++  java
  • mysql-5.7.15编译安装

    1、准备安装包 mysql-5.7.15-linux-glibc2.5-x86_64.tar.gz,解压

    [root@T-DMP-01 ~]# tar zxf mysql-5.7.15-linux-glibc2.5-x86_64.tar.gz -C /data/
    [root@T-DMP-01 data]# ln -s /data/mysql-5.7.15-linux-glibc2.5-x86_64/ /data/mysql
    [root@T-DMP-01 data]# cd /data/mysql
    [root@T-DMP-01 ~]#mkdir data  //新建文件夹data
    [root@T-DMP-01 ~]#mkdir mysql-files
    [root@T-DMP-01 ~]#groupadd mysql //新建mysql组
    [root@T-DMP-01 ~]#useradd -g mysql mysql
    [root@T-DMP-01 ~]#chown -R mysql:mysql /data/mysql

    2、修改配置文件/etc/my.cnf

    [root@T-DMP-01 mysql]# cat /etc/my.cnf
    [mysqld]
    port=3306
    basedir=/data/mysql
    datadir=/data/mysql/data
    socket=/data/mysql/mysql.sock
    log_error=/data/mysql/mysql_error.log
    
    [client]
    port=3306
    socket=/data/mysql/mysql.sock

    3、初始化数据库

    [root@T-DMP-01 bin]# ./mysqld --initialize --user=mysql --basedir=/data/mysql --datadir=/data/mysql/data

    查看密码:

    [root@T-DMP-01 mysql]# bin/mysql_ssl_rsa_setup --datadir=/data/mysql/data    //设置ssl可以不用执行
    Generating a 2048 bit RSA private key
    ..........................................................................................................................................................................................................+++
    ........................................+++
    writing new private key to 'ca-key.pem'
    -----
    Generating a 2048 bit RSA private key
    ....+++
    ................+++
    writing new private key to 'server-key.pem'
    -----
    Generating a 2048 bit RSA private key
    .....+++
    ..................................................+++
    writing new private key to 'client-key.pem'
    -----

    4、启动MySQL

    [root@T-DMP-01 support-files]# su mysql

    [mysql@T-DMP-01 support-files]# ./mysql.server start Starting MySQL. SUCCESS! [mysql@T-DMP-01 support-files]# pwd /data/mysql/support-files

    5、修改密码

    [mysql@localhost bin]$ ./mysqladmin -u root -p password 'JchangI2021';
    
    

    6、给root赋予远程登陆权限

    mysql> grant  all  on  *.*  to  root@'%' identified  by 'WWW.1.com' with grant option;

    参考:https://www.cnblogs.com/haima/p/12276063.html

    https://www.jb51.net/article/174244.htm

  • 相关阅读:
    模板网站
    用servlet和jsp做探索数据库
    Hibernate和jsp做数据库单表的增删改查
    拦截器
    校验器-对提交的用户名和密码进行过滤
    使用my exclipse对数据库进行操作(4)
    如何正确关闭游戏服务器
    Ehcache 入门详解
    自动重置 Language Level默认为5与 Java Complier默认为1.5
    洪均生谈初学者练习(怎样认识太级拳和怎样进行练习)
  • 原文地址:https://www.cnblogs.com/lina-2159/p/14451905.html
Copyright © 2011-2022 走看看