Showing posts with label storage engine. Show all posts
Showing posts with label storage engine. Show all posts

Sunday, March 29, 2009

MySQL :: Compiling the skeleton engine

From MySQL-5.1 there is support for pluggable storage engine. Here we will learn how to compile and use a skeleton engine.
First you need to have MySQL installed in your system. For installing follow this link

Now get the latest version of the skeleton engine. You will get it here
http://hg.tangent.org/skeleton-mysql-engine?ca=tip;type=gz

Now Step 1 untar and uncompress the file.

Now cd to this directory. You will see there is no configure file. Step 2 to generate on do the following

[root@localhost skeleton-mysql-engine-0beed5ef2859]# sh config/bootstrap+ '[' -f /usr/bin/glibtoolize ']'
+ LIBTOOLIZE=libtoolize
+ aclocal
+ autoheader
+ libtoolize --automake --force
+ automake --add-missing --force
configure.in:5: installing `config/missing'
configure.in:5: installing `config/install-sh'
src/Makefile.am: installing `config/depcomp'
Makefile.am: installing `./INSTALL'
+ autoconf

Now Step 3 is to configure

[root@localhost skeleton-mysql-engine-0beed5ef2859]# ./configure --with-mysql=/root/Desktop/mysql-5.1.30/ --libdir=/usr/local/mysql-5.1.30/lib/mysql/

Here the --with-mysql should be pointed to a source tree for MySQL. The --libdir can be used to say which lib directory the plugin should be installed in once it is compiled.

Now Step 4 is to just make, make install.

[root@localhost skeleton-mysql-engine-0beed5ef2859]# make
[root@localhost skeleton-mysql-engine-0beed5ef2859]# make install

Now start mysql and connect to it. Then Step 5 is to load it.

mysql> INSTALL PLUGIN skeleton SONAME 'libskeleton_engine.so';
Query OK, 0 rows affected (0.01 sec)

You can see all the storage engines.

mysql> show plugins;
+------------+--------+----------------+-----------------------+---------+
| Name | Status | Type | Library | License |
+------------+--------+----------------+-----------------------+---------+
| binlog | ACTIVE | STORAGE ENGINE | NULL | GPL |
| CSV | ACTIVE | STORAGE ENGINE | NULL | GPL |
| MEMORY | ACTIVE | STORAGE ENGINE | NULL | GPL |
| MyISAM | ACTIVE | STORAGE ENGINE | NULL | GPL |
| MRG_MYISAM | ACTIVE | STORAGE ENGINE | NULL | GPL |
| SKELETON | ACTIVE | STORAGE ENGINE | libskeleton_engine.so | BSD |
+------------+--------+----------------+-----------------------+---------+
6 rows in set (0.00 sec)

See,you have loaded your first storage engine.

MySQL :: Step by step hacking into MySQL

First of all a quiz.Do you know which database has been used in Facebook?
Guess guess guess.......

its MySQL. This is one of the biggest MySQL implementation in the world. So I think you should have some more respect for MySQL now. If you want to learn more about MySQL than my blog might help you. Here I will discuss on how to make the best use of this open source software,specially on storage engine like how to make your own storage engine etc. Here are the links to my articles on MySQL.

1. MySQL :: Installing in Linux from source

2. MySQL :: Uninstalling


3. MySQL :: Compiling the skeleton engine