Ocelot Stuff
Wolf Stuff
About Us
  Log in

Misc. Info Database



installing mysql 4.1.7 on netbsd 1.6.2 (Author: Kevin Metcalf)

OK. Here's how I actually got MySQL 4.1.7 to install on NetBSD 1.6.2.
System Specs:
- NetBSD 1.6.2
- Macintosh G3 blue-and-white "Yosimite" box.
- 256 MB ram.
- 9 GB hard disk.
- Shell: Bash

First off, the mysql install guide recommends gnu make, so I downloaded and installed that.

Second, it also required mit-pthreads support, and the yosemite box I had NetBSD installed on was barfing. So I downloaded and unzipped that into the top level of the mysql folder (as per installation instructions).

Once I had those steps followed, I ran:

./configure --with-mit-threads
and it configured OK. Then I ran the gnu make utility. This, of course, means I have to download and install GNU make. It went into a new directory, so I ran:
At this point, I found out NetBSD doesn't install perl by default, so I had to go download that.

OK. In the process of installing perl, I learned about a really cool command called "pkg_add" that will automagically put things in the right place, provided the .tgz file has all the right files inside (and you have the binaries for your platform in it).

pkg_add perl-5.8.1.tgz
Well, that was almost too unbelievablly painless!

So now that it appears perl is installed, I ran

And now I get a new error...
/usr/include/sys/chdefs.h:212: #error "No function renaming possible"
syscall.S:32: unterminated character constant
So... yeah. I ran:
../make-3.80/make clean
just incase that was a problem from my previous make attempt, but my next launch of make returned a different error.
/usr/bin/bash: line 1: /usr/pkg/bin/perl: cannot execute binary file
make[2]: *** [../support-files/MacOSX/ReadMe.txt] Error 126
make[2]: Leaving directory '/root/src/mysql-4.1.7/Docs'
make[1] *** [all-recursive] Error 1
make[1]: Leaving directory '/root/src/mysql-4.1.7/Docs'
make: *** [all] Error 2
Well that's just touching... The perl binary is not compiled for this platform... I guess it WAS too good to be true. Well isn't that cute... BUT IT'S WRONG!!! Now we download the newest (as of 12/8/2004) version of perl and do the compiling all by our lonesome. (I'll include compile times because I'm bored, too.) (Commands below are per the instructions in ./INSTALL).
tar -zxf perl-5.8.5.tar.gz     #2 min
cd perl-5.8.5                  #0 sec
rm -f      #0 sec
sh Configure -ed               #5 min
make                           #16 min
make test                      #15 min
make install                   #5 min
OK. Now we exit from our current shell and log back in to set the /usr/bin/perl file as the default perl file, then we test it:
perl --version
succsess! So let's run another make clean in the mysql src directory, and then we'll try make again.
../make-3.80/make clean

In file included from syscall.S:5:
/usr/include/sys/cdefs.h:212: #error "No function renaming possible"
syscall.S:32: unterminated character constant.
Well that sounds familiar. Maybe the perl thing was a red herring. Let's take a closer look at that line in that file. OK. I commented out the "#else error..." line just for yucks. Let's try again.
../make-3.80/make clean
Nope. Now I get the same "unterminated..." error. I'll just remove the space infront of the # in the " #else error" line.

At this point I was out of my area of expertise. I've only JUST started playing with netbsd, and I'm not a proud man. So I signed up for the mailing list, and submitted a brief summary of what happened. While waiting for a response, I notice the line:

#define __RENAME(x)     no renaming in kernel or standalone environment
and thought, hmm... that looks like a comment that isn't commented out. What would happen if I changed it to:
#define __RENAME(x)    /* no renaming in kernel or standalone environment */
That didn't help. Literally FIVE minutes after I posted to the list, I got this response from Chris Tribo:
You're making it far too complicated. ftp to and download pkgsrc.tar.gz
from pub/NetBSD/packages to your /usr. Tar -xzf pkgsrc.tar.gz. then cd
 /usr/pkgsrc/databases/mysql4-server/ and type make. when it's done do make install.
So I follow those directions. HMM... No dice. Maybe that perl weirdness wasn't just a fluke. I used pkgsrc to do a perl install and all the errors went away. I was able to get mysql installed. Now we:
# cp cp /usr/pkg/etc/rc.d/mysql /etc/rc.d
add mysqld="YES" to the end of /etc/rc.conf
# /etc/rc.d/mysqld start
Starting mysqld.
OK. So now what? It's not running... No error message or anything. Hmm... Maybe I have to restart.
shutdown -r now
Well *that* was certainly anti-climactic. Nothing. Hmm... Let's check the error log.
[ERROR] Fatal Error: Can't open privilege tables: Table '' doesn't exist
That's doesn't sound good. Looks like the DB wasn't initialized correctly. Let's see what parameters we can pass to the mysqld rc script. "initdb" looks promising.
# /etc/rc.d/mysqld initdb
Initializing MySQL database sysetm tables.
Installing all prepared tables
Fill help tables
Well that sounds good! Let's try to start it again.
# /etc/rc.d/mysql start
Starting mysqld.
Hmm... I've seen THAT before. But WAIT!!!
ps -ax
shows us that mysql is ACTUALLY running!
mysql -u root
lets us login. Now we exit out of mysql and change the root password for mysql:
mysqladmin -u root password "newpwd"
In theory, we should add the "flush-privileges" parameter to that, but I don't care. My next step is to reboot the computer, then edit my .bash_history file and take the root password for mysql out of the text history file. >.< OK. Now just login as the mysql root user and delete the test database (why do they include that by default?) and TADA!!! We're all set.


home | ocelot | wolf | recipes | guitar chords | humor | walkthroughs | about | privacy | contact | Site Map | MetSecTech
54727 hits for this section SingleSignOn Copyright 2004-2009 Kevin and Erin Metcalf. All rights reserved.