Home Database Mysql Tutorial Mysql从客户端连接服务器连不上的问题_MySQL

Mysql从客户端连接服务器连不上的问题_MySQL

Jun 01, 2016 pm 01:42 PM
server

bitsCN.com
Mysql从客户端连接服务器连不上的问题 公司要用Mysql做一个测试,开始在自己的本地建一个Mysql数据库自己本地的程序再连上去,没有遇到过连接不上的问题。
这次数据库在服务器上,从本地客户端连接就是被拒绝。 
 报的错误为 ERROR 1130: Host ’192.168.5.3’ is not allowed to connect to this MySQL server    查过资料后发现这个问题,一般都会遇到,Mysql数据库跟其他数据库不一样,需要设置权限可以控制哪台机器能访问数据库,能访问哪些表。 所以就要登上服务器。 C:/Documents and Settings/Administrator>mysql -h localhost -u root -p Enter password: *** Welcome to the MySQL monitor.  Commands end with ; or /g. Your MySQL connection id is 5 Server version: 5.1.43-community MySQL Community Server (GPL)  Type 'help;' or '/h' for help. Type '/c' to clear the current input statement.    mysql> grant all privileges on *.* to 'root'@'%' identified by '123' with grant     -> option; Query OK, 0 rows affected (0.00 sec) 意思就是将服务器上的所有资源都给root用户权限,%代表来自不同的IP 这里需要注意一下要把密码也要带上。通过密码123登录。 mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec) 最后要刷新下权限。  这样就从本地192.168.5.3这个IP的客户端连接到服务器上了   作者 kjqin bitsCN.com

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to solve the problem that eMule search cannot connect to the server How to solve the problem that eMule search cannot connect to the server Jan 25, 2024 pm 02:45 PM

How to solve the problem that eMule search cannot connect to the server

Detailed explanation of CentOS installation fuse and CentOS installation server Detailed explanation of CentOS installation fuse and CentOS installation server Feb 13, 2024 pm 08:40 PM

Detailed explanation of CentOS installation fuse and CentOS installation server

Solution to the inability to connect to the RPC server and the inability to enter the desktop Solution to the inability to connect to the RPC server and the inability to enter the desktop Feb 18, 2024 am 10:34 AM

Solution to the inability to connect to the RPC server and the inability to enter the desktop

Best Practice Guide for Building IP Proxy Servers with PHP Best Practice Guide for Building IP Proxy Servers with PHP Mar 11, 2024 am 08:36 AM

Best Practice Guide for Building IP Proxy Servers with PHP

How to enable TFTP server How to enable TFTP server Oct 18, 2023 am 10:18 AM

How to enable TFTP server

How to configure Dnsmasq as a DHCP relay server How to configure Dnsmasq as a DHCP relay server Mar 21, 2024 am 08:50 AM

How to configure Dnsmasq as a DHCP relay server

What should I do if I can't enter the game when the epic server is offline? Solution to why Epic cannot enter the game offline What should I do if I can't enter the game when the epic server is offline? Solution to why Epic cannot enter the game offline Mar 13, 2024 pm 04:40 PM

What should I do if I can't enter the game when the epic server is offline? Solution to why Epic cannot enter the game offline

How to install PHP FFmpeg extension on server? How to install PHP FFmpeg extension on server? Mar 28, 2024 pm 02:39 PM

How to install PHP FFmpeg extension on server?

See all articles