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
    

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

  • 相关阅读:
    Mysql模糊查询like效率,以及更高效的写法(转)
    补全数组缺失某种类型的数据方法
    php 判断两个数组是否相等
    query如何全选或不全选时,不操作已经禁用的checkbox
    css talbe中td溢出隐藏 div溢出隐藏
    MongoDb的安装
    PSR规范
    shell中各种括号的作用()、(())、[]、[[]]、{}
    mysql explain执行计划详解
    PHP "延迟静态绑定" 功能,static
  • 原文地址:https://www.cnblogs.com/asia9847/p/10909588.html
Copyright © 2011-2022 走看看