Home Database Mysql Tutorial mysql修改datadir的后续工作_MySQL

mysql修改datadir的后续工作_MySQL

Jun 01, 2016 pm 01:37 PM
mysql windows database folder

bitsCN.com


mysql修改datadir的后续工作

 

我们都知道,在mysql文件夹下面有my.ini文件,修改里面的datadir就可以改变数据库以及表的存放位置,默认在windows下,存放在C:/ProgramData/MySQL/MySQL Server 5.5/Data/,比如我们将datadir修改为I:/data,可能会遇到以下几种情况: 

1、重新打开mysql administrator或者相应的command line,我们发现数据的存储位置依然是原来的目录,出现这样的原因是没有停止mysql服务,my.ini没有在启动时重新被读取,我们可以通过命令行停止,或者在控制面板——管理——服务里面停止mysql服务,然后再开启; 

2、重新开启mysql服务时,出现了1067的错误,此时我们可以查看datadir所在的新目录下的错误日志文件,可能的原因是,没有将datadir原目录下的performance_schema和mysql两个文件夹复制到新目录下! 将它们复制过来即可。

bitsCN.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Lossless Scaling on Steam Deck OLED runs games at up to 2x FPS Lossless Scaling on Steam Deck OLED runs games at up to 2x FPS Aug 26, 2024 am 10:07 AM

Lossless Scaling on Steam Deck OLED runs games at up to 2x FPS

What should I do if I can't delete a Windows system dll file? Tips for completely deleting stubborn dll files What should I do if I can't delete a Windows system dll file? Tips for completely deleting stubborn dll files Jun 12, 2024 pm 02:46 PM

What should I do if I can't delete a Windows system dll file? Tips for completely deleting stubborn dll files

How to update the latest version of Bybit Exchange? Will there be any impact if it is not updated? How to update the latest version of Bybit Exchange? Will there be any impact if it is not updated? Feb 21, 2025 pm 10:54 PM

How to update the latest version of Bybit Exchange? Will there be any impact if it is not updated?

deepseek web version entrance deepseek official website entrance deepseek web version entrance deepseek official website entrance Feb 19, 2025 pm 04:54 PM

deepseek web version entrance deepseek official website entrance

How to install deepseek How to install deepseek Feb 19, 2025 pm 05:48 PM

How to install deepseek

How to fix mysql_native_password not loaded errors on MySQL 8.4 How to fix mysql_native_password not loaded errors on MySQL 8.4 Dec 09, 2024 am 11:42 AM

How to fix mysql_native_password not loaded errors on MySQL 8.4

Pi Node Teaching: What is a Pi Node? How to install and set up Pi Node? Pi Node Teaching: What is a Pi Node? How to install and set up Pi Node? Mar 05, 2025 pm 05:57 PM

Pi Node Teaching: What is a Pi Node? How to install and set up Pi Node?

Snapdragon X Elite CPU performance nearly identical on battery vs AC power in Vivobook S15 benchmarks Snapdragon X Elite CPU performance nearly identical on battery vs AC power in Vivobook S15 benchmarks Jun 21, 2024 am 06:50 AM

Snapdragon X Elite CPU performance nearly identical on battery vs AC power in Vivobook S15 benchmarks

See all articles