From owner-freebsd-questions@FreeBSD.ORG Sat Aug 30 04:18:40 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C54071065673 for ; Sat, 30 Aug 2008 04:18:40 +0000 (UTC) (envelope-from dpchrist@holgerdanske.com) Received: from holgerdanske.com (holgerdanske.com [65.19.145.106]) by mx1.freebsd.org (Postfix) with SMTP id B311A8FC12 for ; Sat, 30 Aug 2008 04:18:40 +0000 (UTC) (envelope-from dpchrist@holgerdanske.com) Received: from a64x23800p ([64.142.42.100]) by holgerdanske.com for ; Fri, 29 Aug 2008 21:18:39 -0700 From: "David Christensen" To: References: <1587E1CA38444A64AC903BEA6D1B9CA9@a64x23800p> Date: Fri, 29 Aug 2008 21:18:38 -0700 Message-ID: <6B1DE976CCBD4465929AE35A830CB791@a64x23800p> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Thread-Index: AckI0uJSPY8XWG49RCqukQ5Ij5LZVABgJ46g Subject: RE: mysql-server-5.1.22 system administration docsonFreeBSD7.0-RELEASE-i386 ? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Aug 2008 04:18:41 -0000 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 'mysql51-server': # cd /usr/ports/ # make search mysql ... Port: mysql-server-5.1.22 Path: /usr/ports/databases/mysql51-server Info: Multithreaded SQL database (server) Maint: ale@FreeBSD.org B-deps: gettext-0.16.1_3 gmake-3.81_2 libiconv-1.11_1 libtool-1.5.24 mysql-client-5.1.22 R-deps: mysql-client-5.1.22 WWW: http://www.mysql.com/ ... # pkg_add -rK mysql51-server .... Added group "mysql". Added user "mysql". ... Note the messages regarding the added group and user. joeb wrote: > To autostart mysql at boot add this to /etc/rc.conf > mysql_enable="YES" > Add this to /etc/rc.conf to direct to use this location where there > is disk space to hold your databases > mysql_dbdir="/usr/local/mysql" mysql_enable and mysql_dbvar are briefly documented in /usr/local/etc/rc.d/mysql-server: # 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 by root). > The online mysql manual is at > http://dev.mysql.com/doc/refman/5.0/en/index.html The MySQL 5.1 Reference Manual (English) is here: http://dev.mysql.com/doc/refman/5.1/en/index.html > 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 > /var/db/mysql Okay. Thanks! David