我知道这个问题之前已经被问过(就像这里),但我仍然找不到解决方案,而且这些帖子已经很旧了。
因此,我可以使用 ssh 连接连接到远程数据库,然后使用如下命令行:
// Putty SSH Connection
host: ssh.strato.de
port: 22
username: xxxxxxx
password: xxxxxxx
// connect to mysql with terminal
mysql -h rdbms -u xxxxxxx -p xxxxxxxx
Run Code Online (Sandbox Code Playgroud)
如果我在 DBeaver 中尝试使用 ssh-tunneling 进行相同的操作,则会出现连接错误
ssh 隧道本身似乎可以工作。如果我使用与上面相同的凭据并按“测试隧道配置”,我会收到一条成功消息。
我尝试了其他几个端口和主机选项(localhost、rdbms.strato.de 等),这是我通过 mysql 找到的show variables; show processlist; show user();,但它们都不起作用。
Strato 支持告诉我,我只能使用 phpmyadmin 内部连接到数据库,或者使用 putty 和 mysql 远程连接到数据库,但既然最后一种方法有效,那么 ssh 隧道不应该也有效吗?
我正在创建一个私有 npm 包来可视化 Vuejs 项目的结构。d3 似乎是可视化的最佳选择之一,但我在将其包含在脚本中时遇到问题。在我在属性package.json下定义了我的脚本并导入了 d3 (正如我所看到的其他项目也这样做了)bin"bin": { "visualize": "vis.js" },
#!/usr/bin/env node
var path = require('path');
var fs = require('fs');
var d3 = require('d3');`.
Run Code Online (Sandbox Code Playgroud)
但后来我收到以下错误
internal/modules/cjs/loader.js:1153
throw new ERR_REQUIRE_ESM(filename, parentPath, packageJsonPath);
^
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: <Project Path>\node_modules\d3\src\index.js
require() of ES modules is not supported.`
Run Code Online (Sandbox Code Playgroud)
所以我将其更改为var d3 = import('d3');有效,但随后声明var d3tree = d3.tree()提出TypeError: d3.tree is not a function
是否可以在 commonjs 中使用 d3 ?或者也许还有另一个可以直接工作的图形可视化库。