Difference between revisions of "MySQL"

From MineOS
Jump to: navigation, search
(Enabling remote access/TCP-IP connectivity)
Line 16: Line 16:
  
 
== Enabling remote access/TCP-IP connectivity ==
 
== Enabling remote access/TCP-IP connectivity ==
Remote access/TCP-IP connectivity is disabled by default.  To enable, edit the <tt>/etc/my.cnf</tt> file and comment out the line:
+
Remote access/TCP-IP connectivity is disabled by default.  All these actions must be done as '''root''':
 +
 
 +
Edit the <tt>/etc/my.cnf</tt> file and comment out the line:
  
 
  <nowiki>
 
  <nowiki>
Line 27: Line 29:
 
mysqld: ALL
 
mysqld: ALL
 
SSHD: ALL
 
SSHD: ALL
 +
</nowiki>
 +
 +
Finally ACCEPT all localhost traffic in firewall.
 +
 +
<nowiki>
 +
iptables -A INPUT -i lo -j ACCEPT
 
</nowiki>
 
</nowiki>
  

Revision as of 19:50, 1 September 2011

Contents

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':

# mysql_secure_installation

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.

# vi /etc/rc.conf

Remove mysqld from the list

Enabling remote access/TCP-IP connectivity

Remote access/TCP-IP connectivity is disabled by default. All these actions must be done as root:

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

#skip-networking

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

mysqld: ALL
SSHD: ALL

Finally ACCEPT all localhost traffic in firewall.

iptables -A INPUT -i lo -j ACCEPT

PhpMyAdmin

PhpMyAdmin is available as an addon. To install, ensure you have first secured MySQL. Then, as root:

# cd /usr/games/minecraft/addons
# ./phpmyadmin.sh

Enabling 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.