Welcome 微信登录

首页 / 数据库 / MySQL / Linux系统MySQL数据库远程设置

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:UsersAdministrator>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的安装和远程设置 http://www.linuxidc.com/Linux/2010-12/30438.htm查看RMAN工作进度MySQL数据库对数据库的操作相关资讯      linux mysql  Linux系统MySQL数据库 
  • Linux下MySQL的简单操作笔记  (08/12/2015 10:50:28)
  • Linux下MySQL报Table "xxx" doesn"  (11/22/2014 07:37:47)
  • Linux网站架构系列之MySQL----部署  (11/06/2013 20:21:28)
  • Linux开启MySQL远程连接  (11/22/2014 07:40:48)
  • Linux下解决MySQL无法远程连接问题  (11/14/2013 07:18:33)
  • Linux下将MySQL服务添加到服务器的  (07/27/2013 06:18:09)
本文评论 查看全部评论 (0)
表情: 姓名: 字数