服务器中的表
select
Host
,User
,Select_priv
,Insert_priv
,Update_priv
,Delete_priv
,Create_priv
,Drop_priv
,Reload_priv
,Shutdown_priv
,Process_priv
,File_priv
,Grant_priv
,References_priv
,Index_priv
,Alter_priv
,Show_db_priv
,Super_priv
,Create_tmp_table_priv
,Lock_tables_priv
,Execute_priv
,Repl_slave_priv
,Repl_client_priv
,Create_view_priv
,Show_view_priv
,Create_routine_priv
,Alter_routine_priv
,Create_user_priv
,Event_priv
,Trigger_priv
,Create_tablespace_priv
,ssl_type
,ssl_cipher
,x509_issuer
,x509_subject
,max_questions
,max_updates
,max_connections
,max_user_connections
,plugin
,authentication_string
,password_expired
,password_last_changed
,password_lifetime
,account_locked from user;
 
查询mysql所有用户<--两种-->
SELECT DISTINCT CONCAT('User: ''',user,'''@''',host,''';') AS query FROM mysql.user;
SELECT HOST,USER FROM mysql.user;
 
 
信息:
117.136.94.236
本机ip:192.168.42.23
39.108.172.95
121.43.18.69
sudo /usr/local/mysql/bin/mysql -uroot -pBF1f8357c50e
BF1f8357c50e</div>
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'BF1f8357c50e' WITH GRANT OPTION;flush privileges;</div>
 
 
出现:[emerg] 4613#0: bind() to 0.0.0.0:80 failed (98: Address already in use)错误!!!!!
解决方式:
使用命令关闭占用80端口的程序
sudo fuser -k 80/tcp
 
 
进入mysql命令:
mysql -hlocalhost(主机地址) -uroot(用户名) -p密码
 
关闭mysql命令:
mysql退出三种方法:
mysql > exit;
mysql > quit;
mysql > \q;
 
停止防火墙
sudo systemctl stop firewalld.service
并禁用防火墙服务
sudo systemctl disable firewalld.service
执行后效果:
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
 
安装iptables并启动该服务
 
#安装
sudo yum install iptables-services
执行后效果:
complate
 
#开启iptables
sudo systemctl enable iptables
sudo systemctl enable ip6tables
执行后效果:
Created symlink from /etc/systemd/system/basic.target.wants/iptables.service to /usr/lib/systemd/system/iptables.service.
Created symlink from /etc/systemd/system/basic.target.wants/ip6tables.service to /usr/lib/systemd/system/ip6tables.service.
 
#启动服务
sudo systemctl start iptables
sudo systemctl start ip6tables
 
查看防火墙状态
systemctl status firewalld
(dead)未开启状态
(running)开启状态
开启防火墙:
systemctl start firewalld
关闭防火墙:
systemctl stop firewalld
{开启/关闭}防火墙,命令行都没有效果可通过systemctl status firewalld查看防火墙状态
 
Warning: ALREADY_ENABLED: mysql    ==》警告:已经启用:mysql
 
 
 
若用本地sqlyog连接服务器上的mysql数据库则修改:
 
(1)Linux  centos7   将mysql加入防火墙
sudo firewall-cmd --zone=public --permanent --add-service=mysql
效果:
success
 
(2)重启防火墙
先关闭防火墙:
systemctl stop firewalld
后开启防火墙:
systemctl start firewalld
查看防火墙状态
systemctl status firewalld
效果:=======》如下、、、、、
(3)查询数据库使用权限
@1:连接数据库
mysql -uroot(用户名) -p密码
@2:拼写sql语句查询
select host,user from mysql.user;
效果形似:(注意此时没有红色区域的内容)
@3:为该(root)用户添加权限(任何ip都能访问此数据库===》%)
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'BF1f8357c50e' WITH GRANT OPTION;flush privileges;
@4:再次查询权限
select host,user from mysql.user;
此时效果应为:
(4)在sqlyog中连接数据库即可
 
 
 
 

使用sqlyog连接到服务器数据库,实现可视化数据操作。(完美解决版。)《亲测!!!!》的更多相关文章

  1. SQL不同服务器数据库之间的数据操作整理(完整版)

    ---------------------------------------------------------------------------------- -- Author : htl25 ...

  2. SQLServer服务器数据库之间的数据操作(完整版)

    分类: 数据库开发技术 ---------------------------------------------------------------------------------- -- Au ...

  3. 转载-SQL不同服务器数据库之间的数据操作整理(完整版) .

    ---------------------------------------------------------------------------------- -- Author : htl25 ...

  4. 不同服务器数据库之间的数据操作 sp_addlinkedserver

    --创建链接服务器  exec sp_addlinkedserver   'ITSV ', ' ', 'SQLOLEDB ', '远程服务器名或ip地址 '  exec sp_addlinkedsrv ...

  5. 转:不在同一个服务器上的数据库之间的数据操作(oracle/sql server的对比)

    如何操做不在同一个数据库中的数据操作: 一.对于SQL server来讲:  1.采用创建链接服务器的方式:    (1).创建链接服务器       exec sp_addlinkedserver  ...

  6. 数据库 MySQL 之 数据操作

    数据库 MySQL 之 数据操作 一.MySQL数据类型介绍 MySQL支持多种类型,大致可以分为四类:数值.字符串类型.日期/时间和其他类型. ①二进制类型 bit[(M)] 二进制位(101001 ...

  7. [Python] Python 学习 - 可视化数据操作(一)

    Python 学习 - 可视化数据操作(一) GitHub:https://github.com/liqingwen2015/my_data_view 目录 折线图 散点图 随机漫步 骰子点数概率 文 ...

  8. 基于Git的数据库sql文件的管理——完美解决团队sql操作协同问题

    目录 基于Git的数据库sql文件的管理--完美解决团队sql操作协同问题 1.产生背景 2.之前没用Git管理数据库出现的问题 2.1 用同一个库调试带来的问题 3.解决方案 3.1 Sql文件的创 ...

  9. 不同服务器数据库之间的数据定时同步到sql server (支持mysql,oracle数据库同步到sql server)

    1,在目标数据库新增服务器对象->连接到服务器->新建服务器连接 2,编写数据同步业务PROC ALTER PROC TestProc AS BEGIN --打开完全事物回滚 SET XA ...

随机推荐

  1. SQL0973N在 "<堆名>" 堆中没有足够的存储器可用来处理语句

    SQL0973N在 "<堆名>" 堆中没有足够的存储器可用来处理语句. 解释: 已使用此堆的所有可用内存.不能处理该语句. 用户响应: 接收到此消息(SQLCODE)后 ...

  2. OC调用Swift

    Step by step swift integration for Xcode Objc-based project: Create new *.swift file (in Xcode) or a ...

  3. crontab误删除

    命令如下: cat /var/log/cron* | grep -i "`which cron`" > ./all_temp cat ./all_temp | grep -v ...

  4. 2018.09.30 bzoj2288:生日礼物(贪心+线段树)

    传送门 线段树经典题目. 每次先找到最大子段和来更新答案,然后利用网络流反悔退流的思想把这个最大字段乘-1之后放回去. 代码: #include<bits/stdc++.h> #defin ...

  5. 2018.07.04 POJ 3304 Segments(简单计算几何)

    Segments Time Limit: 1000MS Memory Limit: 65536K Description Given n segments in the two dimensional ...

  6. 2018.08.31 bzoj1426 收集邮票(期望dp)

    描述 有n种不同的邮票,皮皮想收集所有种类的邮票.唯一的收集方法是到同学凡凡那里购买,每次只能买一张,并且 买到的邮票究竟是n种邮票中的哪一种是等概率的,概率均为1/n.但是由于凡凡也很喜欢邮票,所以 ...

  7. 关于this对象

    1.在全局函数中this指的是window 2.当函数被当做方法调用时,this等于那个对象 3.匿名函数具有全局性,只要是匿名函数,this指向window 实例1: var name = 'the ...

  8. ESRI.ArcGIS.AnalysisTools.Erase 结果是空?

    用ESRI.ArcGIS.AnalysisTools.Erase擦除,结果总是空的. 这几天一直纠结一个问题,就是在AE下使用ESRI.ArcGIS.AnalysisTools中的工具(例如:泰森多边 ...

  9. MFC 怎样获得某个窗口的句柄?

    GetSafeHandle();this-> hWnd;GetDlgItem(hwnd,ID);//获取窗口ID所对应的HWND的子窗口句柄 在主窗口中,如果要用到父窗口的句柄,可以用 HWND ...

  10. Win & Mac 系统之间U盘传递的U盘文件格式选取问题

    Win & Mac 系统之间U盘传递的U盘文件格式选取问题 1. Win系统与Mac系统之间可以通过 exFat U盘文件系统传递 exFAT(Extended File Allocation ...