200字范文,内容丰富有趣,生活中的好帮手!
200字范文 > 群晖 mysql 端口配置 如何连接群晖里的MYSQL数据库

群晖 mysql 端口配置 如何连接群晖里的MYSQL数据库

时间:2022-11-10 02:48:12

相关推荐

群晖 mysql 端口配置 如何连接群晖里的MYSQL数据库

如何连接群晖里的MYSQL数据库

关注:126答案:2mip版

解决时间 -02-04 15:03

提问者吥拽,註萣陂朲甩

-02-03 22:06

如何连接群晖里的MYSQL数据库

最佳答案

二级知识专家青春敷年華

-02-03 22:13

1.改表法。可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库中 "user" 表里的 "host" 字段,把"localhost"改称"%",即可。 mysql -u root -pvmwaremysql>use mysql;mysq...

全部回答

1楼落爺英雄遲暮

-02-03 23:02

一、连接远程数据库:

1、显示密码

如:mysql 连接远程数据库(192.168.5.116),端口“3306”,用户名为“root”,密码“123456”

c:/>mysql -h 192.168.5.116 -p 3306 -u root -p123456

2、隐藏密码

如:mysql 连接本地数据库,用户名为“root”,

c:/>mysql -h localhost -u root -p

enter password:

二、配置mysql允许远程链接

默认情况下,mysql帐号不允许从远程登陆,只能在localhost登录。这里提供了二种方法设置mysql可以通过远程主机进行连接。

一、改表法

在localhost登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,将"localhost"改称"%"

例如:

#mysql -u root -p

enter password:

……

mysql>

mysql>update user set host = '%' where user = 'root';

mysql>select host, user from user;

二、授权法

例如: 想myuser使用mypassword(密码)从任何主机连接到mysql服务器的话。

mysql>grant all privileges on *.* to 'myuser'@'%'identified by 'mypassword' with grant option;

如果想允许用户myuser从ip为192.168.1.6的主机连接到mysql服务器,并使用mypassword作为密码

mysql>grant all privileges on *.* to 'myuser'@'192.168.1.3'identified by

'mypassword' with grant option;

mysql>flush privileges

使修改生效,就可以了

常见问题:

1、在采用法二授权法之后,无法在本地登录mysql(如:#mysql -u root -p -h 192.168.5.116

enter password:

error 1045 (28000): access denied for user 'root'@'loadb116' (using password: yes)

上例中loadb116是主机名.

解决方法:

1、这时可以使用:mysql -u root -p 登录,进入到mysql后。

mysql> grant all privileges on *.* to 'root'@'loadb116'

identified by '123456' with grant option;

query ok, 0 rows affected (0.00 sec)

mysql> flush privileges;

query ok, 0 rows affected (0.00 sec)

2、在本地使用ip地址登录

# mysql -u root -p -h 192.168.5.116

enter password:

welcome to the mysql monitor. commands end with ; or /g.

your mysql connection id is 60

server version: 5.1.45 mysql community server (gpl)

type 'help;' or '/h' for help. type '/c' to clear the buffer.

mysql>

我要举报

如以上问答内容为低俗/色情/暴力/不良/侵权的信息,可以点下面链接进行举报,我们会做出相应处理,感谢你的支持!

→点此我要举报以上信息!←

推荐资讯

大家都在看

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。