Difference between revisions of "MySQL"
(21 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | {{Buildfromscratch}} | ||
+ | |||
+ | == Youtube walk-through == | ||
+ | [http://www.youtube.com/watch?v=Fcr7N3f7IxY Securing MySQL and installing phpMyAdmin] | ||
+ | |||
== Securing MySQL == | == 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 | + | 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: |
− | + | {{executeasroot | |
− | + | | commands = mysql_secure_installation}} | |
− | |||
== Disabling MySQL == | == 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. | 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. | ||
− | + | {{executeasroot | |
− | + | | commands = vi /etc/rc.conf}} | |
− | |||
[[File:mysqld_rc.png|thumb|none|400px|Remove mysqld from the list]] | [[File:mysqld_rc.png|thumb|none|400px|Remove mysqld from the list]] | ||
== PhpMyAdmin == | == PhpMyAdmin == | ||
+ | [[PhpMyAdmin]] is available as an addon. To install, ensure you have first secured MySQL. Then, follow the steps to download and install [[PhpMyAdmin]] from its wiki page. | ||
− | + | == 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''': | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | Remote access/TCP-IP connectivity is disabled by default on installs <= 0.4.6. All these actions must be done as '''root''': | ||
Edit the <tt>/etc/my.cnf</tt> file and comment out the line: | Edit the <tt>/etc/my.cnf</tt> file and comment out the line: | ||
− | < | + | <syntaxhighlight lang="bash"> |
#skip-networking | #skip-networking | ||
− | </ | + | </syntaxhighlight> |
Edit the hosts.allow file as well to add the mysqld daemon: | Edit the hosts.allow file as well to add the mysqld daemon: | ||
− | < | + | <syntaxhighlight lang="bash"> |
mysqld: ALL | mysqld: ALL | ||
SSHD: ALL | SSHD: ALL | ||
− | </ | + | </syntaxhighlight> |
Have all localhost generated packets accepted by default in [[iptables]]: | Have all localhost generated packets accepted by default in [[iptables]]: | ||
− | + | {{executeasroot | |
− | iptables -A INPUT -i lo -j ACCEPT | + | | commands = iptables -A INPUT -i lo -j ACCEPT |
− | iptables-save > /etc/iptables-rules | + | iptables-save > /etc/iptables-rules}} |
− | |||
You will need to restart the mysqld daemon for these changes to take effect. | You will need to restart the mysqld daemon for these changes to take effect. | ||
− | + | {{executeasroot | |
− | /etc/rc.d/mysqld restart | + | | commands = /etc/rc.d/mysqld restart}} |
− | + | ||
+ | [[Category:Maintenance]] | ||
+ | [[Category:Securing]] | ||
+ | [[Category:Addons]] | ||
+ | [[Category:Connectivity]] |
Latest revision as of 14:45, 2 October 2017
This page is part of the 'build MineOS CRUX-from-the-ground-up series'. The information here is provided for comprehensiveness in documenting the steps in creating MineOS CRUX from CRUX Linux 2.7. These steps are already automated in the mainline release ISO. |
Contents
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: |
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.
As root: |
vi /etc/rc.conf
|
PhpMyAdmin
PhpMyAdmin is available as an addon. To install, ensure you have first secured MySQL. Then, follow the steps to download and install PhpMyAdmin from its wiki page.
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">
- 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:
As root: |
iptables -A INPUT -i lo -j ACCEPT
iptables-save > /etc/iptables-rules
|
You will need to restart the mysqld daemon for these changes to take effect.
As root: |
/etc/rc.d/mysqld restart
|