From owner-freebsd-questions@FreeBSD.ORG Wed Mar 24 00:13:10 2010 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 51650106564A for ; Wed, 24 Mar 2010 00:13:10 +0000 (UTC) (envelope-from freebsd-questions@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id D1E738FC12 for ; Wed, 24 Mar 2010 00:13:09 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1NuEDZ-0003uf-Sf for freebsd-questions@freebsd.org; Wed, 24 Mar 2010 01:13:05 +0100 Received: from pool-71-166-134-186.washdc.east.verizon.net ([71.166.134.186]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 24 Mar 2010 01:13:05 +0100 Received: from nightrecon by pool-71-166-134-186.washdc.east.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 24 Mar 2010 01:13:05 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-questions@freebsd.org From: Michael Powell Followup-To: gmane.os.freebsd.questions Date: Tue, 23 Mar 2010 20:12:26 -0400 Lines: 61 Message-ID: References: <4BA8DAFA.3030107@arc.itb.ac.id> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: pool-71-166-134-186.washdc.east.verizon.net Subject: Re: mysql can't running 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: Wed, 24 Mar 2010 00:13:10 -0000 m.anis wrote: > Please help, mysql can't running > i had installed it and using phpmyadmin > when i check /etc/rc.d/mysql-server status > it says mysql is not running phpMyAdmin will not work until you have configured config.inc.php correctly. > when i tried /usr/local/bin/mysqld_safe & > startting mysqld daemon with database from /var/db/mysql > STOPPING server from pid file /var/db/mysql/.pid > 100323 22:09:46 mysqld ended This is not the correct method to start mysql. You will need to place mysql_enable="YES" into /etc/rc.conf for the startup scripts to work properly. It will also require typing the entire path to the startup script on the command line as well, such as: /usr/local/etc/rc.d/mysql-server start. Or stop, or restart, as you may need. This should occur automatically when booting the machine and this command line is only necessary should you desire to start, stop, or restart without a reboot. Since it said it was 'STOPPING' the server above, how do you know it wasn't running? Instead of phpMyAdmin why not simply do a ps -ax? If mysql is running you will see a couple of line such as: 725 v0- I 0:00.01 /bin/sh /usr/local/bin/mysqld_safe --defaults- extra-file=/var/db/mysql/my.cnf --user=my 858 v0- I 0:20.83 /usr/local/libexec/mysqld --defaults-extra- file=/var/db/mysql/my.cnf --basedir=/usr/loc Lines are cut and word-wrapped, but you get the idea. More information may be gleaned from /var/db/mysql/.err, this is the mysql error log. Determine properly first whether mysql is actually running, or not. The installation procedure (if done properly, and NOT just simply unzipping a tarball somewhere and doing ./configure && make && make install, e.g either using the ports building or package installing process) will also create a mysql user and group entry. The mysql subdirectory and all files under it should be owned by this user:group, e.g.: mysql:mysql. If you did NOT use the ports or package install process, just stop, back up the train and remove whatever you did. Start over and use the ports or package install procedure. The config file is named my.cnf and lives in /usr/local/etc. MySQL will ignore this file if it is world writable. It should fall back to using one located elsewhere if it can locate one. Not sure as I don't believe I've ever attempted starting MySQL with no my.cnf at all, but I believe it may start whether this file is present, or not. Could be wrong about that. If you should find that it is actually running but you are having difficulty communicating with it you may need to do an initial configuration to it to allow logins. Initially when first installed there is no root password and the first step involves setting a password and setting up some basic grant permissions. -Mike