[Mysql-cocoa-commits] CVS: Documentation/website install_mysql-4.0.14.html,NONE,1.1 archives.html,1.
Brought to you by:
sergecohen
From: Serge C. <ser...@us...> - 2003-08-27 21:54:31
|
Update of /cvsroot/mysql-cocoa/Documentation/website In directory sc8-pr-cvs1:/tmp/cvs-serv14708 Modified Files: archives.html index.html styles.css Added Files: install_mysql-4.0.14.html Log Message: Added an instruction pages describing how to build MySQL from sources on Jaguar (with gcc-3.3). 2003-08-27; Serge Cohen. --- NEW FILE: install_mysql-4.0.14.html --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <HTML> <HEAD> <LINK REL=stylesheet TYPE="text/css" HREF="styles.css"> <TITLE>Installing MySQL on Jaguar</TITLE> <META name="author" content="Serge Cohen"> <META name="copyright" content="2003, Serge Cohen"> <META name="keywords" content="free software, gnu, GNU, database, mysql, MySQL, mac, macintosh, mac os x, Mac OS X, API, DB API, MacOS X, MacOSX"> <META name="description" content="How to install MySQL (version 4.0.14) on Mac OS X 10.2 (Jaguar)."> </HEAD> <BODY bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#00a800" alink="#ff1100"> <!--content start--> <h1>MySQL Cocoa project : Installing MySQL on Jaguar</h1> <a name="home"><p>Home page of the MySQL Cocoa project can be found <a href="http://mysql-cocoa.sourceforge.net/index.html">here</a></p></a> <p>The content of this page is included in the distributed disk image containing the patch, and the startup module. You'll find the disk image in the <a href="#files">File section</a>.</p> <h2>Conventions</h2> <ul> <li><code class="demo">Constant Width</code> text refers to the terminal output.</li> <li><code class="demo"><b>Constant Width Bold</b></code> text is your input to the terminal.</li> <li><code class="demo"><i>Constant Width Italic</i></code> text is a variable part of your input.</li> <li><code class="demo">%</code> is used to represent the shell prompt in normal user mode.</li> <li><code class="demo">#</code> is used to represent the shell prompt in root mode.</li> </ul> <p>Furthermore, I consider that you will be running the MySQL server under a user named <code><em>mysql</em></code>, with home directory being <code><em>/Users/mysql</em></code>. You can make such a user using the <em>Users</em> preference pane of the <em>System Preference</em>. As a locally installed software, we will install the server in <code>/usr/local</code>, and to keep the data of mysql in the users domain, the data directory will be placed in <code>/Users/mysql/DB_Data</code>. Still, given the level of details of these instruction you should be able to install in different destination folders.</p> <p>If you want to <em>skip the details and explanations</em> go for the grey background areas (just the commands in the shell).</p> <h2>1. Backing up your existing data</h2> <p>If you have an existing and used MySQL server, and you are planning to replace it by a newer version of the server, it is usually a good idea to backup your data (though, if you stay in the same version – you were already using MySQL verion 4.0 before – the new server should be able to read you database without having to reload them). The easiest is to use mysqldump as mysql root to make a single file containing all your data:</p> <p>Be sure to go in a directory where there is no risk of unwanted deletion of your backup file. Finally you have to shutdown the server.</p> <div class="code"> <code> % <b>cd </b><i>in/some/safe/directory</i><br> % <b>mysqldump --user=root -p --host=localhost --add-drop-table --add-locks --all --all-databases --lock-tables --complete-insert > </b><i>Data_YYYY-MM-DD</i><b>.mysql</b><br> Enter password: <i>type root(mysql) password</i><br> % <b>mysqladmin -u root -p shutdown</b><br> Enter password: <i>type root(mysql) password</i> </code> </div> <p>Now if you want to be sure that you don't mix two different installation of the database (if you are a bit paranoiac...), you can shutdown the server and remove all the files which where installed. Assuming your previous installation was also from sources (with prefix set to <code>/usr/local</code>) that would give something like:</p> <div class="code"> <pre>% <b>cd /usr/local/bin</b> % <b>su</b> Password: <i>type root(system) password</i> # <b>find . -name "my*" -exec rm {} \;</b> # <b>rm replace comp_err perror resolveip resolve_stack_dump isamchk isamlog pack_isam msql2mysql</b> # <b>cd ../include</b> # <b>rm -rf mysql</b> # <b>cd ../lib</b> # <b>rm -rf mysql</b> # <b>cd ../</b> # <b>rm info/mysql.info libexec/mysqld</b> # <b>cd man/man1</b> # <b>find . -name "my*" -exec rm {} \;</b> # <b>rm isamlog.1 isamchk.1 replace.1 perror.1</b> # <b>cd ../../share</b> # <b>rm -rf mysql</b> # <b>exit</b> % </pre> </div> <h2>2. Building the new server</h2> <p>To build the server, together with the client library, we have to follow these steps:</p> <ol> <li>Fetch MySQL sources from the internet.</li> <li>Expand the sources.</li> <li>Fetch the patch (and other utility files) from the internet.</li> <li>Expand the patch.</li> <li>Apply the patch.</li> <li>Configure the sources.</li> <li>Buidl.</li> </ol> <p>The easiest for step 1 and 3 is to use your favourite web browser: sources of MySQL can be found <a href="http://www.mysql.com/downloads/download.php?file=Downloads%2FMySQL-4.0%2Fmysql-4.0.14.tar.gz&pick=mirror">here</a>, while the patch is linked from the <a href="#files">File section<a>. Still I will describe some way to achieve them from the command line.</p> <div class="code"> <pre>% <b>curl http://sunsite.cnlab-switch.ch/ftp/mirror/mysql/Downloads/MySQL-4.0/mysql-4.0.14.tar.gz -O</b> % Total % Received % Xferd Average Speed Time Curr. Dload Upload Total Current Left Speed 100 12.1M 100 12.1M 0 0 53739 0 0:03:56 0:03:56 0:00:00 47289 % <b>gnutar -xzf mysql-4.0.14.tar.gz</b> % <b>curl http://http://cesnet.dl.sourceforge.net/sourceforge/mysql-cocoa/install_mysql-4.0.14.dmg -O</b> % Total % Received % Xferd Average Speed Time Curr. Dload Upload Total Current Left Speed 100 ....M 100 ....M 0 0 53739 0 0:00:.. 0:00:.. 0:00:00 47289 % <b>open install_mysql-4.0.14.dmg</b> % <b>cp /Volumes/install_mysql-4.0.14/mysql_patch.txt .</b> % <b>cd mysql-4.0.14/</b> % <b>patch -p0 < ../mysql_patch.txt</b> patching file configure patching file ltmain.sh patching file libmysqld/examples/Makefile.in patching file libmysql_r/Makefile.in patching file libmysqld/Makefile.in patching file vio/Makefile.in </pre> </div> <p>The sources are now nearly ready to be configured, still (because of one change made by the patch) as the library will be prebound, and because the addresses are not set for all of them, we want to make sure that address overlap of two libraries will not causes the linker to crash (see the ld man page for more details). Note that the prebinding of the library can be fixed later (whereas, if you don't set prebinding when you build them, then you can <em>not</em> prebind them later).</p> <div class="code"> <code> % <b>setenv LD_PREBIND_ALLOW_OVERLAP</b><br> % <b>./configure --prefix=/usr/local --localstatedir=/Users/mysql/DB_data --enable-shared --enable-static --with-mysqld-user=mysql --with-embedded-server --with-vio --with-openssl --with-charset=latin1 --with-extra-charsets=all --enable-thread-safe-client</b><br> </code> </div> <p>Lets have a small discution on what I have set here:<\p> <dl> <dt>--prefix=/usr/local</dt><dd>The library, inlcude files and binaries will be in subdirectories of <code>/usr/local</code>.</dd> <dt>--localstatedir=/Users/mysql/DB_data</dt><dd>The data will be stored in the directory named :<code>/Users/mysql/DB_data</code>.</dd> <dt>--enable-shared</dt><dd>Enable the make process to generate <em>dynamic libraries</em> (also called shared libraries).</dd> <dt>--enable-static</dt><dd>Enable the make process to generate <em>static libraries</em>.</dd> <dt>--with-mysqld-user=mysql</dt><dd>Unix user name under which the server will be run.</dd> <dt>--with-embedded-server</dt><dd>Build also the embedded server library (libmysqld.a).</dd> <dt>--with-vio</dt><dd>Build using virtual In/Out (don't know neither what it means, but it is mandatory for openssl).</dd> <dt>--with-openssl</dt><dd>Build Server and Library so that they support ssl tunnelling of their connection (add some level of security if you use you connect to your database over the internet)</dd> <dt>--with-charset=latin1</dt><dd>Defines the default character set that should be used by the server.</dd> <dt>--with-extra-charsets=all</dt><dd>Which other character set do you want the server (and library) to be able to support.</dd> <dt>--enable-thread-safe-client</dt><dd>Make the client library in a way that they are thread safe (so that you can use multiple queries in different threads).</dd> </dl> <p>Now that the sources are configured, and before we build the libraries and binaries we just have to take care of the prebinding (for libmysqlclient.dylib at least): We will make a file (I'm using /usr/local/include/prebinding_table.txt as the repository for all my prebinding addresses, but you can choose to put this file wherever you want to) containing prebinding address(es) for our library(ies), then set an environment variable so that libtool knows where to find prebinding addresses:</p> <div class="code"> <pre>% <b>su</b> Password: <i>type root(system) password</i> # <b>emacs </b><i>/usr/local/include/prebinding_table.txt</i> </pre> </div> <p>Add the following line to the file (with the proper full path to the place where the library will be <em>installed</em>, you can change the address – See Apple documentation about the range of available addresses for prebinding –):</p> <pre>0x10000000 <i>/usr/local/lib/mysql/</i>libmysqlclient.12.dylib</pre> <p>Then delete the previous version of the file (automatic backup by emacs), and quit the super user, and set the environment variable (you can then check that the file contains exactly what you think):</p> <div class="code"> <pre># <b>rm </b><i>/usr/local/include/prebinding_table.txt</i><b>~</b> # <b>exit</b> % <b>setenv LD_SEG_ADDR_TABLE </b><i>/usr/local/include/prebinding_table.txt</i> % <b>more $LD_SEG_ADDR_TABLE</b> 0x10000000 /usr/local/lib/mysql/libmysqlclient.12.dylib % </pre> </div> <p>Now you are finally ready to build things (you can still set some environment variable which are useful to see what's going on during linking... they are nice information if some link step crashes... which should <em>not</em> happen):</p> <div class="code"> <pre>*** optional, interesting for information (and build debugging) *** % <b>setenv RC_TRACE_ARCHIVES</b> % <b>setenv RC_TRACE_DYLIBS</b> % <b>setenv RC_TRACE_PREBINDING_DISABLED</b> *** end of optional *** % <b>make -j 2</b> </pre> </div> <h2>3. Installation</h2> <p>First we have to prepare the directory which will receive the databases:</p> <div class="code"> <pre>% <b>su - mysql</b> Password: <i>type mysql user password</i> % <b>mkdir </b><i>DB_data</i> % <b>exit</b> </pre> </div> <p>Now install the binaries, libraries, include files...</p> <div class="code"> <pre>% <b>sudo make install</b> Password: <i>type root(system) password</i> % </pre> </div> <p>Finally you want to install the empty databases:</p> <div class="code"> <pre>% <b>su mysql</b> Password: <i>type mysql user password</i> % <b>scripts/mysql_install_db</b> % <b>exit</b> % </pre></div> <h2>4. Running the server</h2> <p>If you want to (or need to) start the server manually the easiest is to type:</p> <div class="code"> <pre>% <b>su</b> Password: <i>type root(system) password</i> # <i>/usr/local/bin</i><b>/mysqld_safe --user=</b><i>mysql</i><b> &</b> # <b>exit</b> % </pre></div> <p>You can also have your server started automatically at booting of your Macintosh using the MySQL folder present in the disk image: Copy the folder in <code>/Library/StartupItems</code> (you might have to create the <code>StartupItems</code> folder). Then you have to add the following line to the file <code>/etc/hostconfig</code> (for which you need root permission):</p> <pre>MYSQL=-YES- </pre> <p><em>NOTE</em>: If you have decided to install using a prefix different from <code>/usr/local</code>, then you will have to edit the file <code>/Library/StartupItems/MySQL/MySQL</code> so that is contains the proper path to call <code>mysqld_safe</code> script.</p> <h2>5. Bonnus</h2> <p>In the disk image you will also find a configuration file (<code>Serge_my.cnf</code>) for your mysql server... there should be a couple of these examples already there (in <code>/Users/mysql/DB_data</code>). The one I give away is set in a reasonable way for a small server using InnoDB and having to transfer big files to and fro some client (be it SMySQL framework based oreven PHP). To use it just copy it in the <code>/Users/mysql/DB_data</code> directory and change its name to <code>my.cnf</code> (it is better to do this while the MySQL server down).</p> <h2><a name="files">File</a></h2> <ul> <li>All you need (on top of the MySQL sources :-) ) is this disk image: <a href="http://prdownloads.sourceforge.net/mysql-cocoa/install_mysql-4.0.14.dmg?download">install_mysql-4.0.14.dmg</a> </li> </ul> <!--content end--> <a name="team"><h2>Development Team</h2></a> <ul> <li>Serge Cohen (<a href="mailto:ser...@us...">ser...@us...</a>)</li> </ul> <a name="links"><h2>Links</h2></a> <p>Here are some important links. Click away.</p> <div class="content"> <table> <tr><td colspan=2 class="head"> <p class="tablesechead">Database</p> </td></tr> <tr><td> <p class="link"><a href="http://www.mysql.com/">MySQL</a></p> </td> <td> <p class="linkinfo">Home of MySQL database server.</p> </td></tr> <tr><td colspan=2 class="head"> <p class="tablesechead">Cocoa API and Objective-C</p> </td></tr> <tr><td> <p class="link"><a href="http://developer.apple.com/techpubs/macosx/Cocoa/ObjectiveC/index.html">Objective-C home</a></p> </td> <td> <p class="linkinfo">Objective-C home at Apple</p> </td></tr> <tr><td> <p class="link"><a href="http://developer.apple.com/techpubs/macosx/Cocoa/SiteInfo/NewToCocoa.html">Introducing Cocoa</a></p> </td> <td> <p class="linkinfo">Introduction to the Cocoa API (Apple)</p> </td></tr> <tr><td> <p class="link"><a href="http://developer.apple.com/cocoa/index.html">Cocoa API home</a></p> </td> <td> <p class="linkinfo">API documentation home at Apple</p> </td></tr> <tr><td colspan=2 class="head"> <p class="tablesechead">Project related</p> </td></tr> <tr><td> <p class="link"><a href="http://mysql-cocoa.sourceforge.net/index.html">Home Page</a></p> </td> <td> <p class="linkinfo">Latest updates and general infos on the project</p> </td></tr> <tr><td> <p class="link"><a href="http://www.sourceforge.net/projects/mysql-cocoa">Project page on SourceForge</a></p> </td> <td> <p class="linkinfo">Where to go to see the development.</p> </td></tr> <tr><td> <p class="link"><a href="http://cocoamysql.sourceforge.net/">CocoaMySQL</a></p> </td> <td> <p class="linkinfo">A very nice Generic GUI MySQL client (in Cocoa)... and it's free software!!</p> </td> </tr> </table> </div> <div class="center"><A href="http://sourceforge.net"> <IMG src="http://sourceforge.net/sflogo.php?group_id=42424&type=1" width="88" height="31" border="0" alt="SourceForge Logo"></A></div> </BODY> Index: archives.html =================================================================== RCS file: /cvsroot/mysql-cocoa/Documentation/website/archives.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** archives.html 25 Aug 2003 21:53:21 -0000 1.1 --- archives.html 27 Aug 2003 21:54:27 -0000 1.2 *************** *** 47,51 **** <ul> <li>Serge Cohen (<a href="mailto:ser...@us...">ser...@us...</a>)</li> - <li>Bertrand Mansion (<a href="mailto:ma...@us...">ma...@us...</a>)</li> </ul> <a name="links"><h2>Links</h2></a> --- 47,50 ---- Index: index.html =================================================================== RCS file: /cvsroot/mysql-cocoa/Documentation/website/index.html,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** index.html 25 Aug 2003 21:53:21 -0000 1.15 --- index.html 27 Aug 2003 21:54:27 -0000 1.16 *************** *** 29,33 **** <a name="archive"><p>Archives of the updates can be found <a href="archives.html">here</a></p></a> ! <p><em>25 August 2003:</em> Today I finally had the time to update the web site. The information you find here should now be up to date (especially the <a href="#files">Files</a>, <a href="#">Documentation</a> were completely outdated – I had no time to update them since I first wrote them in January 2002 –).</p> <p><em>20 August 2003:</em> Releases the version 2.2.1 of the framework: minor bug correction. The previous versions of the framework were not able to handle properly the integer with more than 32bits (MySQL BIGINT). This is now corrected (indeed the other branches of the framework are also corrected in CVS, so if you are still using the version 1, I encourage you to get the fix from CVS). Unfortunately I have not found a solution to know from the MySQL server if an retrieve integer is signed or not, hence the framework assumes always signed int: this can cause a trouble if you have a unsigned column (either for BIGINT or INT) and you are using number bigger than the maximum SIGNED number. Thanks to Lorenz Textor for pointing the bug to me.</p> --- 29,35 ---- <a name="archive"><p>Archives of the updates can be found <a href="archives.html">here</a></p></a> ! <p><em>27 August 2003:</em> Added a documentation on how to build MySQL from sources. You will find a link to these inscription in the <a href="#docs">Documentation</a> section. Following these instructions you should be able to build MySQL server and client sides, with prebound dynamic libraries (as well as static libraries), openssl support for both server and client... and finally getting the <code>libmysqld.a</code> library which is basically a embedded MySQL server running in its own thread, so your program can contains its own server (not yet supported by SMySQL framework... but might come some time soon).</p> ! ! <p><em>25 August 2003:</em> Today I finally had the time to update the web site. The information you find here should now be up to date (especially the <a href="#files">Files</a>, <a href="#docs">Documentation</a> were completely outdated – I had no time to update them since I first wrote them in January 2002 –).</p> <p><em>20 August 2003:</em> Releases the version 2.2.1 of the framework: minor bug correction. The previous versions of the framework were not able to handle properly the integer with more than 32bits (MySQL BIGINT). This is now corrected (indeed the other branches of the framework are also corrected in CVS, so if you are still using the version 1, I encourage you to get the fix from CVS). Unfortunately I have not found a solution to know from the MySQL server if an retrieve integer is signed or not, hence the framework assumes always signed int: this can cause a trouble if you have a unsigned column (either for BIGINT or INT) and you are using number bigger than the maximum SIGNED number. Thanks to Lorenz Textor for pointing the bug to me.</p> *************** *** 51,55 **** <a name="files"><h2>Files</h2></a> ! <p>These files provides only the client side of <a href="http://www.mysql.com/">MySQL</a> (and only for Cocoa). If you want to install the server (as well as if you want the sources of the client library), the best thing is to go to the <a href="http://www.mysql.com/">MySQL site</a>. On this respect one has to know that nowadays MySQL install out of the box (binaries as well as from sources – if you have the developer tools –) on Mac OS X.</p> <!-- <p>It is easy to find on the web the instruction how to get the MySQL server running automatically when you start your Mac, still for the lazy or the one in hurry, I've posted here a small packages which enables that.</p> ... Still have to prepare the package...--> --- 53,57 ---- <a name="files"><h2>Files</h2></a> ! <p>These files provides only the client side of <a href="http://www.mysql.com/">MySQL</a> (and only for Cocoa). If you want to install the server (as well as if you want the sources of the client library), the best thing is to go to the <a href="http://www.mysql.com/">MySQL site</a> if you are looking for binaries. If you prefer to build from the sources, I have written a instruction page (quite detailed) describing how I did it last (was MySQL version 4.0.14, my system is running under OS X 10.2.6, using gcc-3.3), you will find it <a href="install_mysql-4.0.14.html">here</a>.</p> <!-- <p>It is easy to find on the web the instruction how to get the MySQL server running automatically when you start your Mac, still for the lazy or the one in hurry, I've posted here a small packages which enables that.</p> ... Still have to prepare the package...--> *************** *** 83,86 **** --- 85,91 ---- <p>Some of the documentation available Online can be found <a href="http://sourceforge.net/docman/index.php?group_id=42424">here on Sourceforge</a> (indeed not yet); the rest is below.</p> + <h4>Building MySQL from sources</h4> + <p>The page linked <a href="install_mysql-4.0.14.html">here</a> will get you to a page describing how you can build MySQL from the sources (MySQL 4.0.14 build on Mac OS 10.2.6 using gcc-3.3 to be precise).</p> + <h4>Vanilla, Strawberry or Chocolate... Which flavour do you want:</h4> *************** *** 168,171 **** --- 173,184 ---- <p class="linkinfo">Where to go to see the development.</p> </td></tr> + + <tr><td> + <p class="link"><a href="install_mysql-4.0.14.html">MySQL Install Instruction</a></p> + </td> + <td> + <p class="linkinfo">How to build MySQL from sources on Mac OS Jaguar.</p> + </td></tr> + <tr><td> <p class="link"><a href="http://cocoamysql.sourceforge.net/">CocoaMySQL</a></p> Index: styles.css =================================================================== RCS file: /cvsroot/mysql-cocoa/Documentation/website/styles.css,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** styles.css 19 Aug 2003 10:04:41 -0000 1.2 --- styles.css 27 Aug 2003 21:54:27 -0000 1.3 *************** *** 19,22 **** --- 19,25 ---- H4 { font-size: 14pt; + margin-left: 10pt; + margin-bottom: 0pt; + margin-top: 25pt; } *************** *** 57,60 **** --- 60,69 ---- } + DIV.code { + background-color: #E8E8D0; + margin-left: 10pt; + margin-right:10pt; + } + DL { margin-left: 12pt; *************** *** 72,75 **** --- 81,85 ---- letter-spacing: 0; text-align: justify; + margin-top: 8pt; } TD P { *************** *** 215,217 **** --- 225,248 ---- } + CODE { + font-size: 9.5pt; + font-family: Courier; + letter-spacing: 0; + text-align: left; + } + + CODE.demo { + font-size: 12pt; + } + PRE { + font-size: 9.5pt; + font-family: Courier; + letter-spacing: 0; + text-align: left; + } + + DT { + font-family: Courier; + } + |