mysql doc附加数据库_MySQL数据库附加(MySQL database add-on).doc

MySQL数据库附加(MySQL database add-on)

How to import a MYsql database under SQLyog 6.56 graphical interface, the database file format is: FRM and MYD and MYI, not SQL scripts, how to import them.

Don't tell this:

Export the entire database (command in the mysql \ bin directory of DOS)

Mysqldump - u user name-p database name >

Mysqldump - u root - p aaa > triple-a SQL

Mysqladmin-uroot-p create database; / / create database

Mysql - uroot - p database < database. SQL; / / import database

No use, look at the question in answer, high score reward!

How do you separate and attach databases using SQL statements?

For a separate database, we can use the Manage Studio interface or stored procedures. But for each method, you must ensure that no user is using this database. The next step is to use commands to separate or attach a database. You can handle the interface with the Manage Studio itself.

Separate database:

To use stored procedures to separate DATABASE, if can't find end user link, you can use the ALTER DATABASE command, and use a can interrupt existing links termination options to set the DATABASE to SINGLE_USER mode, set to SIGLE_USER code is as follows:

ALTER DATABASE [DatabaseName] SET SINGLE_USER WITH ROLLBACK IMMEDIATE is the CMD command to separate the DATABASE

Once a database is successfully isolated, the EXEC sp_detach_db DatabaseName is no different from the SQL Server perspective of deleting the database.

Additional database:

FOR additional DATABASE, you can use sp_attach_db stored procedure, or use the CREATE DATABASE command, with options FOR the ATTACH is recommended to use in a SQL Server2005 or higher version of the latter, the former is to forward compatible, it is being phased out, while the latter is more to provide more control of the file.

The CREATE DATABASE databasename

ON (FILENAME = 'D: \ Database \ dbname MDF')

FOR ATTACH | FOR ATTACH_REBUILD_LOG

However, for such an additional, we should pay attention to several places. Because it involves rebuild

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值