Informations
Jump to content

Lorem Ipsum...

Click to Dismiss this Notification
Ładowanie danych...

Install MariaDB instead MySQL v2


100%

Recommended Posts

  • Administrator

What are the advantages of MariaDB over MySQL?

MariaDB is a fork of MySQL and is fully compatible with it. Experts predict that MariaDB will eventually replace Oracle's MySQL Server as the preferred relational database management system (RDBMS).

There are several reasons why MariaDB is preferred over MySQL:

  • More features for performance and data integrity, such as the Aria storage engine. Aria is an upgrade of the old MyISAM storage engine used on many servers, including Metin2 Private server. MyISAM has bugs and is not ACID-compliant like InnoDB. An upgrade to InnoDB is the XtraDB fork, used on MariaDB and Percona. If you cannot convert your tables from MyISAM to InnoDB or XtraDB, you can use Aria, which is similar to MyISAM.
  • Installation and administration of MariaDB is similar to that of MySQL. The service is called mysql-server, and the path of MariaDB's home directory is /var/db/mysql, just like Oracle MySQL server.
  • MariaDB is faster and more reliable than MySQL, with a lower risk of crashes, bugs, and data loss.

How to install MariaDB on FreeBSD?

If you have an existing MySQL server installation, you need to remove it before installing MariaDB:

  • Create a security backup of your MySQL data directory: cd /var/db && tar -cvJf mysql.tar.xz mysql
  • Create a backup of your application databases (e.g., Metin2, website) using the CLI utility mysqldump or GUI with Navicat (right-click on the database name -> Dump SQL file -> Structure and data).
  • Stop the MySQL server with: service mysql-server stop
  • Remove the MySQL directory: rm -rf /var/db/mysql
  • Find the MySQL version: mysql --version
  • Deinstall MySQL from ports: cd /usr/ports/databases/mysqlxx-server && make deinstall clean && cd /usr/ports/databases/mysqlxx-client && make deinstall clean, where xx is the version you found in the previous step.

To install MariaDB on FreeBSD:

  • Update your ports tree: portsnap fetch update
  • Install MariaDB: cd /usr/ports/databases/mariadb101-server && make install clean
  • If the MySQL service is not enabled, enable it: echo "mysql_enable=YES" >> /etc/rc.conf
  • Start the MySQL server: service mysql-server start
  • Import your application databases (e.g., Metin2, website) from the backup file created earlier. Do not import from a datafile!
  • If you use Navicat, create a new connection for MariaDB instead of MySQL.

To improve the performance and security of your database, it is recommended to switch to a new storage engine for all tables. You have the option to choose a different storage engine for each table based on your requirements.

I would suggest choosing between Aria (new MyISAM) and XtraDB (new InnoDB). Aria is best suited for tables with low write frequency and a need for fast reads, such as item_proto, mob_proto, shop, shop_item, or tables that require the FULLTEXT index feature for searching text columns. On the other hand, XtraDB is ideal for critical tables with high write frequency, such as player, item, and account tables.

To convert from one storage engine to another, there are two methods available: using a GUI like Navicat to change one table at a time, or using a query such as "ALTER TABLE <table_name> ENGINE=<engine>."

It is important to note that switching to a new storage engine does not eliminate the need for regular database backups. Therefore, please schedule frequent backups of your applicative databases using tools such as mysqldump. For added safety, take a datafile backup of the entire mysql data directory (/var/db/mysql) for emergency restoration in case the dump import does not work. However, use datafile restore only for the entire mysql directory and only if there are no other solutions available using dump.

Link to comment
Share on other sites


Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

spacer.png

Disable AdBlock
The popup will be closed in 5 seconds...