Running mysqld in chroot

From WebOS Internals
Jump to navigation Jump to search

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.