Mysql server 启动但无法连接网络问题

Posted

技术标签:

【中文标题】Mysql server 启动但无法连接网络问题【英文标题】:Mysql server starts but can not connect network issue 【发布时间】:2017-12-30 08:04:45 【问题描述】:

我可以通过运行 5.7 安装程序看到我有一个正在运行的服务器。当我运行 --install 时,我得到“安装/删除服务被拒绝!”。我想运行服务器并使用 mysqlshow 来查看我是否正确安装了服务器。找到https://dev.mysql.com/doc/refman/5.7/en/can-not-connect-to-server.html 并通读。

我尝试通过 330 端口 telnet 到 localhost 并得到:

Connecting To localhost...Could not open connection to the host, on port 330: Connect failed

当我查看打开的端口时,我根本没有看到 330 列出。

我使用了 mysqladmin 并指定了我所在的端口,我确实得到了一个 mysqladmin 使用列表,看起来我可以开始写入表,但我没有连接到服务器,所以它都不起作用。之后尝试使用mysqlshow并得到:

bin\mysqlshow: Can't connect to MySQL server on 'localhost' (10061)

C:\MYSQL>bin\mysqld --console
2017-07-24T16:17:23.646121Z 0 [Warning] TIMESTAMP with implicit DEFAULT 
value is deprecated. Please use --explicit_defaults_for_timestamp server 
option (see documentation for more details).
2017-07-24T16:17:23.646121Z 0 [Note] --secure-file-priv is set to NULL. 
Operations related to importing and exporting data are disabled
2017-07-24T16:17:23.646121Z 0 [Note] bin\mysqld (mysqld 5.7.19) starting as 
process 3572 ...
2017-07-24T16:17:23.646121Z 0 [ERROR] Can't find error-message file 
'C:\MYSQL\share\errmsg.sys'. Check error-message file location and 'lc-
messages-dir' configuration directive.
2017-07-24T16:17:23.646121Z 0 [Note] InnoDB: Mutexes and rw_locks use 
Windows interlocked functions
2017-07-24T16:17:23.646121Z 0 [Note] InnoDB: Uses event mutexes
2017-07-24T16:17:23.646121Z 0 [Note] InnoDB: _mm_lfence() and _mm_sfence() 
are used for memory barrier
2017-07-24T16:17:23.646121Z 0 [Note] InnoDB: Compressed tables use zlib 
1.2.3
2017-07-24T16:17:23.646121Z 0 [Note] InnoDB: Number of pools: 1
2017-07-24T16:17:23.646121Z 0 [Note] InnoDB: Not using CPU crc32 
instructions
2017-07-24T16:17:23.677544Z 0 [Note] InnoDB: Initializing buffer pool, total 
size = 128M, instances = 1, chunk size = 128M
2017-07-24T16:17:23.693017Z 0 [Note] InnoDB: Completed initialization of 
buffer pool
2017-07-24T16:17:24.640166Z 0 [Note] InnoDB: Highest supported file format 
is Barracuda.
2017-07-24T16:17:27.906296Z 0 [Note] InnoDB: Creating shared tablespace for 
temporary tables
2017-07-24T16:17:27.906296Z 0 [Note] InnoDB: Setting file '.\ibtmp1' size to 
12 MB. Physically writing the file full; Please wait ...
2017-07-24T16:17:30.117639Z 0 [Note] InnoDB: File '.\ibtmp1' size is now 12 
MB.
2017-07-24T16:17:30.351854Z 0 [Note] InnoDB: 96 redo rollback segment(s) 
found. 96 redo rollback segment(s) are active.
2017-07-24T16:17:30.351854Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) 
are active.
2017-07-24T16:17:30.351854Z 0 [Note] InnoDB: Waiting for purge to start
2017-07-24T16:17:33.071230Z 0 [Note] Executing 'SELECT * FROM 
INFORMATION_SCHEMA.TABLES;' to get a list of tables using the deprecated 
partition engine. You may use the startup option '--disable-partition-
engine-check' to skip this check.
2017-07-24T16:17:33.071230Z 0 [Note] Beginning of list of non-natively 
partitioned tables
2017-07-24T16:17:34.880009Z 0 [Note] End of list of non-natively partitioned 
tables

我该怎么做才能开始编写可以创建我需要的表的mysql命令?

【问题讨论】:

这个链接有问题的答案:***.com/questions/119008/… 这是我创建数据库的一次。我只是想在向表授予权限之前连接服务器。 MySQL 监听的端口通常是 3306 而不是 330。 谢谢我弄明白了。 【参考方案1】:
"C:\Program Files (x86)\MySQL\MySQL Server 5.1\bin\mysqld" --install

如果您不以管理员身份运行 cmd,您将看到安装/删除服务被拒绝!

所以运行提升的命令提示符(开始->cmd->以管理员身份运行)以查看服务成功安装消息。

【讨论】:

以上是关于Mysql server 启动但无法连接网络问题的主要内容,如果未能解决你的问题,请参考以下文章

本机上的mysql突然连接不上,控制面板中mysql的服务无法启动

安装了mysql,然后建立了一个连接,但是无法连接,显示can't connect to mysql server 10038,

win10无internet安全

「Ubuntu」通过无线网络安装Ubuntu Server,启动系统后如何连接无线网络

如何解决 SQL Server 2000 中的连接问题

力控使用ODBCRounter连接关系数据库,连接sql server没有任何问题,但连接mysql出现数据无法更新现象。