本帖最后由 mu2312607160 于 2014-09-03 21:17:56 编辑

解决方案 »

  1.   

    ping 127.0.0.1 测试一下。
      

  2.   

    select user,host from mysql.user where user='root';看下你的root用户支持127.0.0.1吗?
    如果没有%的host,是不能用-hip地址登录的。
      

  3.   


    ping 127.0.0.1 可以
    ping localhost 可以
    ping 192.168.1.101 (本机IP)也可以
      

  4.   

    mysql> select user,host from mysql.user where user='root';
    +------+-----------+
    | user | host      |
    +------+-----------+
    | root | %         |
    | root | localhost |
    +------+-----------+
    2 rows in set (0.00 sec)
      

  5.   

    如果这样,至少说明与MYSQL还没有什么关系。在网络层上就有问题了。检查一下防火墙,或者关闭防火墙后再尝试。
      

  6.   

    mysql> select user,host from mysql.user where user='root';
    +------+-----------+
    | user | host      |
    +------+-----------+
    | root | %         |
    | root | localhost |
    +------+-----------+
    2 rows in set (0.00 sec)添加一个root@‘127.0.0.1’的用户试试。
    show grants for root@'%';得到赋予权限的sql,然后将%换成127.0.0.1 重新执行下。
      

  7.   

    谢谢各位,问题已经得到解决
    MySQL其实没有任何问题,我在data目录里面查看了一下mysql_error.log,信息如下:
    2014-09-07T05:49:49.700894Z 0 [Note] Plugin 'FEDERATED' is disabled.
    2014-09-07T05:49:49.702894Z 0 [Note] InnoDB: Using atomics to ref count buffer pool pages
    2014-09-07T05:49:49.703894Z 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
    2014-09-07T05:49:49.703894Z 0 [Note] InnoDB: Uses system mutexes
    2014-09-07T05:49:49.704894Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
    2014-09-07T05:49:49.706894Z 0 [Note] InnoDB: Number of pools: 1
    2014-09-07T05:49:49.707895Z 0 [Note] InnoDB: Not using CPU crc32 instructions
    2014-09-07T05:49:49.709895Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128.0M, instances = 1
    2014-09-07T05:49:49.717895Z 0 [Note] InnoDB: Completed initialization of buffer pool
    2014-09-07T05:49:49.851903Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
    2014-09-07T05:49:49.871904Z 0 [Note] InnoDB: The log sequence numbers 0 and 0 in ibdata files do not match the log sequence number 1207097 in the ib_logfiles!
    2014-09-07T05:49:49.872904Z 0 [Note] InnoDB: Database was not shutdown normally!
    2014-09-07T05:49:49.873904Z 0 [Note] InnoDB: Starting crash recovery.
    2014-09-07T05:49:49.874904Z 0 [Note] InnoDB: Reading tablespace information from the .ibd files...
    2014-09-07T05:49:49.879904Z 0 [Note] InnoDB: Restoring possible half-written data pages 
    2014-09-07T05:49:49.880904Z 0 [Note] InnoDB: from the doublewrite buffer...
    2014-09-07T05:49:50.093917Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
    2014-09-07T05:49:50.094917Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
    2014-09-07T05:49:50.095917Z 0 [Note] InnoDB: Setting file 'D:\mysql\mysql-5.7.4-m14-winx64\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
    2014-09-07T05:49:50.281927Z 0 [Note] InnoDB: File 'D:\mysql\mysql-5.7.4-m14-winx64\data\ibtmp1' size is now 12 MB.
    2014-09-07T05:49:50.284928Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
    2014-09-07T05:49:50.285928Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
    2014-09-07T05:49:50.417935Z 0 [Note] InnoDB: Waiting for purge to start
    2014-09-07T05:49:50.468938Z 0 [Note] InnoDB: 5.7.4 started; log sequence number 1207097
    2014-09-07T05:49:50.470938Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
    2014-09-07T05:49:50.472938Z 0 [Note] IPv6 is available.
    2014-09-07T05:49:50.473938Z 0 [Note]   - '::' resolves to '::';
    2014-09-07T05:49:50.474938Z 0 [Note] Server socket created on IP: '::'.

    2014-09-07T05:49:50.498940Z 0 [Note] Event Scheduler: Loaded 0 events
    2014-09-07T05:49:50.498940Z 0 [Note] MySQL: ready for connections.
    Version: '5.7.4-m14'  socket: ''  port: 3306  MySQL Community Server (GPL)然后我在连接工具这边设置address为::1,然后就连进去了