Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 04 Jul 2007 18:29:23 -0400
From:      Gerard <gerard@seibercom.net>
To:        User Questions <freebsd-questions@freebsd.org>
Subject:   Re: How does one start mysql after installing from ports
Message-ID:  <20070704182152.415A.GERARD-SEIBERT@seibercom.net>
In-Reply-To: <340a29540707041500g25289b6la1aec3340b5cd628@mail.gmail.com>
References:  <340a29540707041500g25289b6la1aec3340b5cd628@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On July 04, 2007 at 06:00PM Andrew Falanga wrote:


> This is pretty pathetic but I'm batting a 1000 on this one.  I
> installed mysql a few weeks ago on this web server I'm making for my
> church and didn't do anything with it at that point (that was the
> first mistake).  I've not used mysql (I usually use PostgreSQL) but
> WebGUI wants mysql.  So, being completely unfamiliar with it, I cannot
> figure out how to start this thing.
> 
> I eventually figured out that the mysqld process starts by using
> mysqld_safe in /usr/local/bin.  However, I can't get it to start.  At
> first it was because the directory /var/db/mysql didn't exist.  I
> created that and now I get this:
> 
> whitbap# mysqld_safe
> Starting mysqld daemon with databases from /var/db/mysql
> STOPPING server from pid file /var/db/mysql/whitbap.pid
> 070704 16:09:42  mysqld ended
> 
> (And the contents of /var/db/mysql/whitbap.err:
> whitbap# cat /var/db/mysql/whitbap.err
> 070704 16:02:41  mysqld started
> 070704 16:02:42  InnoDB: Operating system error number 13 in a file operation.
> InnoDB: The error means mysqld does not have the access rights to
> InnoDB: the directory.
> InnoDB: File name ./ibdata1
> InnoDB: File operation call: 'create'.
> InnoDB: Cannot continue operation.
> 070704 16:02:42  mysqld ended
> 
> 070704 16:09:42  mysqld started
> 070704 16:09:42  InnoDB: Operating system error number 13 in a file operation.
> InnoDB: The error means mysqld does not have the access rights to
> InnoDB: the directory.
> InnoDB: File name ./ibdata1
> InnoDB: File operation call: 'create'.
> InnoDB: Cannot continue operation.
> 070704 16:09:42  mysqld ended
> 
> 
> I'm assuming that a process, perhaps similar to PostgreSQL, is
> applicable for MySQL too.  For example, in PostgreSQL, one must first
> usr 'initdb' to initialize the data area.  Is this true for MySQL too?
> 
> Please tell me how to work MySQL (to anyone on this list that uses it).
> 
> Thanks,
> Andy

Unless I am misreading this, the correct method is by inserting the
following into the '/etc/rc.conf' file:

    mysql_enable="YES"

You can then either reboot the system to start the program, perhaps a
good idea to make sure it does get initialized correctly, or else as
root type:

    /usr/local/etc/rc.d/mysql-server start

That should complete the process. If you receive error messages when
mysql starts up, shut it down using the 'stop' flag in place of 'start'
and then move the '/var/db/mysql' directory out of the way and restart
mysql.

-- 
Gerard



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070704182152.415A.GERARD-SEIBERT>