First-time install of MySQL 4.1 on OS X Tiger Server
Just the notes for the installation steps on a
clean OS X Tiger Server 10.4.7 setup.
First download the appropriate Mac OS X binaries
from mysql.com. I recommend the mysql STD (Standard) binaries. Choose the
installer appropriate to your target Mac
CPU.
Run the MySQL
installer
Install the
mysql-blah-blah-blah.pkg from the MySQL downloaded
.dmg
If this is a first time installation,
install the MySQL Startup Item .pkg from the MySQL disk
image.
Restart the Mac ..... this will
cause the MySQL Startup Item to automatically start
MySQL
MySQL Security
Tasks
The default installation has a root
user with no password, so we have to set a password for root to protect our
server.
Type this in the
terminal:
cd
/usr/local/mysql/bin
If this is first time
install, type
./mysql -u root (Log in as
root (initial install has no password) and set a password for root
)
At the mysql
prompt, type the following replacing password with your
password:
grant all on *.* to root@localhost
identified by 'password' with grant
option;
now
type:
exit
and
test the login again with the password
./mysql
-u root -p
enter the password you set for
the mysql root user when prompted.
Next we
need to delete the 'anonymous' user that usually exists by default in
MySQL
After loggin in as root, do the
following
> use
mysql;
> delete from user where user =
'';
> flush
privileges;
OS X Server Binary
Path Configuration
The next thing we need to
do is configure our command path so that we refer to the mysql binaries that we
installed and not the preinstalled Apple
binaries.
Using pico or similar, open and edit
/etc/profile to that the path variable has /usr/local/mysql/bin as the first
element of the path like so:
# System-wide
.profile for
sh(1)
PATH="/usr/local/mysql/bin:/bin:/sbin:/usr/bin:/usr/sbin"
export
PATH
if [ "${BASH-no}" != "no" ];
then
[ -r /etc/bashrc ] && .
/etc/bashrc
fi
For
added robustness, you may delete all Apple binaries beginning with my like
this:
$ cd
/usr/bin
$ sudo rm
mysql*
$ sudo rm
myisam*
Configuring MySQL
using my.cnf
The case of a new installation
is the best time to configure your my.cnf file. There are a few example my.cnf
files provided
at:
/usr/local/mysql/support-files
Also,
the parameters are documented
at:
Choose one that fits your server
configuration and make further changes. Here are some of the parameters that I
think are important to configure for a new
installation:
# We want ALL databases and tables
to be innodb ACID transactional tables by
default
# for our WebObjects projects so that we
get automatic rollback when saving an editing context
fails
default-table-type=innodb
#
The default character set for the server
# We
want everything from the database thru the WO app, WOComponents and thru to web
pages to be UTF8
# so that we have a foundation
for international language
localization
character-set-server=UTF8
Posted: Sunday - September 17, 2006 at 06:52 PM