• MySQL8.0修改mysql允许远程连接


    1、连接服务器: mysql -u root -p
    
    • 1

    2、看当前所有数据库:show databases;

    3、进入mysql数据库:use mysql;

    4、查看mysql数据库中所有的表:show tables;

    5、查看user表中的数据:select Host, User,Password from user;

    6、修改user表中的Host:update user set Host=‘%’ where User=‘root’;
    或者INSERT INTO mysql.user (Host, User, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv, File_priv, Grant_priv, References_priv, Index_priv, Alter_priv, Show_db_priv, Super_priv, Create_tmp_table_priv, Lock_tables_priv, Execute_priv, Repl_slave_priv, Repl_client_priv, Create_view_priv, Show_view_priv, Create_routine_priv, Alter_routine_priv, Create_user_priv, Event_priv, Trigger_priv, Create_tablespace_priv, ssl_type, ssl_cipher, x509_issuer, x509_subject, max_questions, max_updates, max_connections, max_user_connections, plugin, authentication_string, password_expired, password_last_changed, password_lifetime, account_locked, Create_role_priv, Drop_role_priv, Password_reuse_history, Password_reuse_time, Password_require_current, User_attributes) VALUES (‘%’, ‘root’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘’, ‘’, ‘’, ‘’, ‘0’, ‘0’, ‘0’, ‘0’, ‘mysql_native_password’, ‘*81F5E21E35407D884A6CD4A731AEAF209E1B’, ‘N’, ‘2023-01-10 17:59:05’, NULL, ‘N’, ‘Y’, ‘Y’, NULL, NULL, NULL, NULL);

    7、最后刷新一下:flush privileges;

  • 相关阅读:
    SpringBoot整合Redis事务特性实践整理
    python医患档案管理系统vue+elementui+django
    《C++编程思想》笔记
    Vue2基础
    ubuntu18.04安装qgis、pyqgis
    java毕业设计研究生实验室综合管理系统Mybatis+系统+数据库+调试部署
    学习java技术能干什么工作
    Java线程安全问题
    【夯实算法基础】差分约束
    8086读取键盘-磁盘输入
  • 原文地址:https://blog.csdn.net/qq_31532979/article/details/133772820