问题描述
我安装了XDevAPI来连接mysql和nodejs.但是它抛出诸如服务器消失了"之类的错误,因为我使用的是3306端口.该如何解决.
I installed XDevAPI for connecting mysql and nodejs. but it throw error like "The server gone away" because i am using 3306 port. how to solve this.
推荐答案
端口3306默认为经典的MySQL Wire Protocol.用于Node.js的MySQL X DevAPI Connector仅支持X协议,该协议由X插件实现(默认在端口33060上实现).
Port 3306 defaults to the classic MySQL Wire Protocol. The MySQL X DevAPI Connector for Node.js only supports the X Protocol, which is implemented by the X Plugin (by default on port 33060).
您可以通过更新mysqlx_port
服务器变量或在启动服务器时使用--mysqlx-port=
选项来更改此设置.如果要在端口3306上使用X协议,则在启动服务器时还必须更新port
变量或使用--port=
选项使用其他值.
You can change this by updating the mysqlx_port
server variable or using the --mysqlx-port=
option when starting the server. If you want to use the X Protocol on port 3306 though you will also have to update the port
variable or use a different value with the --port=
option when starting the server.
免责声明:我是MySQL X DevAPI Connector for Node.js的首席开发人员
Disclaimer: I'm the lead developer of the MySQL X DevAPI Connector for Node.js
这篇关于如何使用带有3306端口的XDevAPI连接器将mysql连接到节点js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!