	     Installation instructions for MySQL source release

QUICK INSTALL:

Unpack tar archive in mysql directory. (VERSION is a number like 3.20.0)
You may want to edit scripts/mysql_install_db to get right grant tables

  zcat mysql-VERSION.tar.gz | tar cvf -
  cd mysql-VERSION
  ./configure

To compile only the client add --without-server to ./configure. If you
don't want to have your data under /usr/local/var use something like.
./configure --prefix=/usr/local --localstatedir=/usr/local/data/mysql

For more configure information se INSTALL-SOURCE-GENERIC. For
configure options use ./configure --help.

Compile and install everything (GNU make is recomended):

  make
  make install

Create the grants database:

The default priviliges is that anybody may create/use the databases
named 'test' or starting with "test_". Root can do anyting. More
information in the FAQ.

To change the defaults edit the script before running it.

  scripts/mysql_install_db

Start the mysql demon with:

  scripts/safe_mysqld --log

------------------------------------------------------------
Problems?

If your compile fails with something like:

configure: error: installation or configuration problem: C++ compiler cannot create executables.

- Try setting the environment variable CXX to gcc (If you are using gcc).
  For example 'CXX=gcc ./configure'. If you use this you don't nead to have
  libg++ installed!

- You can also install libg++. By default configure picks c++ as a compiler
  name and GNU c++ links with -lg++.

making all in mit-pthreads
make: Fatal error in reader: Makefile, line 18: Badly formed macro assignment

- This means you have to upgrade your make to GNU make.

If you get error messages from make or error message of type:
'pthread.h: No such file or directory'

- This means you have to upgrade your make to GNU make. (At least 3.75 works)

------------------------------------------------------------

NOTES:

All MySQL programs compile clean (no warnings) for us. But warning may
appear because of different system include files. Se below for
warnings that may occur when using mit-pthreads.

When compiling sql_yacc.y you should probably get: conflicts: 97
shift/reduce

------------------------------------------------------------

LINUX notes:

LinuxThreads should be installed before configuring MySQL.
If you get an any error related to mysql_source/mit_threads/...
                                                ^^^^^^^^^^^ 
then configure didn't detect that you have LinuxThreads installed.

You should install libc 5.4.12 or newer before compiling MySQL.
glibc 2.0.2 should also work.

Some Linux distributions have an error in /usr/include/sched.h:
Change _P to __P in the above file if you get a compile error in sched.h

You will get some warnings when compiling: (these can be ignored)

mysqld.cc -o objs-thread/mysqld.o
mysqld.cc: In function `void init_signals()':
mysqld.cc:315: warning: assignment of negative value `-1' to `long unsigned int'
mysqld.cc: In function `void * signal_hand(void *)':
mysqld.cc:346: warning: assignment of negative value `-1' to `long unsigned int'

When using glibc 2 you must also execute the configure with
'CXX=gcc ./configure ....' because
if you compile with g++, you will link with libg++ which dosen't work with
LinuxThreads.

------------------------------------------------------------

Perl notes:

When doing 'perl Makefile.PL' perl may say something like:

  Warning: -L../../client/ changed to -L/home/mysql-3.20.15-beta/perl/mysql

This can be ignored.

------------------------------------------------------------

SunOS notes:

You must have gnu make to compile MIT threads.

In readline you may get warnings about duplicated defines. These may be
ignored.

When compiling mysqld there will be some warnings about 'implicit declaration
of function'. These may be ignored.

------------------------------------------------------------

Sparc Linux notes:

In some implementations readdir_r is broken.
This will be notised by that SHOW DATABASES always return an empty set.
This can be fixed by removing 'HAVE_READDIR_R' from config.h

------------------------------------------------------------

DEC-OSF1-Alpha notes:

In some versions the alloca() is broken.
Fix this by remove 'HAVE_ALLOCA' from config.h.

------------------------------------------------------------

SGI-IRIX notes:

In some Irix implementations alloca is broken. If the mysqld server
dies on some selects remove HAVE_ALLOC from config.h.
If mysqladmin create doesn't work, remove 'HAVE_READDIR_R' from config.h

------------------------------------------------------------

FreeBSD notes:

If you get link errors when compiling mysqlperl
(Type ient.a(my_getwd.o): RRS text relocation at 0x9a9f for "__db_pargs_")

You must recompile the mysqlperl library with -DPIC -fpic.

Do the following:

- First install everything
- Change in client/Makefile the line:
    CFLAGS = -g -O2
  to 
    CFLAGS = -O2 -DPIC -fpic 
- cd client
- rm *.o
- run make libmysqlclient.a
- cd ../perl/mysqlperl
- make

This shall be fixed in some future version of configure.

The FreeBSD make behaviour is slightly other than GNU make:s. If you have a
problem that mysqlperl/Makefile.PL doesn't get generated you should 
install gnu makes.

Other (temporary) solution:
> cd perl
> make mysqlperl/Makefile.PL
> make mysqlperl/mysql_test

------------------------------------------------------------


MIT thread notes:

Mit threads doesn't support the AF_UNIX protocol so we must use
the TCP/IP protocol for all connections (which is a little slower).
If you can't connect to a table, try using the host (-h or --host) switch.
This must be done if you have compiled the client code --without-server
because the default connection is to use Unix sockets.

MySQL compiled with MIT threads has as default system locking disabled
for performance reasons. One can start the server with system locking
with the --use-locking. Se the FAQ about system locking.

Sometimes (on Solaris) the pthread bind() command sometimes fails to bind to
a socket without any error message. The result of this is that all
connections to server fails:
> mysqladmin ver
mysqladmin: connect to server at '' failed; error: 'Can't connect to mysql server on localhost (146)'

The solution to this is to kill the mysqld demon and restart it.
This has only happened to me when I have forced the demon down and done an
restart at once.

sleep() isn't interruptible with SIGINT (break) in MIT-threads. This is only
notable in 'mysqladmin --sleep'. One have to wait for the end of the sleep
before the interrupt is served and the process stops.

I haven't got readline to work with MIT threads. (This isn't needed, but may
be interesting for someone)

When linking (at least on Solaris) you will receive this error message:

ld: warning: symbol `_iob' has differing sizes:
	(file /my/local/pthreads/lib/libpthread.a(findfp.o) value=0x4; file /usr/lib/libc.so value=0x140);
	/my/local/pthreads/lib/libpthread.a(findfp.o) definition taken
ld: warning: symbol `__iob' has differing sizes:
	(file /my/local/pthreads/lib/libpthread.a(findfp.o) value=0x4; file /usr/lib/libc.so value=0x140);
	/my/local/pthreads/lib/libpthread.a(findfp.o) definition taken


Some other warnings which can be ignored:

implicit declaration of function `int strtoll(...)'
implicit declaration of function `int strtoul(...)'
