DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 3rd April 2009
bsdnewbie999 bsdnewbie999 is offline
Package Pilot
 
Join Date: May 2008
Posts: 145
Default mysqld_safe start error

When i run "#/usr/local/bin/mysqld_safe &" i got these error message.

Code:
# /usr/local/bin/mysqld_safe &                                                 
[1] 8190
# touch: /var/mysql/fiddler.fiddler.com.err: No such file or directory
chown: /var/mysql/fiddler.fiddler.com.err: No such file or directory
Starting mysqld daemon with databases from /var/mysql
/usr/local/bin/mysqld_safe[314]: cannot create /var/mysql/fiddler.fiddler.com.err: No such file or directory
/usr/local/bin/mysqld_safe: cannot create /var/mysql/fiddler.fiddler.com.err: No such file or directory
STOPPING server from pid file /var/mysql/fiddler.fiddler.com.pid
tee: /var/mysql/fiddler.fiddler.com.err: No such file or directory
090403 15:43:31  mysqld ended
tee: /var/mysql/fiddler.fiddler.com.err: No such file or directory
Reply With Quote
  #2   (View Single Post)  
Old 3rd April 2009
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Tcpdump Spy
 
Join Date: Apr 2008
Location: Netherlands
Posts: 2,243
Default

You should run MySQL as the mysql user, not as the super user, i.e.:
# mysqld_safe --user=mysql

The FreeBSD port adds the mysql user&group when the package is installed for you, I don't know if OpenBSD also does this; Create the user&group if they don't exist yet.

Does the /var/mysql directory exist? Also make sure it is chown(8)-ed to mysql:mysql

Additionally, you must run mysql_install_db to create the default MySQL administration database after you have first installed MySQL, remember to run it with the --user=mysql argument.
Please do read the mysql_install_db manual linked above, there are additional arguments that may be needed (i.e. --basedir).
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
  #3   (View Single Post)  
Old 3rd April 2009
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

When you did your pgk_add, bsdnewbie, you got a message that said:
Quote:
You can find detailed instructions on how to install a database
in /usr/local/share/doc/mysql/README.OpenBSD.
You must not have seen the message, or, paid no attention to it.

Last edited by jggimi; 3rd April 2009 at 01:45 PM.
Reply With Quote
  #4   (View Single Post)  
Old 3rd April 2009
bsdnewbie999 bsdnewbie999 is offline
Package Pilot
 
Join Date: May 2008
Posts: 145
Default

Where i add this lines to?
Code:
And start the server like this:

	if [ -x /usr/local/bin/mysqld_safe ] ; then
		su -c mysql root -c '/usr/local/bin/mysqld_safe >/dev/null 2>&1 &' 
		echo -n ' mysql'
	fi
Reply With Quote
  #5   (View Single Post)  
Old 3rd April 2009
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

Quoting rc.local(5):
Quote:
rc.local is executed towards the end of rc (it is not the very last as
there are a few services that must be started at the very end). Normal-
ly, rc.local contains commands and daemons that are not part of the stock
installation.
Reply With Quote
  #6   (View Single Post)  
Old 3rd April 2009
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,318
Default

Quote:
Originally Posted by bsdnewbie999 View Post
Where i add this lines to?
Once again, you are showing that you have no familarity with information found in the FAQ. This subject is covered in Section 10.3:

http://openbsd.org/faq/faq10.html#rc
Reply With Quote
  #7   (View Single Post)  
Old 3rd April 2009
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Default

How I start MySQL, in 3 easy listings. (note the user/group used is named _mysql)

in /etc/rc.local:

Code:
# launch the MySQL database server
if [ -x /usr/local/bin/mysqld_safe -a -x /etc/rc.mysql ]; then
        /etc/rc.mysql
fi

echo '.'
in /etc/rc.mysql:
Code:
#!/bin/sh
#
# A simple script to launch mysqld with the proper login privileges
#

su -c _mysql root -c '/usr/local/bin/mysqld_safe >/dev/null 2>&1 &'
echo -n ' mysql'
in /etc/login.conf:

Code:
 #
 # This class is used when running MySQL from /etc/rc.local
 # XXX: It will *N_O_T* be used when starting/stopping mysqld manually!!
 #
 _mysql:\
         :ignorenologin:\
         :datasize=infinity:\
         :maxproc=infinity:\
         :openfiles=3580:\       # I've set this to sysctl::kern.maxfiles
         :stacksize-cur=8M:\
         :localcipher=blowfish,8:\
         :tc=daemon:
note: set it to need, see login.conf in OpenBSD manual for details.


The rc.mysql script is used so that if I have to stop my database for some reason, I can restart it with the correct credentials without having to check rc.local for the commands.



As Carpetsmoker, jggimi, and ocicat have pointed out - do be sure to read the documentation while you're at it, it helps.
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.

Last edited by TerryP; 3rd April 2009 at 04:18 PM.
Reply With Quote
  #8   (View Single Post)  
Old 5th April 2009
bsdnewbie999 bsdnewbie999 is offline
Package Pilot
 
Join Date: May 2008
Posts: 145
Default

It works now.
Reply With Quote
Reply

Tags
mysqld_safe

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to start X11 on login? Mantazz FreeBSD Ports and Packages 2 10th July 2009 07:27 PM
Which is the best solution from start bsd.mp? aleunix OpenBSD General 18 4th May 2009 06:33 PM
How do I start kde4? PatrickBaer FreeBSD General 5 26th September 2008 08:18 PM
MYSQL HOW TO START disappearedng FreeBSD General 7 18th September 2008 09:48 AM
KDE wont start up dctr FreeBSD General 9 11th June 2008 05:59 AM


All times are GMT. The time now is 12:31 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick