MySQL

From MineOS Wiki
Revision as of 07:00, 26 September 2011 by Hexparrot (talk | contribs) (→‎PhpMyAdmin)
Jump to navigation Jump to search

Youtube walk-through

Securing MySQL and installing phpMyAdmin

Securing MySQL

The MySQL password is not set by default (blank), and can only be set when the MySQL daemon is running (upon first boot). To set the password, execute the following command as 'root':

<syntaxhighlight lang="bash">

mysql_secure_installation </syntaxhighlight>

Disabling MySQL

If you are certain you have no need for MySQL, either for websites or for your Minecraft server mods, you may remove it from the services list.

<syntaxhighlight lang="bash">

vi /etc/rc.conf </syntaxhighlight>

Remove mysqld from the list

PhpMyAdmin

PhpMyAdmin is available as an addon. To install, ensure you have first secured MySQL. Then, follow the steps to download and install PhpmyAdmin.

Enable PHP for PhpMyAdmin

PHP is only permitted to execute in /var/www/hiawatha/admin by default, follow instructions to enable PHP for /var/www/hiawatha/phpmyadmin (or you may enable PHP for all directories if you choose).

PhpMyAdmin is now accessible via https://ip-address/phpmyadmin. Note: HTTPS is required for PhpMyAdmin.

Enabling remote access/TCP-IP connectivity

Remote access/TCP-IP connectivity is disabled by default on installs <= 0.4.6--later versions can ignore this step as it has already been automated. All these actions must be done as root:

Edit the /etc/my.cnf file and comment out the line:

<syntaxhighlight lang="bash">
  1. skip-networking

</syntaxhighlight>

Edit the hosts.allow file as well to add the mysqld daemon:

<syntaxhighlight lang="bash">

mysqld: ALL SSHD: ALL </syntaxhighlight>

Have all localhost generated packets accepted by default in iptables:

<syntaxhighlight lang="bash">

iptables -A INPUT -i lo -j ACCEPT iptables-save > /etc/iptables-rules </syntaxhighlight>

You will need to restart the mysqld daemon for these changes to take effect.

<syntaxhighlight lang="bash">

/etc/rc.d/mysqld restart </syntaxhighlight>