Muyun99's wiki Muyun99's wiki
首页
学术搬砖
学习笔记
生活杂谈
wiki搬运
资源收藏
关于
  • 分类
  • 标签
  • 归档
GitHub (opens new window)

Muyun99

努力成为一个善良的人
首页
学术搬砖
学习笔记
生活杂谈
wiki搬运
资源收藏
关于
  • 分类
  • 标签
  • 归档
GitHub (opens new window)
  • 代码实践-目标检测

  • 代码实践-图像分割

  • 代码实践-自监督学习

  • 竞赛笔记-视觉竞赛

  • 框架解析-mmlab系列

  • 讲座记录-有意思的文章集合

  • 体会感悟-产品沉思录观后有感

  • 体会感悟-摄影

  • 系列笔记-

  • 系列笔记-乐理和五线谱

  • 系列笔记-爬虫实践

  • 系列笔记-Django学习笔记

    • 安装云环境的mysql
      • Django学习笔记(一)--简单入门
      • Django学习笔记(二)-- 连接MySQL数据库的小应用
    • 系列笔记-Git 使用笔记

    • 系列笔记-网站搭建

    • 系列笔记-图卷积网络

    • 课程笔记-MIT-NULL

    • 系列笔记-OpenCV-Python

    • 系列笔记-使用 Beancount 记账

    • 系列笔记-Python设计模式

    • 系列笔记-MLOps

    • 系列笔记-Apollo自动驾驶

    • 系列笔记-PaddlePaddle

    • 系列笔记-视频操作

    • Vue+Django前后端分离开发

    • 深度学习及机器学习理论知识学习笔记

    • PyTorch Tricks

    • 学习笔记
    • 系列笔记-Django学习笔记
    Muyun99
    2021-06-03

    安装云环境的mysql

    # 在Ubuntu 18.04上卸载MariaDB

    #
    sudo apt-get remove mysql-\*
    
    #
    sudo apt-get purge mariadb-*
    
    dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P
    
    1
    2
    3
    4
    5
    6
    7

    # 在Ubuntu 18.04上安装MariaDB

    # 安装 MariaDB
    sudo apt update
    sudo apt install mariadb-server
    
    # 验证MariaDB服务是否自动启动
    sudo systemctl status mariadb
    
    service mysqld status
    
    # 检查MariaDB版本
    mysql -V
    
    
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13

    # 设置密码

    
    # 禁用 root 用户的插件身份验证
    use mysql;
    update user set plugin='' where User='root';
    flush privileges;
    exit
    # 重新启动 MariaDB
    sudo systemctl restart mariadb.service 
    
    # 重启 MariaDB 如果出现 Failed to allocate directory watch: Too many open files
    sudo vim /etc/sysctl.conf
    fs.inotify.max_user_instances=512
    fs.inotify.max_user_watches=262144
    sudo sysctl -p
    
    # 运行 mysql_secure_installation 以提升 MariaDB 的安全性
    sudo mysql_secure_installation
    
    Enter current password for root (enter for none): 直接敲回车
    Set root password? [Y/n]: Y
    New password: 输入你的密码
    Re-enter new password: 重复你输入的密码
    Remove anonymous users? [Y/n]: Y
    Disallow root login remotely? [Y/n]: Y
    Remove test database and access to it? [Y/n]:  Y
    Reload privilege tables now? [Y/n]:  Y
    
    # 使用密码身份验证登录
    sudo mysql -u root -p
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29

    # 使用命令行连接 MariaDB

    # 连接 mysql
    mysql -u root -p 
    
    # 显示所有数据库
    show databases;
    
    # 显示数据库中的数据表
    use mysql;
    show tables;
    
    1
    2
    3
    4
    5
    6
    7
    8
    9

    # 设置 MySQL 远程访问权限

    # 设置 MySQL 远程访问权限
    update user set host ="%" where user ="root";
    flush privileges;
    
    # 查看 root 当前的 host 属性
    select host from user where user = 'root';
    
    select user,host from mysql.user
    
    1
    2
    3
    4
    5
    6
    7
    8

    # 查看监听端口

    netstat -an|grep 3306
    
    # 开启 skip-name-resolve
    skip-name-resolve
    
    1
    2
    3
    4

    # 关闭系统防火墙(可选)

    # 查看防火墙当前状态
    sudo ufw status
    
    # 关闭防火墙
    sudo ufw disable
    
    1
    2
    3
    4
    5

    检查iptables

    # 华为云安全组放行

    # 参考资料

    • https://my.oschina.net/u/4381258/blog/4327780
    上次更新: 2021/08/17, 18:07:06
    session和cookie、代理、selenium自动化
    Django学习笔记(一)--简单入门

    ← session和cookie、代理、selenium自动化 Django学习笔记(一)--简单入门→

    最近更新
    01
    Structured Knowledge Distillation for Semantic Segmentation
    06-03
    02
    README 美化
    05-20
    03
    常见 Tricks 代码片段
    05-12
    更多文章>
    Theme by Vdoing | Copyright © 2021-2023 Muyun99 | MIT License
    • 跟随系统
    • 浅色模式
    • 深色模式
    • 阅读模式
    ×