最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 科技 - 知识百科 - 正文

Linux系统MySQL数据库远程设置

来源:动视网 责编:小采 时间:2020-11-09 10:32:01
文档

Linux系统MySQL数据库远程设置

Linux系统MySQL数据库远程设置:Linux系统MySQL数据库远程设置 1.启动服务和登陆 [root@localhost ~]# /etc/init.d/mysqld restart Stopping mysqld: Linux系统MySQL数据库远程设置 1.启动服务和登陆 [root@localhost ~]# /etc/init.d/mysqld r
推荐度:
导读Linux系统MySQL数据库远程设置:Linux系统MySQL数据库远程设置 1.启动服务和登陆 [root@localhost ~]# /etc/init.d/mysqld restart Stopping mysqld: Linux系统MySQL数据库远程设置 1.启动服务和登陆 [root@localhost ~]# /etc/init.d/mysqld r


Linux系统MySQL数据库远程设置 1.启动服务和登陆 [root@localhost ~]# /etc/init.d/mysqld restart Stopping mysqld:

Linux系统MySQL数据库远程设置

1.启动服务和登陆
[root@localhost ~]# /etc/init.d/mysqld restart
Stopping mysqld: [ OK ]
Starting mysqld: [ OK ]
[root@localhost ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.66 Source distribution
Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>

2.授权一个可以远程登陆的用户
mysql> grant all privileges on *.* to tong@'%' identified by 'system'; --创建一个远程用户
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges; --更新权限
Query OK, 0 rows affected (0.00 sec)
mysql>

3.关闭防火墙
[root@localhost ~]# /etc/init.d/iptables stop
iptables: Flushing firewall rules: [ OK ]
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Unloading modules: [ OK ]
[root@localhost ~]#

4.用客户端工具可以登陆了
C:\Users\Administrator>mysql -h 远程IP -u tong -p --tong是远程用户名
Enter password: ******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 32
Server version: 5.5.19 MySQL Community Server (GPL)
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>

错误处理:

(1)防火墙没有关闭或防火墙没有过滤3306端口

图:



解决方法:

[root@localhost ~]# /etc/init.d/iptables stop
iptables: Flushing firewall rules: [ OK ]
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Unloading modules: [ OK ]
[root@localhost ~]#

或者:

[root@localhost ~]# vim /etc/sysconfig/iptables --添加以下一行
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT

(2)密码输入错误

图:



解决方法:输入正确的密码,如果密码忘记了在服务器系统里修改一下

Linux 下MySQL的安装和远程设置

文档

Linux系统MySQL数据库远程设置

Linux系统MySQL数据库远程设置:Linux系统MySQL数据库远程设置 1.启动服务和登陆 [root@localhost ~]# /etc/init.d/mysqld restart Stopping mysqld: Linux系统MySQL数据库远程设置 1.启动服务和登陆 [root@localhost ~]# /etc/init.d/mysqld r
推荐度:
标签: 设置 远程 linux
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top