Difference between revisions of "MySQL"

From MineOS
Jump to: navigation, search
(Auto-starting mysqld on boot)
(Auto-starting mysqld on boot)
Line 30: Line 30:
 
== Auto-starting mysqld on boot ==
 
== Auto-starting mysqld on boot ==
 
# Edit the startup services config file: <tt>vi /etc/rc.conf</tt>
 
# Edit the startup services config file: <tt>vi /etc/rc.conf</tt>
# Append <tt>lighttpd</tt> at the end of the start-up services list.
+
# Append <tt>mysqld</tt> at the end of the start-up services list.
 
# Save and quit with <tt>:wq</tt>
 
# Save and quit with <tt>:wq</tt>
 
# <tt>reboot</tt> and confirm <tt>mysqld</tt> in running processes.
 
# <tt>reboot</tt> and confirm <tt>mysqld</tt> in running processes.
  
 
[[File:mysqld_rc.png|thumb|none|400px|Adjusted /etc/rc.conf]]
 
[[File:mysqld_rc.png|thumb|none|400px|Adjusted /etc/rc.conf]]

Revision as of 02:15, 14 June 2011

Contents

Dependencies

Ports

MySQL installation through the ports system requires cmake and libaio to be installed first, or else installing MySQL will not complete. libaio requires cmake as well, so be sure to install cmake first.

# cd /usr/ports/opt/cmake
# pkgmk -d -i

# cd /usr/ports/opt/libaio
# pkgmk -d -i

User

MySQL requires the mysql user and group to exist prior to successful installation. Create them before insattling mysql via ports.

# groupadd mysql
# useradd -g mysql -M -s /sbin/nologin mysql

Installing from ports

# cd /usr/ports/opt/mysql
# pkgmk -d -i
# mysql_install_db --user=mysql

Auto-starting mysqld on boot

  1. Edit the startup services config file: vi /etc/rc.conf
  2. Append mysqld at the end of the start-up services list.
  3. Save and quit with :wq
  4. reboot and confirm mysqld in running processes.
Adjusted /etc/rc.conf