<分区>
我在运行最新 CentOS 7 的 DigitalOcean 上有一个 512MB 的 VPS。使用这些命令安装了 MySQL 5.6:
yum localinstall http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
yum install mysql-community-server
我正在为我的 my.cnf 使用以下内容:
[mysql]
# CLIENT #
port = 3306
socket = /var/lib/mysql/mysql.sock
[mysqld]
# GENERAL #
user = mysql
default-storage-engine = MyISAM
socket = /var/lib/mysql/mysql.sock
pid-file = /var/lib/mysql/mysql.pid
# MyISAM #
key-buffer-size = 128M
myisam-recover = FORCE,BACKUP
# SAFETY #
max-allowed-packet = 16M
max-connect-errors = 1000000
# DATA STORAGE #
datadir = /var/lib/mysql/
# CACHES AND LIMITS #
tmp-table-size = 32M
max-heap-table-size = 32M
query-cache-type = 0
query-cache-size = 0
max-connections = 500
thread-cache-size = 100
open-files-limit = 65535
table-definition-cache = 4096
table-open-cache = 100
# LOGGING #
log-error = /var/lib/mysql/mysql-error.log
log-queries-not-using-indexes = 0
slow-query-log = 0
slow-query-log-file = /var/lib/mysql/mysql-slow.log
当我尝试使用这些命令变体启动 MySQL 时,没有任何反应:
[root@server ~]# /etc/init.d/mysql start
-bash: /etc/init.d/mysql: No such file or directory
[root@server ~]# /etc/init.d/mysqld start
-bash: /etc/init.d/mysqld: No such file or directory
所以,我尝试了这个方法:
[root@server ~]# service mysql start
Redirecting to /bin/systemctl start mysql.service
它一直停留在该消息上,没有任何反应。我检查过 ps aux | grep mysql 但我没有看到正在运行的服务:
[root@server ~]# ps aux | grep mysql
root 10688 0.0 0.1 115212 644 ? Ss 20:08 0:00 /bin/bash /usr/bin/mysql-systemd-start post
root 12646 0.0 0.2 132520 1396 pts/0 S+ 20:16 0:00 /bin/systemctl start mysql.service
root 12852 0.0 0.1 112640 960 pts/1 S+ 20:17 0:00 grep --color=auto mysql
有什么想法吗?