zoukankan      html  css  js  c++  java
  • linux中安装mysq5.7

    linux中安装mysq5.7

    一. 安装mysql

    yum install mariadb-server mariadb

    二. 开启mysql

    service mysqld start 

    四. 停止mysql服务

    service mysqld stop

    五. mysql配置文件修改为免密码登录。

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

    六. 启动 mysql 服务

    # service mysqld start

    七. 以root身份登录mysql, 输入密码的时候直接回车 

    # mysql -uroot -p #输入命令回车进入,出现输入密码提示直接回车。
    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'); or update user set authentication_string=PASSWORD("123456") where user="root";
    Query OK, 0 rows affected, 1 warning (0.00 sec)
    mysql>flush privileges; #更新权限
    mysql>quit; #退出
    # service mysqld stop # 停止mysql服务, 恢复mysql配置
    # vi /etc/my.cfg
    # Disabling symbolic-links is recommended to prevent assorted security risks
    # skip-grant-tables # 注释掉这句话
    symbolic-links=0
    # service mysqld start # 启动mysql服务
    # mysql -uroot -p # 输入新密码登录

  • 相关阅读:
    x+=y与x=x+y有什么区别?
    Linux下带宽流量工具iftop实践
    使用pinyin4j实现汉字转拼音
    Spring整合Velocity模版引擎
    Json工具类库之Gson实战笔记
    腾讯移动分析 签名代码示例
    Docker搭建Portainer可视化界面
    maven 打包 spring boot 生成docker 镜像
    Mysql 为什么要选择 B+Tree
    idea 添加 注释 配置
  • 原文地址:https://www.cnblogs.com/crazytata/p/10235190.html
Copyright © 2011-2022 走看看