This is a question from a user on bbs.csdn.net. It was quite simple at first, but it took three hours to get the complete answer. I learned a lot from it, so I wrote it out and shared it with you.
Bdb engine Introduction
Sleepycat software provides MySQL with the Berkeley dB transaction storage engine. This storage engine is generally referred to as bdb. Support for the bdb storage engine is included in the MySQL source code distribution edition and activated in the mysql-Max binary distribution edition.
The bdb table may have a larger chance of surviving the crash and has the ability to perform transaction commit and rollback operations. The MySQL source code distribution version and the bdb distribution version that has been patched and can work with MySQL are provided together. You cannot use an unpatched bdb version to work with MySQL ..
We work closely with sleepycat on MySQL AB to ensure that the quality of MySQL/bdb interfaces is high. (Even though Berkeley dB itself is very tested and reliable. The MySQL interface is still considered to be of the third-level quality. We will continue to improve and optimize it ).
When it provides support for all issues involving the bdb table, we promise to help our users locate the problem and create reusable test cases. Any such test case is transferred to sleepycat, which in turn helps us locate and solve the problem. Because this is a two-phase operation, it may take a little longer to solve any bdb table problems than other storage engines. However, we expect that this process will not be significantly difficult because the Berkeley dB code itself is used in many applications other than MySQL.
For more information about Berkeley dB, visit the sleepycat website at http://www.sleepycat.com /.
My configurations
I installed the XAMPP package on my machine. It was initially used to run bugfree and configure MySQL 5.0.18. This XAMPP version is apachefriends XAMPP (Basic Package) version 1.5.1. You can obtain the latest version online.
1st attempts
Register and start mysqld as a service, connect to the database with MySQL, and create a bdb table under the test database. Generally, the table is successfully created, but the bdb engine is not applied to the table.
Mysqld -- install # Install mysqld as a service
Net start MySQL # Start the MySQL Service
Mysql-r root-P # log on to the MySQL server under the command line
Use test # use the test database under MySQL
Create Table testbdb (id int) type = bdb; # create a bdb table
When querying the engine of the table in the information_schema database, the result is null. Obviously, you cannot create a bdb table in this case.
Select table_name, engine from tables where table_schema = 'test ';
2nd attempts
Follow the above procedure, but register mysqld-max-NT as a service. Well, now we can create a bdb table. Is it true that only mysqld-Max and mysqld-max-NT can support the bdb database engine?
3rd attempts
Is it true that only mysqld-Max can support the bdb database engine? So I checked the help of mysqld (mysqld -- verbose -- Help) and found that mysqld can support bdb with the -- bdb parameter. So I willMySQL/binAll the five server programs in the directory are listed and started in standard mode. It is found that mysqld and mysqld-nt do not support bdb.
D: xamppxamppmysqlbin> mysqld -- bdb -- Standalone
070429 9:53:40 [Warning] This binary does not contain bdb storage engine
D: xamppxamppmysqlbin> mysqld-NT -- bdb -- Standalone
070429 9:58:01 [Warning] This binary does not contain bdb storage engine
Several other server programs can use the bdb database engine without configuring the my. ini script. However, this does not mean that mysqld has reconfigured my. INI script (in my. add bdb in [mysqld] In INI), and then register as a service to support bdb. If you do, the service cannot be started, in addition, a 1067 error will be returned to you.
Note the preceding warning information, that is, "This binary version does not include the bdb engine". Therefore, no matter how you configure mysqld and my. ini, you cannot use the bdb engine.
Summary
Therefore, in Windows XP and MySQL 5.0.18, the server programs mysqld and mysqld-nt do not support the bdb database engine, therefore, to support the service, select mysqld-Max or mysqld-max-nt. In addition, you can use the show engines command to view the engines supported by the current database. Example:
Mysql> show engines;
+ ------------ + --------- + ---------------------------------------------------------------- +
| Engine | Support | comment |
+ ------------ + --------- + ---------------------------------------------------------------- +
| MyISAM | default engine as of MySQL 3.23 With great performance |
| Memory | Yes | hash based, stored in memory, useful for temporary tables |
| InnoDB | Yes | supports transactions, row-level locking, and foreign keys |
| Berkeleydb | no | supports transactions and page-level locking |
| Blackhole | no |/dev/null storage engine (anything you write to it disappears) |
| Example | no | example storage engine |
| Archive | Yes | archive storage engine |
| CSV | no | CSV storage engine |
| Ndbcluster | no | clustered, fault-tolerant, memory-based tables |
| Federated | no | federated MySQL storage engine |
| Mrg_myisam | Yes | collection of identical MyISAM tables |
| Isam | no | obsolete storage engine |
+ ------------ + --------- + ---------------------------------------------------------------- +
After searching, it is found that the bdb database engine has been acquired by Oracle and is included in its embedded database product line. This is obviously in conflict with MySQL. Therefore, MySQL does not support the bdb database engine from the underlying layer, but instead uses plug-ins. At this point, you can find it in MySQL 5.1 reference manual-Chinese version. The chapter is <chapter 16th: writing a custom storage engine>.