~pbms-core/pbms/5.11-beta

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
Building and Installing MySQL 5.1 and the BLOB Streaming Daemon
===============================================================

This document describes how to build the pluggable Streaming Daemon for MySQL 5.1 on MacOS X and Linux.

If you already have a compiled MySQL 5.1 source tree then skip to step 4.

1. Download MySQL 5.1
---------------------

To build the Streaming Daemon you need to download and build MySQL 5.1. I recommend the source download from:

http://dev.mysql.com/downloads/mysql/5.1.html

Unpack the .tar.gz in your development directory.

Alternatively you can use the latest sources directly from the BitKeeper repository as described here:

http://dev.mysql.com/doc/refman/5.1/en/installing-source-tree.html

For this document I will assume your development directory is '/home/build', and that the MySQL source tree is in a directory named  'mysql-51'. In other words, the MySQL source tree is located in the directory: '/home/build/mysql-51'

2. Configure and build MySQL 5.1
--------------------------------

Currently, I recommend you configure MySQL 5.1 as follows:

$ ./configure --with-zlib-dir=bundled --with-extra-charsets=complex --with-plugins=max-no-ndb --with-embedded-server --enable-thread-safe-client --with-big-tables

Please note, you will probably want to add some of the options described below.

After configuration, make and install MySQL:

$ make
$ make install

3. Additional MySQL Options
---------------------------

In addition to the options above, you will probably want to use the following options:

--prefix=<mysql-home>

Use this option to specify an alternative "home" for mysql. By default MySQL will be installed in the location '/usr/local/mysql'. This is inconvenient for 2 reasons:
* you need root privileges to install in this location,
* you may already have a production version of MySQL installed here.

So for testing I recommend using you add the following to configure command above: --prefix=/home/build/test

--with-mysqld-user=<user>

Specify an alternative user for the mysqld executable (default is mysql). I recommend using the user under which you are building mysql. In this way you will not have to start the MySQL server as root.

In this document we are using a user with the name 'build', so you should add the following option to the configure command: --with-mysqld-user=build

--with-debug=yes/no/full

For development or debug purpose use the option --with-debug=yes or --with-debug=full. If you wish to perform performance tests, then make sure you use --with-debug=no, or omit this option.

Whichever option you use, remember to build the Streaming Daemon with the same options or it will not load, or otherwise crash (see below).

4. Download the Streaming Daemon
--------------------------------

You can download the Streaming Daemon from http://www.blobstreaming.org.

Unpack the .tar.gz archive in your development directory (assumed to be /home/build/ in this document).

5. Configure and build the Streaming Daemon
-------------------------------------------

Assuming the MySQL source tree has been built in the directory, '/home/build/mysql-51', as follows:

Configure the Streaming Daemon as follows:

$ ./configure --with-mysql=/home/build/mysql-51 --with-debug

--with-mysql indicates the path to the MySQL source tree. The plug-in will be built with the same build options and installation location as MySQL.

--with-debug specifies the debug level. Possible options are yes or no. If the option is omitted the build will default to the debug level of the MySQL build. This option only effects if the plug-in is compiled for debugging or optimized, it does not change any other flags which are taken from the MySQL build.

After configuration, build and install the plug-in:

$ make
$ make install

This copies the plug-in shared library to the directory where it can be found by the MySQL server. 

6. Loading and using the plug-in
--------------------------------

In order to load the plug-in, start the MySQL server, and connect with the MySQL shell, for example:

$ cd /home/build/test
$ bin/mysqld_safe &
$ bin/mysql -u root

Now enter the following command:

mysql> INSTALL PLUGIN PBMS SONAME 'libpbms.so';

The server will load and register the the Streaming Daemon plug-in in the mysql.plugin table. The plug-in is now available whenever the server is started.