Home > Database > Mysql Tutorial > body text

MySQL Data目录查找并迁移到data文件夹中_MySQL

WBOY
Release: 2016-06-01 13:29:31
Original
919 people have browsed it

bitsCN.com

MySQL Data目录查找并迁移到data文件夹中

 

MySQL数据库安装成功后,却发现在MySQL安装目录下的Data目录竟然没有新建的数据库?那么如何查找真正的data目录呢?下面绿茶小编教你查找真正的Data目录并迁移出去。

 

真正的data目录查找方法:

 

  1、方法一:查找mysql.ini文件

 

  搜索datadir关键词,发现原来路径配置和basedir不一致

 

  datadir="C:/Documents and Settings/All Users/Application Data/MySQL/MySQL Server 5.5/Data/"

 

  2、方法二:sql语句

 

  有一条语句可以查找到:

 

  show variables like 'datadir'

 

  原来真的没在安装目录下面,竟然在:

 

  C:/Documents and Settings/All Users/Application Data/MySQL/MySQL Server 5.5/data目录下面。

 

   找到了真实的date目录,下面我们就要迁移过来了。

 

  迁移方法:

 

  1、先将MySQL服务停止;

 

  2、将之前的data目录复制到目标data文件夹中,覆盖之;

 

  3、重启MySQL服务即可。

bitsCN.com
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!