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

推荐订阅源

WordPress大学
WordPress大学
M
MIT News - Artificial intelligence
MyScale Blog
MyScale Blog
博客园_首页
G
Google Developers Blog
博客园 - 【当耐特】
美团技术团队
博客园 - 聂微东
Stack Overflow Blog
Stack Overflow Blog
Vercel News
Vercel News
小众软件
小众软件
博客园 - 司徒正美
雷峰网
雷峰网
T
Tailwind CSS Blog
V
V2EX
博客园 - 三生石上(FineUI控件)
F
Fortinet All Blogs
罗磊的独立博客
量子位
P
Proofpoint News Feed
Microsoft Azure Blog
Microsoft Azure Blog
月光博客
月光博客
A
About on SuperTechFans
Hugging Face - Blog
Hugging Face - Blog

俗子

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 # 输入刚才获取的密码就可以登录了