mysql修改数据存储路径报错处理
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'
解决?: >>>
1 2 3 4 5 6 7 8 9 | vim /etc/my .cnf >>> [client] default-character- set =utf8 socket= /storage/db/mysql/mysql .sock [mysql] default-character- set =utf8 socket= /storage/db/mysql/mysql .sock |
2019-06-27T09:08:24.769172Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2019-06-27T09:08:24.769304Z 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2019-06-27T09:08:24.769322Z 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2019-06-27T09:08:24.769333Z 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2019-06-27T09:08:24.769342Z 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2019-06-27T09:08:24.769364Z 0 [ERROR] InnoDB: Cannot open datafile './ibtmp1'
2019-06-27T09:08:24.769374Z 0 [ERROR] InnoDB: Unable to create the shared innodb_temporary
2019-06-27T09:08:24.769384Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Cannot open a file
2019-06-27T09:08:25.370277Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2019-06-27T09:08:25.370330Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2019-06-27T09:08:25.370341Z 0 [ERROR] Failed to initialize builtin plugins.
2019-06-27T09:08:25.370349Z 0 [ERROR] Aborting
解决?: >>> setenforce 0 #临时关闭selinux模式
#或永久解决
1 2 3 | vim /etc/selinux/config >>> SELINUX=disabled |
如果安装了apparmor
1 | vim /etc/apparmor .d /usr .sbin.mysqld |
## 有这两行,规定了mysql使用的数据文件路径权限
1 2 3 4 5 | /var/lib/mysql/ r, /var/lib/mysql/ ** rwk, 改 >>> /data/mysql/ r, /data/mysql/ ** rwk, |
## 重启:
1 | sudo service apparmor restart |
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 智能桌面机器人:用.NET IoT库控制舵机并多方法播放表情
· Linux glibc自带哈希表的用例及性能测试
· 深入理解 Mybatis 分库分表执行原理
· 如何打造一个高并发系统?
· .NET Core GC压缩(compact_phase)底层原理浅谈
· 手把手教你在本地部署DeepSeek R1,搭建web-ui ,建议收藏!
· 新年开篇:在本地部署DeepSeek大模型实现联网增强的AI应用
· Janus Pro:DeepSeek 开源革新,多模态 AI 的未来
· 互联网不景气了那就玩玩嵌入式吧,用纯.NET开发并制作一个智能桌面机器人(三):用.NET IoT库
· 【非技术】说说2024年我都干了些啥