Difference between revisions of "Running mysqld in chroot"

From WebOS Internals
Jump to navigation Jump to search
(Initial Entry)
 
(Added two forgotten steps in section two.)
 
Line 9: Line 9:
 
** Create its /var/run directory. <pre>mkdir /var/run/mysqld</pre>
 
** Create its /var/run directory. <pre>mkdir /var/run/mysqld</pre>
 
** Create the socket lock file. <pre>touch /var/run/mysqld/mysqld.sock</pre>
 
** Create the socket lock file. <pre>touch /var/run/mysqld/mysqld.sock</pre>
 +
** Give the mysql group ownership of the run directory. <pre>chown -r root:mysql /var/run/mysqld</pre>
 +
** Ensure corrent permissions on the run directory. <pre>chmod 775 /var/run/mysqld && chmod 644 /var/run/mysqld/mysqld.sock</pre>
  
 
* Install the database <pre>mysql_install_db</pre>
 
* Install the database <pre>mysql_install_db</pre>
  
 
If the above does not work, I've forgotten a step. Please email your terminal log to me so I can figure out what I forgot and amend the wiki.
 
If the above does not work, I've forgotten a step. Please email your terminal log to me so I can figure out what I forgot and amend the wiki.

Latest revision as of 00:46, 21 February 2012

Please be careful when following the instructions on this page. They are entirely from memory. If you'd like assistance along the way, have a specific reason for wanting to run mysqld, and are knowledgeable enough about linux/WebOS to help me help you work remotely on any issues that arise, I can be reached at cerealklr@<humans.should.remove.this.token>gmail.com. This guide assumes mysqld and its dependencies have already been installed, and that you are operating in a debian based chroot.

  • Create the user 'mysql' for the daemon to run as.
    • Create the user itself.
      adduser --system mysql
    • Create a group for the user.
      addgroup --system mysql
    • Add the user to the group.
      adduser mysql mysql
  • Create boilerplate my mysql's locking mechanisms.
    • Create its /var/run directory.
      mkdir /var/run/mysqld
    • Create the socket lock file.
      touch /var/run/mysqld/mysqld.sock
    • Give the mysql group ownership of the run directory.
      chown -r root:mysql /var/run/mysqld
    • Ensure corrent permissions on the run directory.
      chmod 775 /var/run/mysqld && chmod 644 /var/run/mysqld/mysqld.sock
  • Install the database
    mysql_install_db

If the above does not work, I've forgotten a step. Please email your terminal log to me so I can figure out what I forgot and amend the wiki.