惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

云风的 BLOG
云风的 BLOG
Blog — PlanetScale
Blog — PlanetScale
博客园 - 【当耐特】
博客园_首页
The GitHub Blog
The GitHub Blog
月光博客
月光博客
Hugging Face - Blog
Hugging Face - Blog
有赞技术团队
有赞技术团队
博客园 - 三生石上(FineUI控件)
D
Docker
Stack Overflow Blog
Stack Overflow Blog
WordPress大学
WordPress大学
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Apple Machine Learning Research
Apple Machine Learning Research
Vercel News
Vercel News
酷 壳 – CoolShell
酷 壳 – CoolShell
雷峰网
雷峰网
小众软件
小众软件
I
InfoQ
A
About on SuperTechFans
T
The Blog of Author Tim Ferriss
S
SegmentFault 最新的问题
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - Franky

俗子

awk常用命令及功能 istio 配置 k8s 节点控制 dns 私有服务器 SeaFile 网盘 golang 私有包 verdaccio 前端私有源 chrony 时间同步 k8s 问题集锦 gitlab jenkins k8s 部署 linux 多显示器管理 nginx 日常 服务器ssh登录配置 域名信息收集工具 ssh port forward redis拾遗-性能指标 逆向工具
mysql记录
俗子 · 2019-03-14 · via 俗子

配置相关

  • 监听公网ip,修改端口
  • 1
    2
    3
    sudo vim /etc/mysql/my.cnf
    port=3389
    bind-address='0.0.0.0'

    权限相关

    • 创建host
    • 1
      2
      3
      select user,host from user;
      update user set host='%' where user='root';
      flush privileges;
      • 授权root用户所有人可以登录
      • 1
        2
        GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'Password' WITH GRANT OPTION;
        flush privileges;
        • 允许指定用户(user),ip(192.168.1.1)访问
        • 1
          2
          GRANT ALL PRIVILEGES ON *.* TO 'user'@'192.168.1.1' IDENTIFIED BY 'mypwd' WITH GRANT OPTION;
          flush privileges;

          初始化密码获取

          mysql 5.7 会初始化密码,之前版本没有密码就可以直接登录,5.7必须要用密码了

          1
          2
          cat /var/log/mysqld.log |grep password  # 一般都是在第一行
          mysql -u root -p # 输入刚才获取的密码就可以登录了