zoukankan      html  css  js  c++  java
  • ubuntu18.04中mysql的安装及远程连接配置

    1.ubuntu 18.04 下mysql的安装

    sudo apt install mysql-server
    

    2.mysql 安装配置

    sudo mysql_secure_installation
    

    参考配置

    #1
    VALIDATE PASSWORD PLUGIN can be used to test passwords...
    Press y|Y for Yes, any other key for No: N (我的选项)
    
    #2
    Please set the password for root here...
    New password: (输入密码)
    Re-enter new password: (重复输入)
    
    #3
    By default, a MySQL installation has an anonymous user,
    allowing anyone to log into MySQL without having to have
    a user account created for them...
    Remove anonymous users? (Press y|Y for Yes, any other key for No) : N (我的选项)
    
    #4
    Normally, root should only be allowed to connect from
    'localhost'. This ensures that someone cannot guess at
    the root password from the network...
    Disallow root login remotely? (Press y|Y for Yes, any other key for No) : Y (我的选项)
    
    #5
    By default, MySQL comes with a database named 'test' that
    anyone can access...
    Remove test database and access to it? (Press y|Y for Yes, any other key for No) : N (我的选项)
    
    #6
    Reloading the privilege tables will ensure that all changes
    made so far will take effect immediately.
    Reload privilege tables now? (Press y|Y for Yes, any other key for No) : Y (我的选项)
    

    3.配置root用户远程访问

    GRANT ALL PRIVILEGES ON *.* TO 'root'@"%" IDENTIFIED BY "123456"; 
    

    4.这个时候可能远程访问还是有问题,拒绝链接(111)

    这时需要找到配置文件中的这一行,把它注释掉(这个让我搞了一晚上)

    #bind-address            = 127.0.0.1
    

    此时就可以成功远程链接了。

  • 相关阅读:
    图片的下方与父元素有间隙兼容性解决方案
    vscode 实用插件
    给网页title前面上图标
    网站换肤
    基于面向对象编程的设计模式
    点击获取验证码进行60秒倒计时
    JVM--内存模型与线程
    JVM学习--jvm监控和故障处理工具
    JVM--GC学习
    JVM--Java类加载机制
  • 原文地址:https://www.cnblogs.com/asia9847/p/10909588.html
Copyright © 2011-2022 走看看