CentOS 7下mysql 8修改datadir之後不能啟動
嘗試修改了mysql的datadir引數, 同時將資料檔案拷貝到了新的目錄/data下, 但是啟動mysql服務時,提示:
[root@mysql8-01 data]# systemctl status mysqld
● mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2019-07-03 10:42:07 CST; 14s ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 2907 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS (code=exited, status=1/FAILURE)
Process: 2885 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Main PID: 2907 (code=exited, status=1/FAILURE)
Status: "SERVER_BOOTING"
Error: 13 (Permission denied)
Jul 03 10:42:06 mysql8-01 systemd[1]: Starting MySQL Server...
Jul 03 10:42:07 mysql8-01 systemd[1]: mysqld.service: main process exited, code=exited, status=1/FAILURE
Jul 03 10:42:07 mysql8-01 systemd[1]: Failed to start MySQL Server.
Jul 03 10:42:07 mysql8-01 systemd[1]: Unit mysqld.service entered failed state.
Jul 03 10:42:07 mysql8-01 systemd[1]: mysqld.service failed.
檢視mysql日誌,發現有如下警告
2019-07-03T02:38:28.679543Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.14) MySQL Community Server - GPL.
mysqld: File './binlog.index' not found (OS errno 13 - Permission denied)
2019-07-03T02:40:21.848131Z 0 [Warning] [MY-010091] [Server] Can't create test file /data/mysql8-01.lower-test
2019-07-03T02:40:21.848279Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.14) starting as process 2822
2019-07-03T02:40:21.867130Z 0 [Warning] [MY-010091] [Server] Can't create test file /data/mysql8-01.lower-test
2019-07-03T02:40:21.867181Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /data/ is case insensitive
2019-07-03T02:40:21.868211Z 0 [ERROR] [MY-010119] [Server] Aborting
2019-07-03T02:40:21.868431Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.14) MySQL Community Server - GPL.
mysqld: File './binlog.index' not found (OS errno 13 - Permission denied)
2019-07-03T02:42:07.555956Z 0 [Warning] [MY-010091] [Server] Can't create test file /data/mysql8-01.lower-test
2019-07-03T02:42:07.556036Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.14) starting as process 2907
2019-07-03T02:42:07.558851Z 0 [Warning] [MY-010091] [Server] Can't create test file /data/mysql8-01.lower-test
2019-07-03T02:42:07.558865Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /data/ is case insensitive
2019-07-03T02:42:07.559679Z 0 [ERROR] [MY-010119] [Server] Aborting
2019-07-03T02:42:07.559877Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.14) MySQL Community Server - GPL.
這裡,需要將Selinux關閉:
[root@mysql8-01 data]# vi /etc/selinux/config
[root@mysql8-01 data]#
[root@mysql8-01 data]# setenforcing 0
bash: setenforcing: command not found...
[root@mysql8-01 data]# setenforce 0
[root@mysql8-01 data]#
[root@mysql8-01 data]#
[root@mysql8-01 data]# systemctl start mysqld
[root@mysql8-01 data]#
[root@mysql8-01 data]#
[root@mysql8-01 data]# systemctl status mysqld
● mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2019-07-03 10:46:09 CST; 5s ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 3020 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Main PID: 3042 (mysqld)
Status: "SERVER_OPERATING"
CGroup: /system.slice/mysqld.service
└─3042 /usr/sbin/mysqld
Jul 03 10:46:06 mysql8-01 systemd[1]: Starting MySQL Server...
Jul 03 10:46:09 mysql8-01 systemd[1]: Started MySQL Server.
再此嘗試啟動,成功
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8520577/viewspace-2649389/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- centos下安裝mysql不能啟動CentOSMySql
- centos安裝php後apache不能啟動怎麼辦CentOSPHPApache
- 修改MySQL資料庫儲存位置datadirMySql資料庫
- 修改域名之後的資料庫服務不能啟動的問題解決過程資料庫
- mysql不能啟動如何解決MySql
- 11.2 RAC 修改了uid後crs不能啟動的解決方法UI
- mysql 修改data目錄後 無法使用指令碼啟動薦MySql指令碼
- MySQL 8.0之後版本密碼修改MySql密碼
- centos 讓 mysql 隨系統啟動CentOSMySql
- CentOS 7 新增win7啟動項——修改預設啟動項CentOSWin7
- CentOS8修改IP地址CentOS
- CentOS8修改SSH埠CentOS
- 【MySQL】AppArmor導致datadir遷移無法啟動&初始化失敗MySqlAPP
- centOS修改主機名,重啟後無效解決CentOS
- MySQL初步安裝後更改datadir目錄幾種方式MySql
- centos重啟不能自動聯網的解決方法CentOS
- CentOS 8 修改網路卡名稱CentOS
- mysql的啟動,以及修改偵聽埠。MySql
- mysql之 表資料存放路徑非datadir目錄MySql
- 叢集安裝完成後,GCluster 服務不能啟動GC
- 系統重啟後卷不能自動掛載
- GitLab修改配置後nginx無法啟動GitlabNginx
- MySQL不能啟動 Can't start server : Bind on unix sockeMySqlServer
- 鴻蒙開發之修改啟動頁入口鴻蒙
- centos7.5 設定Mysql開機自啟動CentOSMySql
- CentOS7中啟動Tomcat後,8080埠不能被外部訪問的解決辦法。CentOSTomcat
- Centos修改DNS重啟或者重啟network服務後丟失問題處理CentOSDNS
- docker 不能正常啟動Docker
- Ios8之後, 定位的delegate不能觸發的問題iOS
- linux的centos版本修改時間重啟後無效的問題LinuxCentOS
- centos 修改resolv.conf後重啟系統恢復原狀CentOS
- MySQL Study之–Mysql啟動失敗“mysql.host”薦MySql
- MySQL 8 新特性之持久化全域性變數的修改MySql持久化變數
- 升級安裝windows8.1以後windowsphone8不能啟動虛擬機器的辦法Windows虛擬機
- CentOS5.6中裝好Oracle11g之後,啟動sqlplus報錯CentOSOracleSQL
- Linux主機名修改後導致mysql重啟失敗LinuxMySql
- CentOS如何啟動PostgreSQLCentOSSQL
- mysql提示啟動成功,但statu是isstopped,重啟後正常MySql