Sponsored Content
Full Discussion: Starting MySQL daemon
Top Forums UNIX for Dummies Questions & Answers Starting MySQL daemon Post 302099795 by unispace on Wednesday 13th of December 2006 07:15:33 PM
Old 12-13-2006
I didn't install it that is the problem. Someone else can in and set it up and then left the mess for me.

I went to the directory /usr/local/etc/rc.d/ and there is a file mysql-server. I opened it with nano and here are its contents:

Code:
#!/bin/sh
#
# $FreeBSD: ports/databases/mysql323-server/files/mysql-server.sh.in,v 1.3 2006/03/07 16:24:59 ale Exp $
#

# PROVIDE: mysql
# REQUIRE: LOGIN
# KEYWORD: shutdown

#
# 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).
#

. /etc/rc.subr

name="mysql"
rcvar=`set_rcvar`

load_rc_config $name

: ${mysql_enable="NO"}
: ${mysql_limits="NO"}
: ${mysql_dbdir="/var/db/mysql"}
: ${mysql_args=""}

mysql_user="mysql"
mysql_limits_args="-e -U ${mysql_user}"
pidfile="${mysql_dbdir}/`/bin/hostname`.pid"
command="/usr/local/bin/safe_mysqld"
command_args="--defaults-extra-file=${mysql_dbdir}/my.cnf --user=${mysql_user} --datadir=${mysql_dbdir} --pid-file=${pidfile}$
procname="/usr/local/libexec/mysqld"
start_precmd="${name}_prestart"
mysql_install_db="/usr/local/bin/mysql_install_db"
mysql_install_db_args="--ldata=${mysql_dbdir}"

mysql_create_auth_tables()
{
        eval $mysql_install_db $mysql_install_db_args >/dev/null 2>&1
        [ $? -eq 0 ] && chown -R ${mysql_user}:${mysql_user} ${mysql_dbdir}
}

mysql_prestart()
{
        if [ ! -d "${mysql_dbdir}/mysql/." ]; then
                mysql_create_auth_tables || return 1
        fi
        if checkyesno mysql_limits; then
                eval `/usr/bin/limits ${mysql_limits_args}` 2>/dev/null
        else
                return 0
        fi
}

run_rc_command "$1"

Thanks for the help. I guess this is the shell script ran on starting the mysqld?
 

6 More Discussions You Might Find Interesting

1. Linux

mysql not starting with fedora linux

Hi... I have installed mysql in Fedora and when i tried to start mysql the error i get was "Asked for 196608 thread stack" What might be the problem???? I have tried all ways but doesnt work out........ (1 Reply)
Discussion started by: arunkumar_mca
1 Replies

2. Solaris

Problems starting apache 1.3 with mysql

I've been working on a project to replace one of the my group's primary NIS servers. It also runs mysql and apache, as it is the host for the our team's hardware tracking database and website. Its running apache 1.3, and for some odd reason, I can't get apache to start on system boot. The... (1 Reply)
Discussion started by: godspunk32
1 Replies

3. SCO

Stoping & starting the cron daemon

Hi We are running SCO ver 5. Recently the cron daemon stopped running on its own. How do I find out why? How do I restart/stop it? I typed cron but it didn't work. Will rebooting it do the trick or can I manually start and stop the cron daemon? Please help. Thanks & Regards. (0 Replies)
Discussion started by: othman
0 Replies

4. Shell Programming and Scripting

How to starting process as daemon using ssh command?

Hello, I need to run a command on remote Linux using the ssh command from my local machine. I am able to execute the command on remote machine using ssh but it's behaving strangely. The command is supposed to start a daemon process on remote linux box and the control should return back to me... (5 Replies)
Discussion started by: nitinshukla
5 Replies

5. UNIX and Linux Applications

MySQL Daemon failed to start - no mysql.sock file

After doing a yum install mysql mysql-server on Fedora 14 I wasn't able to fully install the packages correctly. It installed MySQL 5.1. I was getting the following error when running the: mysql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)... (3 Replies)
Discussion started by: jastanle84
3 Replies

6. UNIX for Dummies Questions & Answers

How to grep a line not starting with # from a file (there are two lines starting with # and normal)?

e.g. File name: File.txt cat File.txt Result: #INBOUND_QUEUE=FAQ1 INBOUND_QUEUE=FAQ2 I want to get the value for one which is not commented out. Thanks, (3 Replies)
Discussion started by: Tanu
3 Replies
replace(1)							  MySQL database							replace(1)

NAME
replace - A utility program that is used by msql2mysql, but that has more general applicability as well. replace changes strings in place in files or on the standard input. Uses a finite state machine to match longer strings first. Can be used to swap strings. USAGE
replace [-?svIV] from to from to ... -- [files] or replace [-?svIV] from to from to ... < fromfile > tofile SYNOPSIS
replace [-?|-I] [-s] [-v] DESCRIPTION
replace -?|-I info -s silent -v verbose EXTRA INFO
Special characters in from string: ^ Match start of line. $ Match end of line.  Match space-character, start of line or end of line. For a end  the next replace starts locking at the end space-character. A  alone in a string matches only a space-character. EXAMPLE
this command swaps a and b in the given files: shell> replace a b b a -- file1 file2 ... SEE ALSO
isamchk(1), isamlog(1), mysql(1), mysqlaccess(1), mysqladmin(1), mysqld(1), mysqld_multi(1), mysqld_safe(1), mysqldump(1), mysql_fix_privi- lege_tables(1), mysqlshow(1), mysql_zap(1), perror(1), For more information please refer to the MySQL reference manual, which may already be installed locally and which is also available online at http://www.mysql.com/doc/en/ BUGS
Please refer to http://bugs.mysql.com/ to report bugs. AUTHOR
Ver 1.0, distribution 4.0.24 Michael (Monty) Widenius (monty@mysql.com), MySQL AB (http://www.mysql.com/). This software comes with no warranty. Manual page by L. (Kill-9) Pedersen (kill-9@kill-9.dk), Mercurmedia Data Model Architect / system developer (http://www.mercur- media.com) ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +--------------------+------------------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +--------------------+------------------------------------+ |Availability | SUNWmysqlr, SUNWmysqlu, SUNWmysqlt | +--------------------+------------------------------------+ |Interface Stability | External | +--------------------+------------------------------------+ NOTES
Source for mysql is available on http://opensolaris.org. MySQL 4.0 19 December 2000 replace(1)
All times are GMT -4. The time now is 04:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy