Merge branch 'accel-2'
[clsql.git] / doc / mysql-macosx-notes.txt
1 Instructions:
2
3 ----------------
4 1. Install MySQL from Fink, not from mysql.com
5
6 It is sufficient to install the binaries from Fink.
7 CLSQL requires the MySQL library libmysqlclient.dylib; this library  
8 is not provided with the mysql binary install.
9 This library is in /sw/lib/mysql . However, it is actually called  
10 libmysqlclient.14.0.0.dylib .
11 -----------------
12 2. After installing MySQL, do the following at the shell.
13 (Assuming that you do not want to have to load CLSQL as root user  
14 every time you use it.)
15
16 2a. Create a symbolic link from libmysqlclient.14.0.0.dylib to the  
17 name libmysqlclient.dylib .
18 2b. Change ownership to yourself along the path /sw/lib/mysql/ 
19 libmysqlclient.dylib .
20 -----------------
21 3. Either install CocoaMySQL or download the source of MySQL (e.g.  
22 5.0) from mysql.com.
23
24 CLSQL requires MySQL's header files. These files are not provided  
25 with Fink's binary MySQL install.
26 In CocoaMySQL the headers are found at: /Applications/CocoaMySQL.app/ 
27 Contents/Frameworks/SMySQL.framework/Versions/A/Headers
28 In MySQL 5.0 sources, the headers are found at: ~/Desktop/ 
29 mysql-5.0.15/include
30
31 3a. Copy the directory full of headers to /sw/include/mysql
32 3b. Make yourself the owner of these files.
33
34 You may now dispose of CocoaMySQL or the MySQL sources, if you desire.
35 -----------------
36 4. In the CLSQL sources, modify db-mysql/makefile to read as follows:
37
38 ...  CFLAGS="-I /sw/include/mysql" LDFLAGS=" -L/sw/lib/mysql/   ...
39
40 -----------------
41 5. In Lisp, do the following:
42
43 Assuming asdf and the CLSQL & UFFI sources are in the same directory;  
44 substitute the appropriate path for ~ .
45 The code below is right out of the CLSQL docs, but note particularly  
46 the commented expression.
47
48 (load "~/asdf.lisp")
49
50 (progn
51         (push "~/uffi-1.5.5/" asdf:*central-registry*)
52         (asdf:operate 'asdf:load-op :uffi)
53         (push "~/clsql-3.3.4/" asdf:*central-registry*)
54         (asdf:operate 'asdf:load-op :clsql))
55
56 (progn
57         (in-package :clsql)
58         (setf *default-database-type* :mysql)
59         (clsql:push-library-path "/sw/lib/mysql/")  ;  !!
60         (asdf:operate 'asdf:load-op 'clsql-mysql))