zoukankan      html  css  js  c++  java
  • 安装mysql后必须要做的一件事

    Step 1. 检查默认账户和密码

    $cat /etc/mysql/debian.cnf  # 在ubuntu下查看默认账户名和密码
    

    会看到

    [client]
    host     = localhost
    user     = debian-sys-maint
    password = ****************
    socket   = /var/run/mysqld/mysqld.sock
    [mysql_upgrade]
    host     = localhost
    user     = debian-sys-maint
    password = ****************
    socket   = /var/run/mysqld/mysqld.sock
    

    Step 2. 使用默认账户登录并修改root密码

    $mysql -u debian-sys-maint -p
    Enter password:
    
    mysql> use mysql;
    mysql> update user set authentication_string=PASSWORD('密码') and plugin='mysql_native_password' where User='root';  # 注意此处PASSWORD() 函数不可少
    mysql> flush privileges;
    mysql> exit;
    
    $ sudo service mysql restart  # 重启mysql服务
    

    Step 3. 使用root登录

    $ mysql -u root -p
    Enter password:
    
    mysql>
    
  • 相关阅读:
    AutoMapper使用
    C#网络编程
    ASP.NET MVC (Razor)开发
    React的React Native
    WCF搭建
    异步编程
    Async和Await进行异步编程
    C#开发中使用配置文件
    NET转Java
    net 开源组件
  • 原文地址:https://www.cnblogs.com/ryuasuka/p/11162140.html
Copyright © 2011-2022 走看看