zoukankan      html  css  js  c++  java
  • Windows上安装mysql设置远程访问

    Windows上安装了mysql ,如何设置可以远程访问,及程序连接数据库:

    进入安装目录 如:C:Program FilesMySQLMySQL Server 5.7in

    在该目录下打开命令窗口

    输入:mysql -u root - p 输入密码  进入数据库

    登录mysql,然后输入:
    mysql>use mysql;
    mysql>grant all privileges on *.* to root@localhost identified by '123456' with grant option;
    添加一个用户root并授权通过本地机(localhost)访问,密码"123456"。

    mysql>grant all privileges on *.* to root@"%" identified by '123456' with grant option;
    添加一个用户root并授权可从任何其它主机发起的访问(通配符%)。使用这一条语句即可。
    然后刷新数据库权限
    mysql>flush privileges;
    至此在其他的机器上使用任何MySQL的管理工具就都可以连上这台服务器的MySQL的数据库了。

  • 相关阅读:
    如何写Makefile?
    C语言变量的存储类别详解
    Longest Palindrome Substring
    Count Primes
    Closest Binary Search
    Search Insert Position
    Set Matrix Zeros ****
    Search for a Range
    Two Sum II
    Jump Game
  • 原文地址:https://www.cnblogs.com/mayyan/p/7680368.html
Copyright © 2011-2022 走看看