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