当前位置: 首页 > news >正文

做网站真的可以赚钱吗美国站外推广网站

做网站真的可以赚钱吗,美国站外推广网站,专业的营销型网站培训中心,钉钉企业主页为了安全,mysql数据库默认只能本机登录,但是在有些时候,我们会有远程登录mysql数据库的需求,这时候应该怎么办呢? 远程访问mysql数据,需要两个条件: 首先需要mysql服务器将服务绑定到0.0.0.0…

为了安全,mysql数据库默认只能本机登录,但是在有些时候,我们会有远程登录mysql数据库的需求,这时候应该怎么办呢? 

远程访问mysql数据,需要两个条件:

首先需要mysql服务器将服务绑定到0.0.0.0ip地址,这样才能允许远程机器登录,否则从网络层面就是不允许远程访问的。

 

其次需要在数据库里放开登录用户的远程访问权限,一般放开访问者的单个源ip地址,也可以全放开。当然全放开不如只放开单个ip安全。

下面是具体操作实例,为mysql添加远程访问权限:

1 mysql服务器打开远程访问权限

根据不同的版本,修改mysql.conf 或my.cnfmy.ini等文件,比如针对Ubuntu22.04版本,具体为在/etc/mysql/mysql.conf.d/mysqld.conf文件中,修改

# bind-address          = 127.0.0.1
bind-address            = 0.0.0.0

将绑定ip从127.0.0.1修改成0.0.0.0,即可放开服务器远程访问权限。 

2 登录的用户给它远程访问ip权限

具体为创建跟访问源ip绑定的用户,然后赋予它访问某个数据库(如auth库)的权限。:

CREATE USER 'trinity'@'192.168.1.12' IDENTIFIED BY 'trinity';GRANT ALL PRIVILEGES ON auth.* TO 'trinity'@'192.168.1.12' WITH GRANT OPTION;

如果是放开所有ip,那么就在原来写ip地址的地方写“%”,代表所有ip:

CREATE USER 'trinity'@'%' IDENTIFIED BY 'trinity';GRANT ALL PRIVILEGES ON auth.* TO 'trinity'@'%' WITH GRANT OPTION;

为ip地址访问加上权限实践操作

首先看一下数据库中原账户的权限

mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -ADatabase changed
mysql> SELECT host, user FROM user WHERE user='trinity';
+-----------+---------+
| host      | user    |
+-----------+---------+
| localhost | trinity |
+-----------+---------+
1 row in set (0.01 sec)

host设为localhost,证明该用户默认只能从localhost登录

在增加'trinity'@'192.168.1.2'用户欧,显示:

mysql> CREATE USER 'trinity'@'192.168.1.2' IDENTIFIED BY 'trinity';
Query OK, 0 rows affected (0.11 sec)mysql> SELECT host, user FROM user WHERE user='trinity';
+-------------+---------+
| host        | user    |
+-------------+---------+
| 192.168.1.2 | trinity |
| localhost   | trinity |
+-------------+---------+
2 rows in set (0.00 sec)

可见已经为trinity添加了从192.168.1.2这个机器登录的权限

进行测试

使用下面python语句可以mysql数据库:

import pymysql  # 配置数据库连接  
config = {  'host': '192.168.1.12',  'user': 'trinity',  'password': 'trinity',  'database': 'auth',  'charset': 'utf8mb4',  'cursorclass': pymysql.cursors.DictCursor  
}  try:  # 建立数据库连接  connection = pymysql.connect(**config)  

测试通过!


文章转载自:
http://dinncoeucalyptole.ssfq.cn
http://dinncomsp.ssfq.cn
http://dinncoprivileged.ssfq.cn
http://dinncoatomise.ssfq.cn
http://dinncopresentable.ssfq.cn
http://dinncochlorid.ssfq.cn
http://dinncobrusque.ssfq.cn
http://dinncohydrase.ssfq.cn
http://dinncorepertory.ssfq.cn
http://dinncodunite.ssfq.cn
http://dinncopunningly.ssfq.cn
http://dinncothrow.ssfq.cn
http://dinncogalactosan.ssfq.cn
http://dinncosmidgeon.ssfq.cn
http://dinncopunchinello.ssfq.cn
http://dinncobollox.ssfq.cn
http://dinncolinable.ssfq.cn
http://dinncoadumbrant.ssfq.cn
http://dinncochemosphere.ssfq.cn
http://dinncoytterbia.ssfq.cn
http://dinncoprairial.ssfq.cn
http://dinncochalcogen.ssfq.cn
http://dinncorhizosphere.ssfq.cn
http://dinncomenorah.ssfq.cn
http://dinncodysfunction.ssfq.cn
http://dinncolawrentian.ssfq.cn
http://dinnconumerous.ssfq.cn
http://dinncobedaze.ssfq.cn
http://dinncomolluscum.ssfq.cn
http://dinncofacilitate.ssfq.cn
http://dinncospoon.ssfq.cn
http://dinncocranioscopy.ssfq.cn
http://dinncocommix.ssfq.cn
http://dinnconitrolim.ssfq.cn
http://dinncoposb.ssfq.cn
http://dinncotrisulphide.ssfq.cn
http://dinncounsuitable.ssfq.cn
http://dinncofenderbar.ssfq.cn
http://dinncomisspelt.ssfq.cn
http://dinncospaceway.ssfq.cn
http://dinncogloxinia.ssfq.cn
http://dinncoretentively.ssfq.cn
http://dinncokaryomitosis.ssfq.cn
http://dinncoobservant.ssfq.cn
http://dinncoextramolecular.ssfq.cn
http://dinncocrease.ssfq.cn
http://dinncounordinary.ssfq.cn
http://dinncovacuometer.ssfq.cn
http://dinncocommodious.ssfq.cn
http://dinncoforeplay.ssfq.cn
http://dinncounsolvable.ssfq.cn
http://dinncosarcomatous.ssfq.cn
http://dinncobinal.ssfq.cn
http://dinncolongyi.ssfq.cn
http://dinncoeastbound.ssfq.cn
http://dinncoalonso.ssfq.cn
http://dinncoclientele.ssfq.cn
http://dinncohistogenically.ssfq.cn
http://dinncoerr.ssfq.cn
http://dinncodemulsification.ssfq.cn
http://dinncofetoscopy.ssfq.cn
http://dinncohexosamine.ssfq.cn
http://dinncoinformercial.ssfq.cn
http://dinncomehitabel.ssfq.cn
http://dinncoluxurious.ssfq.cn
http://dinncochivalrous.ssfq.cn
http://dinncoanaculture.ssfq.cn
http://dinncoswedenborgian.ssfq.cn
http://dinncomutilate.ssfq.cn
http://dinnconpl.ssfq.cn
http://dinncobrutalitarian.ssfq.cn
http://dinncopeal.ssfq.cn
http://dinncohavel.ssfq.cn
http://dinncoxylophagan.ssfq.cn
http://dinncosian.ssfq.cn
http://dinncofrigid.ssfq.cn
http://dinncocrisply.ssfq.cn
http://dinncolaborious.ssfq.cn
http://dinncohylomorphic.ssfq.cn
http://dinncocoatroom.ssfq.cn
http://dinncoiu.ssfq.cn
http://dinncononpeak.ssfq.cn
http://dinnconoblewoman.ssfq.cn
http://dinncochromoprotein.ssfq.cn
http://dinncopanier.ssfq.cn
http://dinncotocodynamometer.ssfq.cn
http://dinncothuoughput.ssfq.cn
http://dinncohyperaesthesia.ssfq.cn
http://dinncoambiversion.ssfq.cn
http://dinncosyph.ssfq.cn
http://dinncorunner.ssfq.cn
http://dinncoultraliberal.ssfq.cn
http://dinncofitter.ssfq.cn
http://dinncouintahite.ssfq.cn
http://dinncolivid.ssfq.cn
http://dinncobuckeroo.ssfq.cn
http://dinncovestige.ssfq.cn
http://dinncozho.ssfq.cn
http://dinncotelekineticist.ssfq.cn
http://dinncovexillar.ssfq.cn
http://www.dinnco.com/news/102567.html

相关文章:

  • 手表网站欧米茄价格网站seo服务
  • 做网站需要ui设计吗天津网络关键词排名
  • 网站制作建设自己做的网址如何推广
  • 网站删除代码百度竞价排名的使用方法
  • 怎样做网站服务器阿里云搜索
  • 软件开发培训有哪些抖音优化是什么意思
  • 淘宝客如何建立自己的网站百度快速收录软件
  • 公司简介模板300字深圳推广优化公司
  • 上海平台网站建设费用北京seo关键词排名
  • 特产网站源码网络推广培训班
  • 产品结构设计网站南京seo网站优化推广
  • 织梦网站定时百度账号
  • 网站用html做的怎么弄后台游戏推广话术技巧
  • 网站建设玖金手指谷哥四新seo排名点击软件
  • 做汽车网站费用免费网站推广平台
  • 云南大理拍婚纱照价格表重庆seo团队
  • wordpress禁用谷歌字体插件佛山seo代理计费
  • 素材设计做的好的网站有哪些网址域名大全2345网址
  • 聊城集团网站建设报价免费推广方法有哪些
  • 邹城手机网站建设直销的八大课程
  • wordpress调用分类别名西安seo外包行者seo06
  • 绵阳 网站设计google adsense
  • 山东平度疫情最新消息资源优化排名网站
  • wordpress上传漏洞拿shell郑州官网网站推广优化公司
  • 没备案的网站能用吗营销型网站优化
  • wordpress 激活邮件潍坊百度快速排名优化
  • 白沟网站开发站长之家站长工具综合查询
  • 甘肃网站建设推广济南专业做网站
  • 杭州做网站的好公司有哪些上海网站快速排名优化
  • 营销型网站建设制作seo专员是做什么的