MySQL8 设置大小写 正确步骤

孤人 提交于 2020-11-15 00:21:11

<div class="info"><h5 id="在安装完成之后初始化数据库之前修改-my.cnf" style="margin: 10px 0px; padding: 0px; font-size: 12px; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);">在安装完成之后,初始化数据库之前,修改 my.cnf</h5><ol style="padding: 0px 0px 0px 40px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; white-space: normal; background-color: rgb(255, 255, 255);" class=" list-paddingleft-2"><li><p>打开mysql配置文件<br style="margin: 0px; padding: 0px;"><code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: &quot;Courier New&quot;, sans-serif !important; background-color: rgb(245, 245, 245) !important; border: 1px solid rgb(204, 204, 204) !important; border-radius: 3px !important;">vim /etc/my.cnf</code></p></li><li><p>在尾部追加一行<br style="margin: 0px; padding: 0px;"><code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: &quot;Courier New&quot;, sans-serif !important; background-color: rgb(245, 245, 245) !important; border: 1px solid rgb(204, 204, 204) !important; border-radius: 3px !important;">lower_case_table_names=1</code><br style="margin: 0px; padding: 0px;">并保存,然后再初始化数据库。</p></li><li><p>重启mysql,<br style="margin: 0px; padding: 0px;"><code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: &quot;Courier New&quot;, sans-serif !important; background-color: rgb(245, 245, 245) !important; border: 1px solid rgb(204, 204, 204) !important; border-radius: 3px !important;">systemctl restart mysqld.service</code></p></li></ol><p style="margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; white-space: normal; background-color: rgb(255, 255, 255);">如果这个操作是初始化数据库之后,也就是安装后运行过服务,那就可能会出错。<br style="margin: 0px; padding: 0px;">错误类似于<code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: &quot;Courier New&quot;, sans-serif !important; background-color: rgb(245, 245, 245) !important; border: 1px solid rgb(204, 204, 204) !important; border-radius: 3px !important;">Job for mysqld.service failed because the control process exited with error...</code><br style="margin: 0px; padding: 0px;">然后就无法启动 mysql 服务了,除非打开&nbsp;<code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: &quot;Courier New&quot;, sans-serif !important; background-color: rgb(245, 245, 245) !important; border: 1px solid rgb(204, 204, 204) !important; border-radius: 3px !important;">vim /etc/my.cnf</code>把追加的<code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: &quot;Courier New&quot;, sans-serif !important; background-color: rgb(245, 245, 245) !important; border: 1px solid rgb(204, 204, 204) !important; border-radius: 3px !important;">lower_case_table_names=1</code>删除掉。</p><p style="margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; white-space: normal; background-color: rgb(255, 255, 255);">我在网上找了好久,暂时没找到比较好的解决方法,而 MySQL5 就没有这个问题。</p><h5 id="最后我的解决方法如下" style="margin: 10px 0px; padding: 0px; font-size: 12px; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);">最后我的解决方法如下:</h5><p style="margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; white-space: normal; background-color: rgb(255, 255, 255);">如果你不在意数据的话直接删除数据</p><ol style="padding: 0px 0px 0px 40px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; white-space: normal; background-color: rgb(255, 255, 255);" class=" list-paddingleft-2"><li><p>停止MySQL<br style="margin: 0px; padding: 0px;"><code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: &quot;Courier New&quot;, sans-serif !important; background-color: rgb(245, 245, 245) !important; border: 1px solid rgb(204, 204, 204) !important; border-radius: 3px !important;">systemctl stop mysqld.service</code><br style="margin: 0px; padding: 0px;"></p></li><li><p>删除 MySQL的数据 /var/lib/mysql<br style="margin: 0px; padding: 0px;"><code style="margin: 1px 5px; line-height: 1.8; vertical-align: middle; display: inline-block; padding: 0px 5px !important; font-family: &quot;Courier New&quot;, sans-serif !important; background-color: rgb(245, 245, 245) !important; border: 1px solid rgb(204, 204, 204) !important; border-radius: 3px !important;">rm -rf /var/lib/mysql</code><br style="margin: 0px; padding: 0px;"></p></li><li><p>再按照上面的方法进行一遍操作即可。</p></li></ol><p><br></p></div>

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!