Can't Get MySQL Port Up

Jeremy Chadwick koitsu at FreeBSD.org
Thu Mar 1 15:29:28 UTC 2007


On Thu, Mar 01, 2007 at 05:56:27AM -0800, Drew Jenkins wrote:
> Hi;
> I am about ready to give up on this port and try the source code...but I'd really like to work with the port! I built out mysql51-server on both my experimental and new production server. I thought I had them both working, but maybe my mind's playing tricks on me. I accidentally deleted /usr/local/include on my new production server (that I'm still building). I rebuilt it successfully by rebuilding all the ports and filling in the blanks with a tarball of the same dir on my experimental server, which I had built with the same commands. I have been getting all sorts of errors trying to run either "mysql" or "/usr/local/bin/mysqld_safe &", the latter giving more feedback and the former complaining about a socket binding problem (" Can't connect to local MySQL server through socket '/tmp/mysql.sock'"). However, when I went to try the same commands on my experimental server, much to my surprise I got the exact same errors! The only thing I did to that server was run a tar -cvf
>  command on /usr/local/include and all that would have done is walk the directory and read it, so what's causing this problem? Is this port buggy? Below is a snip from the error log:

I'll be frank -- I've read this massive run-on three times now, and I
cannot make heads or tails of what you're trying to say.  All I can
make out is that when you bring up mysqld, it doesn't stay up, thus
mysql and other applications that try to talk to the MySQL server
cannot, since it's not running.

The fact that you broke /usr/local/include is probably not a good
thing either.  Have you considered doing something like pkg_info,
making a list of all the packages you have installed, doing
pkg_delete -a -f && rm -fr /var/db/ports/*, then reinstalling all of
the ports in question?

Are you _building_ MySQL or are you using the package (pre-compiled
binary package)?  What version of MySQL are you choosing to use?

> 070301 06:58:39  mysqld started
> InnoDB: Error: auto-extending data file ./ibdata1 is of a different size
> InnoDB: 0 pages (rounded down to MB) than specified in the .cnf file:
> InnoDB: initial 640 pages, max 0 (relevant if non-zero) pages!
> InnoDB: Could not open or create data files.
> InnoDB: If you tried to add new data files, and it failed here,
> InnoDB: you should now edit innodb_data_file_path in my.cnf back
> InnoDB: to what it was, and remove the new ibdata files InnoDB created
> InnoDB: in this failed attempt. InnoDB only wrote those files full of
> InnoDB: zeros, but did not yet use them in any way. But be careful: do not
> InnoDB: remove old data files which contain your precious data!

What exactly is in your my.cnf?  This looks suspicious.

> ^G/usr/local/libexec/mysqld: Can't find file: './mysql/general_log.frm' (errno: 13)

There is no such table "general_log" in database "mysql" in MySQL
4.0 nor 4.1.  errno 13 is Permission denied, by the way.  So how is
this table getting loaded?

Maybe this table exists in the beta (5.0), but I choose not to use
that for obvious reasons.

> 070301  6:58:39 [ERROR] /usr/local/libexec/mysqld: Can't create/write to file '/var/db/mysql/server312.web.vi.pid' (Errcode:
> 13)

This also looks indicative of a permissions problem with your
/var/db/mysql directory.  The directory should be identical in
ownership and permissions to this:

drwx------    7 mysql     mysql     512 26 Feb 09:46 /var/db/mysql/

Ensure that all underlying directories and files are also as such
(ownership/group; permissions don't matter so much, other than
executable on directories, obviously).

> 070301  6:58:39 [ERROR] Can't start server: can't create PID file: Permission denied

Another example of a permissions problem, and this is why mysqld
won't start, thus why your applications say they can't talk to
mysql via /tmp/mysql.sock and what not.

-- 
| Jeremy Chadwick                                 jdc at parodius.com |
| Parodius Networking                        http://www.parodius.com/ |
| UNIX Systems Administrator                   Mountain View, CA, USA |
| Making life hard for others since 1977.               PGP: 4BD6C0CB |



More information about the freebsd-ports mailing list