0

当我创建一个新的 mysql 数据库时,slashdb 的测试连接失败。

这是我登录的方式mysql

$ mysql -u 7stud -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 15
Server version: 5.5.5-10.4.13-MariaDB Homebrew
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database |
+--------------------+
| chat |
| ectoing_repo |
| ejabberd |
| information_schema |
| mydb |
| mysql |
| performance_schema |
| test |
+--------------------+
8 rows in set (0.00 sec)

mysql> use mydb;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
+----------------+
| Tables_in_mydb |
+----------------+
| cheetos        |
| greetings      |
| mody           |
| people         |
+----------------+
4 rows in set (0.00 sec)

mysql> select * from people;
+----+--------+------+
| id | name   | info |
+----+--------+------+
|  1 | 7stud  | abc  |
|  2 | Beth   | xxx  |
|  3 | Diane  | xyz  |
|  4 | Kathy  | xyz  |
|  5 | Kathy  | xyz  |
|  6 | Dave   | efg  |
|  7 | Tom    | zzz  |
|  8 | David  | abc  |
|  9 | Eloise | abc  |
| 10 | Jess   | xyz  |
| 11 | Jeffsy | 2.0  |
| 12 | XXX    | xxx  |
| 13 | XXX    | xxx  |
+----+--------+------+
13 rows in set (0.00 sec)

slashdb创建新数据库的表单中,这是我输入的信息:

Hostname: 127.0.0.1
Port: 80
Database Login: 7stud
Database Password: **
Database Name: mydb

然后我点击“测试连接”按钮,然后我得到一个纺车,几分钟后消失,但没有“连接成功”消息。我究竟做错了什么?

现在,我正在使用端口 3306:

mysql> SHOW GLOBAL VARIABLES LIKE 'PORT';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| port          | 3306  |
+---------------+-------+
1 row in set (0.00 sec)

但是当slashdb尝试连接时,我得到了错误:

Host localhost:3306 is not accessible
4

1 回答 1

-1

你的端口在数据库连接中是错误的。您说您的 MySQL 配置在端口 3306 上,但您还发布了具有端口 80 的数据库的 SlashDB 配置。请将其更改为 3306。

另外,不确定是否不需要启用对 MySQL 的远程访问。即使您的 SlashDB 与 MySQL 数据库在同一台机器上运行,它也使用 TCP/IP 进行连接。

于 2020-08-05T14:52:23.563 回答