无法使用 PhpMyAdmin 正确连接到外部服务器
Can't properly connect to an external server with PhpMyAdmin
我目前使用的主机允许我将内容存储在数据库中。之前可以通过MySQLworkbench访问,但是发现PhpMyAdmin的感觉比Workbench好,所以改安装了
我做了一些研究,发现您可以通过更改文件 config.inc.php 中的 host/info 来连接到外部服务器。我已经这样做了,如下所示:
$i++;
/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'REDACTED';
$cfg['Servers'][$i]['password'] = 'REDACTED';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Lang'] = '';
/* Bind to the localhost ipv4 address and tcp */
$cfg['Servers'][$i]['host'] = 'REDACTED';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
当我尝试通过 Xampp 加载它时,它给了我这个:
Error
SQL query: {REDACTED}
SET CHARACTER SET 'utf8mb4';
MySQL said: Documentation
1115 - Unknown character set: 'utf8mb4'
它似乎在加载时告诉查询更改字符集,而当它执行此操作时,它会发出错误消息。我尝试重新启动 Xampp,将其改回 UTF-8 并确保所有内容都已正确更新。
每当我将值(已编辑的)更改回默认值时,它都会再次工作。我该如何解决这个问题?
你的版本不支持那个字符集,我相信是5.5.3引入的。您应该升级 mysql 或降级 phpmyadmin。
那么错误就很明显了:设置了某个字符,但是你的mysql版本不支持,所以不知道。
根据https://dev.mysql.com/doc/refman/5.5/en/charset-unicode-utf8mb4.html:
utf8mb4 is a superset of utf8
升级mysql或降级phpmyadmin
我目前使用的主机允许我将内容存储在数据库中。之前可以通过MySQLworkbench访问,但是发现PhpMyAdmin的感觉比Workbench好,所以改安装了
我做了一些研究,发现您可以通过更改文件 config.inc.php 中的 host/info 来连接到外部服务器。我已经这样做了,如下所示:
$i++;
/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'REDACTED';
$cfg['Servers'][$i]['password'] = 'REDACTED';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Lang'] = '';
/* Bind to the localhost ipv4 address and tcp */
$cfg['Servers'][$i]['host'] = 'REDACTED';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
当我尝试通过 Xampp 加载它时,它给了我这个:
Error
SQL query: {REDACTED}
SET CHARACTER SET 'utf8mb4';
MySQL said: Documentation
1115 - Unknown character set: 'utf8mb4'
它似乎在加载时告诉查询更改字符集,而当它执行此操作时,它会发出错误消息。我尝试重新启动 Xampp,将其改回 UTF-8 并确保所有内容都已正确更新。
每当我将值(已编辑的)更改回默认值时,它都会再次工作。我该如何解决这个问题?
你的版本不支持那个字符集,我相信是5.5.3引入的。您应该升级 mysql 或降级 phpmyadmin。
那么错误就很明显了:设置了某个字符,但是你的mysql版本不支持,所以不知道。
根据https://dev.mysql.com/doc/refman/5.5/en/charset-unicode-utf8mb4.html:
utf8mb4 is a superset of utf8
升级mysql或降级phpmyadmin