Hi, We use the following sh script to start (its the default one when installed)
cat /usr/local/etc/rc.d/mysql-server.sh #!/bin/sh # # $FreeBSD: ports/databases/mysql50-server/files/mysql-server.sh.in,v 1.32006/03/07 16:25:00 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/mysqld_safe" command_args="--defaults-extra-file=${mysql_dbdir}/my.cnf --user=${mysql_user} --datadir=${mysql_dbdir} --pid-file=${pidfile} ${mysql_args} > /dev/null &" 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 [ $? -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" In rc.conf we have: mysql_enable="YES" mysql_args="--myisam-recover=BACKUP,FORCE" Here is the ps of it running: # ps -axwww |grep mysql 62025 p0 R+ 0:00.00 grep mysql 78519 p0- I 0:00.01 /bin/sh /usr/local/bin/mysqld_safe --defaults-extra-file=/var/db/mysql/my.cnf --user=mysql --datadir=/var/db/mysql --pid-file=/var/db/mysql/hostname.pid --myisam-recover=BACKUP,FORCE 78548 p0- S 180:27.77 /usr/local/libexec/mysqld --defaults-extra-file=/var/db/mysql/my.cnf --basedir=/usr/local --datadir=/var/db/mysql --user=mysql --pid-file=/var/db/mysql/hostname.pid --port=3306 --socket=/tmp/mysql.sock --myisam-recover=BACKUP,FORCE We could try that, but why would it behave differently to the current sh script? Thanks Ian On Thu, Feb 28, 2008 at 7:43 PM, Vidal Garza <[EMAIL PROTECTED]> wrote: > how do you start up? > you can start up from scrip. > > #!/bin/sh > id="02" > ip="192.168.0.42" > > sockfile="/tmp/mysql$id.sock" > user="mysql" > datdir="/var/db/mysql$id" > port="3306" > /bin/sh /usr/local/bin/mysqld_safe --user=$user --datadir=$datdir > --bind-address=$ip --port=$port --sock=$sockfile & > > > > Ian escribió: > > Hi, > > > > I am running mysql 5.0.45 on freebsd 4.11 and for some strange reason > > /tmp/mysql.sock keeps on disappearing and we are forced to kill -9 mysql > and > > restart it causing db corruptions as there is no other way of telling it > to > > stop once that file has gone. I have tried to find any reason why this > > happens and there are no errors, no core files, nothing - the file just > > disappears. > > > > Here is the error when trying to login: > > > > # mysql -p cache > > Enter password: > > > > ERROR 2002 (HY000): Can't connect to local MySQL server through socket > > '/tmp/mysql.sock' (61) > > > > Here is my my.cnf file: > > [client] > > port = 3306 > > socket = /tmp/mysql.sock > > > > [mysqld] > > port = 3306 > > socket = /tmp/mysql.sock > > skip-locking > > key_buffer = 16M > > max_allowed_packet = 1M > > table_cache = 64 > > sort_buffer_size = 512K > > net_buffer_length = 8K > > read_buffer_size = 256K > > read_rnd_buffer_size = 512K > > myisam_sort_buffer_size = 8M > > #log-bin > > > > server-id = 1 > > > > # Uncomment the following if you are using BDB tables > > #bdb_cache_size = 4M > > #bdb_max_lock = 10000 > > > > # Uncomment the following if you are using InnoDB tables > > #innodb_data_home_dir = /var/db/mysql/ > > #innodb_data_file_path = ibdata1:10M:autoextend > > #innodb_log_group_home_dir = /var/db/mysql/ > > #innodb_log_arch_dir = /var/db/mysql/ > > # You can set .._buffer_pool_size up to 50 - 80 % > > # of RAM but beware of setting memory usage too high > > #innodb_buffer_pool_size = 16M > > #innodb_additional_mem_pool_size = 2M > > # Set .._log_file_size to 25 % of buffer pool size > > #innodb_log_file_size = 5M > > #innodb_log_buffer_size = 8M > > #innodb_flush_log_at_trx_commit = 1 > > #innodb_lock_wait_timeout = 50 > > > > [mysqldump] > > quick > > max_allowed_packet = 16M > > > > [mysql] > > no-auto-rehash > > > > [isamchk] > > key_buffer = 20M > > sort_buffer_size = 20M > > read_buffer = 2M > > write_buffer = 2M > > > > [myisamchk] > > key_buffer = 20M > > sort_buffer_size = 20M > > read_buffer = 2M > > write_buffer = 2M > > > > [mysqlhotcopy] > > interactive-timeout > > > > The machine in question is a dual xeon with 4gig of ram. > > > > Any ideas? > > > > Thanks in advance, > > Ian > > > > > > > -- > ==================================================== > Ing. Vidal Garza Tirado > Depto. Sistemas > Aduanet S.A. de C.V. > Tel. (867)711-5850 ext. 4346, Fax (867)711-5855. > Ave. César López de Lara No. 3603 Int. B Col Jardín. > Nuevo Laredo, Tamaulipas, México. > > > > -- > Este mensaje ha sido analizado por MailScanner > en busca de virus y otros contenidos peligrosos, > y se considera que está limpio. > For all your IT requirements visit: http://www.aduanet.net > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: > http://lists.mysql.com/[EMAIL PROTECTED] > >