简体   繁体   English

基于文件访问mySql数据库

[英]access mySql database on file basis

Okay, heres a easy one for all you mysql folks out there: 好吧,这是一个适合所有mysql人士的简单方法:

Our Win 2003 server crashed last night (durring installing of windows updates). 我们的Win 2003服务器昨晚崩溃了(在安装Windows Update时)。 We were able to restore old data from backup, but we miss 22 hours of data. 我们能够从备份中还原旧数据,但是错过了22个小时的数据。 We cannot start windows and therefore not access the data through mySql admin which is the program I use normally to make backup. 我们无法启动Windows,因此无法通过mySql admin(我通常使用该程序进行备份的程序)访问数据。 We have however been able to copy all data to external harddisk. 但是,我们已经能够将所有数据复制到外部硬盘上。

How do I access these data usning MySql Query browser and MySql Administrator tool? 如何使用MySql Query浏览器和MySql Administrator工具访问这些数据?

  1. If you don't have binlogs enabled, or cannot be sure at which point your backup snapshot was made trying to get the datadir running in another server is about your only option. 如果您未启用二进制日志,或者无法确定在何时备份备份快照,则尝试使datadir在另一台服务器上运行是您的唯一选择。 (Which for maximum possibility of recovery should be as much like the original as possible in MySQL version and other environmental data). (最大恢复可能性应该与MySQL版本和其他环境数据中的原始恢复尽可能一样)。
  2. If you do have active binlogs, look at this manual 如果有活跃binlogs,看本手册

Please let me preface this by saying, I'm not a Windows administrator, so permissions issues are outside my expertise. 请说出我不是Windows管理员,让我以此作为开头,所以权限问题不在我的专业范围内。

  1. Setup a new machine running the same version of MySQL. 设置一台运行相同版本MySQL的新计算机。
  2. Create a new folder and copy your backup of mysql data to that folder, including the mysql database. 创建一个新文件夹,并将您的mysql数据备份复制到该文件夹​​,包括mysql数据库。
  3. Edit your my.cnf file on the new machine to change the following: 在新计算机上编辑my.cnf文件,以更改以下内容:

# set your data directory

datadir = c:\\path\\to\\new\\datadir

# just in case

skip-slave-start

# optional

skip-networking

# if this is an emergency and you need to go through password recovery

skip-grant-tables

Restart MySQL and watch your error log for output. 重新启动MySQL并查看错误日志以获取输出。 It should start up and you can simply sign in as 'root' with no password and do what you need to do to backup your data. 它应该启动,您可以简单地以“ root”用户身份登录而无需输入密码,然后执行备份数据所需的操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM