Windows下Mysql数据库文件怎么知道保存位置? html
用文本编辑器打开my.ini配置文件,你会发现有这么两句话 mysql
#Path to installation directory. All paths are usually resolved relative to this. basedir="D:/apps/temp/MySQL/MySQL Server 5.5/" #Path to the database root datadir="C:/ProgramData/MySQL/MySQL Server 5.5/Data/"
basedir表示的是mysql数据基础数据库保存位置,而datadir是咱们建立的数据库保存位置,若是要想让建立的数据库文件保存到咱们指定的路径,那么修改这里就能够了。 sql
固然咱们也能够经过命令来查看mysql的配置选项,具体命令用到 show variables like 'xxx%' (这里还能够使用通配符) 数据库
## 查看数据库文件位置
show variables like 'datadir' app
其余的配置参数,小伙伴们本身发掘吧。 编辑器