mysql-server-5.1.22 system administration
dpchrist at holgerdanske.com
Sat Aug 30 04:18:41 UTC 2008
Reordered for clarity -- David.
I used pkg_add (rather than sysinstall) to install MySQL 5.1 server on another
machine. While the port is called 'mysql-server-5.1.22', the package is called
# cd /usr/ports/
# make search mysql
Info: Multithreaded SQL database (server)
Maint: ale at FreeBSD.org
B-deps: gettext-0.16.1_3 gmake-3.81_2 libiconv-1.11_1 libtool-1.5.24
# pkg_add -rK mysql51-server
Added group "mysql".
Added user "mysql".
Note the messages regarding the added group and user.
> To autostart mysql at boot add this to /etc/rc.conf
> Add this to /etc/rc.conf to direct to use this location where there
> is disk space to hold your databases
mysql_enable and mysql_dbvar are briefly documented in
# Add the following line to /etc/rc.conf to enable mysql:
# mysql_enable (bool): Set to "NO" by default.
# Set it to "YES" to enable MySQL.
# mysql_limits (bool): Set to "NO" by default.
# Set it to yes to run `limits -e -U mysql`
# just before mysql starts.
# mysql_dbdir (str): Default to "/var/db/mysql"
# Base database directory.
# mysql_args (str): Custom additional arguments to be passed
# to mysqld_safe (default empty).
> You have to tell mysql to create its internal control db
> by running this command one time first before trying to create databases.
> mysql_install_db --user=mysql
The usage message for /usr/local/bin/mysql_install_db states:
--user=user_name The login username to use for running mysqld. Files
and directories created by mysqld will be owned by this
user. You must be root to use this option. By default
mysqld runs using your current login name and files and
directories that it creates will be owned by you.
Your pointer likely saved me from running mysql_install_db as root and then
wondering why the server blows up when started (trying to read/write files owned
> The online mysql manual is at
The MySQL 5.1 Reference Manual (English) is here:
> To start or stop mysql server do this
> /usr/local/share/mysql/mysql.server start
> /usr/local/share/mysql/mysql.server stop
> To verify mysql is operational issue these commands
> mysqladmin version
> mysqladmin variables
> To start command line session with mysql server to
> create a DB enter
> mysql -u root
> The mysql databases and log files are written here
More information about the freebsd-questions