zoukankan      html  css  js  c++  java
  • CentOS7离线安装Mysql(详细安装过程)

    Mysql安装

    下载mysql离线安装包

    https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.27-1.el7.x86_64.rpm-bundle.tar

    解压后执行安装:

    cd /root/mysql-5.7.27-1.el7.x86_64.rpm-bundle

    rpm -Uvh *.rpm --nodeps --force

    Mysql配置

    1.首先关闭mysql服务:

    service mysqld stop

    2.然后修改配置文件:

    vi /etc/my.cnf

    3.接下来加入一句代码即可空密码登录mysql:

    # Disabling symbolic-links is recommended to prevent assorted security risks
    skip-grant-tables     #添加这句话,这时候登入mysql就不需要密码
    symbolic-links=0

    4.开启mysql服务:

    service mysqld start

    5.空密码登录mysql:

    mysql -u root -p    #输入命令回车进入,出现输入密码提示直接回车

    6.设置mysql密码:

    mysql> set password for root@localhost = password('123456');
    ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
    mysql> flush privileges;  #更新权限
    Query OK, 0 rows affected (0.00 sec)
    mysql> set password for root@localhost = password('123456'); 
    Query OK, 0 rows affected, 1 warning (0.00 sec)
    mysql>flush privileges; #更新权限
    mysql>quit; #退出
    service mysqld stop # 停止mysql服务, 恢复mysql配置
    vim /etc/my.cnf     #修改配置文件
    # Disabling symbolic-links is recommended to prevent assorted security risks
    # skip-grant-tables # 注释掉这句话
    symbolic-links=0
    service mysqld start # 启动mysql服务
    mysql -uroot -p # 输入新密码登录

    7.设置mysql开机自启:

    systemctl enable mysqld
  • 相关阅读:
    FreeRTOS相关转载-(朱工的专栏)
    任务相关的API函数-uxTaskGetSystemState
    STM32用FreeRTOS时任务优先级和中断优先级说明
    STM32标准外设库中USE_STDPERIPH_DRIVER, STM32F10X_MD的含义
    C语言变量和函数命名规范
    Java学习笔记-命令模式
    leetcode-Search in Rotated Sorted Array -java
    Java学习笔记-单件模式
    Java学习笔记-问问题?-->静态方法
    TCP滑动控制
  • 原文地址:https://www.cnblogs.com/JustinLau/p/11345089.html
Copyright © 2011-2022 走看看