
我使用以下順序:
[root@localhost /]# yum install -y mysql mysql-server mysql-devel
安裝mysql
。
安裝後我想透過以下方式啟動mysql:
[root@localhost /]# /etc/init.d/mysqld start
-bash: /etc/init.d/mysqld: there is no file or directory
但你看,我不能以這種方式開始它。
所以,我使用:
find / -name mysqld
為了找到 mysqld,我得到:
[root@localhost /]# find / -name mysqld
/usr/libexec/mysqld
所以,我使用:
/usr/libexec/mysqld start
啟動mysql,但發生錯誤:
[root@localhost /]# /usr/libexec/mysqld start
2017-05-19 14:28:17 139762539387072 [Warning] option 'open_files_limit': unsigned value 18446744073709551615 adjusted to 4294967295
2017-05-19 14:28:17 139762539387072 [Note] /usr/libexec/mysqld (mysqld 10.1.20-MariaDB) starting as process 82223 ...
2017-05-19 14:28:17 139762539387072 [Warning] Could not increase number of max_open_files to more than 1024 (request: 5035)
2017-05-19 14:28:17 139762539387072 [ERROR] WSREP: rsync SST method requires wsrep_cluster_address to be configured on startup.
並被困在這裡。
有人知道如何解決嗎?
答案1
在 CentOS 7 上,您將使用以下命令。
$ sudo systemctl start mysqld
如果你希望 mysqld 在啟動時自動啟動,你可以這樣做
$ sudo systemctl enable mysqld
編輯:您確定安裝了 MySQL 並且沒有嘗試安裝 MariaDB 嗎?我相信 MariaDB 是 CentOS 的預設資料庫引擎。您可以檢查它是否確實已安裝
$ rpm -q mysqld
否則,我建議按照說明進行操作這裡