Home > Database > Mysql Tutorial > body text

Detailed explanation of MySQL backup, restore, and opening innoDB

黄舟
Release: 2017-03-20 13:56:20
Original
1519 people have browsed it

phpStudyTools

phpStudy is a program integration package for PHP debugging environment. This package integrates the latest Apache+PHP+MySQL+phpMyAdmin+ZendOptimizer. Among them, MySQL-Front is a particularly easy-to-use MySQL desktop management tool.

Use the command line that comes with MySQL to back up and restore

Assume that mysql is installed in D:/software/MySQL Server 5.1/
Then its bin There is a mysqldump.exe file in the directory
The account is root
The password is admin
The backup database name is test
The backup file is d:\test.sql

Backup

"D:/software/MySQL Server 5.1/bin/mysqldump.exe" -uroot   -padmin   -hlocalhost   -P3306   test -r d:\test.sql
Copy after login
Copy after login

Restore

"D:/software/MySQL Server 5.1/bin/mysql.exe" -u root -padmin test < d:/test.sql
Copy after login
Copy after login

innodb enabled*[Special note that MyISAM does not support transactions] *

Check if it is enabled

SHOW variables like &#39;have_%&#39;;
Copy after login
Copy after login

Detailed explanation of MySQL backup, restore, and opening innoDB

Stop MySQL

net stop mysql
Copy after login
Copy after login

Locate D :\tools\MYSQL\mysql-5.1.57-win32\data directory, find these 3 files
ib_logfile0
ib_logfile1
ibdata1
After backup, delete them

Note : D:\tools\MYSQL\mysql-5.1.57-win32 is my installation directory, please adjust it yourself

Modify the configuration file

Open the file: D: \tools\MYSQL\mysql-5.1.57-win32\my.ini

添加一行 
default-storage-engine=InnoDB

如果已经存在
default-storage-engine=MyISAM

像下面这样,注释掉即可#default-storage-engine=MyISAM
Copy after login
Copy after login

Start MySQL

net start mysql
Copy after login
Copy after login

phpStudy tool

phpStudy is a program integration package for PHP debugging environment. This package integrates the latest Apache+PHP+MySQL+phpMyAdmin+ZendOptimizer. Among them, MySQL-Front is a particularly easy-to-use MySQL desktop management tool.

Use the command line that comes with MySQL to back up and restore

Assume that mysql is installed in D:/software/MySQL Server 5.1/
Then there are A mysqldump.exe file
The account is root
The password is admin
The backup database name is test
The backup file is d:\test.sql

Backup

"D:/software/MySQL Server 5.1/bin/mysqldump.exe" -uroot   -padmin   -hlocalhost   -P3306   test -r d:\test.sql
Copy after login
Copy after login

Restore

"D:/software/MySQL Server 5.1/bin/mysql.exe" -u root -padmin test < d:/test.sql
Copy after login
Copy after login

innodb enable*[Special note that MyISAM does not support transactions]*

Check if it is enabled

SHOW variables like &#39;have_%&#39;;
Copy after login
Copy after login

Detailed explanation of MySQL backup, restore, and opening innoDB

Stop MySQL

net stop mysql
Copy after login
Copy after login

Locate D:\tools \MYSQL\mysql-5.1.57-win32\data directory, find these 3 files
ib_logfile0
ib_logfile1
ibdata1
After backup, delete them

Note: D: \tools\MYSQL\mysql-5.1.57-win32 is my installation directory, please adjust it yourself

Modify the configuration file

Open the file: D:\tools\ MYSQL\mysql-5.1.57-win32\my.ini

添加一行 
default-storage-engine=InnoDB

如果已经存在
default-storage-engine=MyISAM

像下面这样,注释掉即可#default-storage-engine=MyISAM
Copy after login
Copy after login

Start MySQL

net start mysql
Copy after login
Copy after login

The above is the detailed content of Detailed explanation of MySQL backup, restore, and opening innoDB. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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