简体   繁体   English

使用MySQL Workbench连接到实时数据库

[英]Connect to a live database with MySQL Workbench

I've a question to the mySQL Workbench. 我对mySQL Workbench有疑问。

I want to connect to the mysql DB at the domain aaa.com. 我想连接到域aaa.com上的mysql DB。 I write at the connection options these dates: 这些日期我在连接选项中写道:

Hostname: www.aaa.com
Port: Which port do i have to write in?
Username: Username of the DB (which is 100% correct)
Password: Password of the DB (which is 100% correct)
Default Schema: Name of the DB (which is 100% correct)

If I click connect there is following error: 如果单击“连接”,则会出现以下错误:

"Access denied" “拒绝访问”

Also you can ssh tunnel: 您也可以ssh隧道:

Create a new connection, select Standard TCP/IP over SSH. 创建一个新的连接,选择“基于SSH的标准TCP / IP”。

For SSH host name enter your domain aaa.com (the domain you would SSH to). 对于SSH主机名,输入您的域aaa.com(您将SSH到的域)。

For SSH username enter your SSH username, so if if you ssh test_user@aaa.com your user is test_user. 对于SSH用户名,请输入您的SSH用户名,因此,如果您使用ssh test_user@aaa.com,则您的用户为test_user。

Store your SSH password or key files, which ever you use. 存储您使用的SSH密码或密钥文件。

The Mysql hostname should be 127.0.0.1 if the mysql server is on the server you are SSH'ing to, else the IP or host name of you Mysql server. 如果mysql服务器位于您要通过SSH访问的服务器上,则Mysql主机名应为127.0.0.1,否则为Mysql服务器的IP或主机名。

Mysql server user - your mysqsl user. Mysql服务器用户-您的mysqsl用户。

And your Mysql server password. 和您的Mysql服务器密码。

This way your database isn't externally acceptable, meaning no one can trying to access it from outside your server on port 3306, but you still have access it through Workbench 这样,您的数据库就无法从外部被接受,这意味着没有人可以尝试从服务器外部的端口3306访问它,但是您仍然可以通过Workbench访问它

Contact your web hosting company to make sure they allow remote connections first. 请与您的网络托管公司联系,以确保它们首先允许远程连接。 It's disabled by some hosts. 某些主机已将其禁用。 Default port will be 3306. 默认端口为3306。

Generally, for security reasons, the incoming connections from external domains will be disabled. 通常,出于安全原因,将禁用来自外部域的传入连接。 Contact your host if that is allowed. 如果允许,请与您的主机联系。

By the way, the default port of MySQL is 3306 . 顺便说一句, MySQL默认端口3306


If you have root access to phpMyAdmin, you can see if the port is opened using this tutorial: Install MySQL and enable remote access . 如果您具有phpMyAdmin的超级root访问权限,则可以使用本教程查看端口是否已打开: 安装MySQL并启用远程访问

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM