Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
wiki:mysql_persistence_guide [2011/10/07 08:00] – bmarkus | wiki:mysql_persistence_guide [2015/04/06 08:55] (current) – [MySQL Settings] bmarkus | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Installing MySQL ====== | + | ARTICLE IS UNDER CONSTRUCTION !!! |
- | **OBSOLATE, UPDATE IN PROGRESS | + | ====== What is MariaDB ====== |
- | ** | + | |
- | First of all you will need to have the MySQL extension installed -- you can do this through the CLI on microcore | + | |
- | | + | MariaDB is an enhanced, drop-in replacement for MySQL. |
+ | |||
+ | ====== Installing MariaDB ====== | ||
+ | |||
+ | First of all you will need to have the MariaDB server and client extensions installed -- you can do this through the CLI | ||
+ | |||
+ | | ||
Or through the GUI app browser in tiny core. | Or through the GUI app browser in tiny core. | ||
- | Your MySQL installation will auto generate two items of interest '/usr/local/ | + | Your MariaDB |
You will want to copy both these items to a persistent | You will want to copy both these items to a persistent | ||
Line 15: | Line 19: | ||
I will talk you through both. | I will talk you through both. | ||
- | ====== MySQL Settings ====== | + | ====== |
+ | |||
+ | MySQL daemon must be running to work with databases. Use Services menu of Control Panel or following command: | ||
+ | |||
+ | / | ||
+ | |||
+ | To start it automatically at boot time, add command to / | ||
+ | |||
+ | To stop daemon: | ||
+ | |||
+ | / | ||
+ | |||
+ | To stop it automatically add command to / | ||
+ | |||
+ | |||
+ | ====== MariaDB | ||
=== Root password === | === Root password === | ||
Line 72: | Line 91: | ||
With this method you must add the following directories and files to your / | With this method you must add the following directories and files to your / | ||
- | /usr/local/etc/my.cnf | + | /usr/local/mysql/data |
- | / | + | |
| | ||
This will restore your MySQL settings and DB's on boot. | This will restore your MySQL settings and DB's on boot. | ||
- | |||
- | Because this restoration occurs after the MySQL extension is loaded, you must reboot the MySQL daemon with the following commands added to / | ||
- | |||
- | mysqladmin --user=root shutdown | ||
- | / | ||
With the filetool method **you must** make sure that before you shutdown, any open connections to the MySQL DBs are closed, otherwise data loss will occur. You can safely shut down the MySQL daemon using the following command; | With the filetool method **you must** make sure that before you shutdown, any open connections to the MySQL DBs are closed, otherwise data loss will occur. You can safely shut down the MySQL daemon using the following command; | ||
- | | + | |
+ | |||
+ | or using services control panel. | ||
Line 91: | Line 106: | ||
In this method, you have a much lower chance of data loss, as it does not rely on regular ' | In this method, you have a much lower chance of data loss, as it does not rely on regular ' | ||
- | First you will want to copy over your my.cnf and mysql directory over to a storage directory. In this case, I will be using the generic hdd -- it could be sda1, hda3, sdb e.t.c. | + | First you will want to copy over your my.cnf and data directory over to a storage directory. In this case, I will be using the generic hdd -- it could be sda1, sda3, e.t.c. |
- | cp -fr /usr/local/var/mysql / | + | cp -fr / |
- | cp -f /usr/local/etc/my.cnf / | + | cp -f /etc/my.cnf / |
| | ||
You will then need to add the following commands to / | You will then need to add the following commands to / | ||
- | rm -fr /usr/local/var/mysql | + | rm -fr / |
- | rm -f /usr/local/ | + | rm -f / |
- | ln -s / | + | ln -s / |
- | ln -s / | + | ln -s / |
- | mysqladmin --user=root shutdown | + | /etc/init.d/services/mysql start |
- | /usr/local/bin/mysqld_multi | + | |
| | ||
As long as no open, active connections are present on shutdown or crash, no data corruption or loss //should// occur. | As long as no open, active connections are present on shutdown or crash, no data corruption or loss //should// occur. |