Linux

CentOS 6.4 上的 MySQL 5.1.69 不知道啟用命名管道?

  • September 13, 2013

嘗試在 CentOS 6.4 /64 位伺服器上安裝 MySQL(用於 WordPress)。

我已經安裝了mysql-server-5.1.69-1.el6_4.x86_64軟體包並執行了以下命令:

# chkconfig mysqld on
# service mysqld start
# /usr/bin/mysqladmin -u root password 'xxxxx'
# /usr/bin/mysql_secure_installation

然後我注意到該mysqld_safe程序正在監聽 0.0.0.0 並決定更改它 - 以便我的 WordPress 安裝僅使用域套接字(或 unix 管道?不確定正確的術語)。

所以我修改/etc/my.cnf為:

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
bind-address = localhost
skip-networking
enable-named-pipe

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

但是現在 MySQL 拒絕啟動:

# service mysqld restart
Stopping mysqld:                                           [  OK  ]
MySQL Daemon failed to start.
Starting mysqld:                                           [FAILED]

/var/log/mysqld.log包含:

mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
 InnoDB: Initializing buffer pool, size = 8.0M
 InnoDB: Completed initialization of buffer pool
 InnoDB: Started; log sequence number 0 44233
[ERROR] /usr/libexec/mysqld: unknown option '--enable-named-pipe'
[ERROR] Aborting
 InnoDB: Starting shutdown...
 InnoDB: Shutdown completed; log sequence number 0 44233
[Note] /usr/libexec/mysqld: Shutdown complete
mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

我搜尋了Google並蒐索 /usr/share/mysql/*.cnf了該指令,但沒有找到任何提示。

沒有提示?

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
bind-address = localhost
skip-networking
enable-named-pipe <-------------------

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

根據該版本 MySQL 的線上文件

--enable-named-pipe
Command-Line Format --enable-named-pipe
Option-File Format  enable-named-pipe
Platform Specific   windows  <--------------------

啟用對命名管道的支持。此選項只能與支持命名管道連接的 mysqld-nt 和 mysqld-debug 伺服器一起使用。

從您的設置中刪除該設置/etc/my.cnf並重新啟動該過程。

引用自:https://serverfault.com/questions/538652