Steps to Transfer from MySQL to MariaDB
Step 1: Backup Your MySQL Database
First, generate a backup sql file of the MySQL database using the mysqldump command:
So, Open the Command Prompt and execute:
mysqldump -u [username] -p [database_name] > [the_path]
- [username]: Your MySQL username.
- [database_name]: The name of the database you want to back up.
- [the_path]: The path where your backup file will be saved.
for example,
mysqldump -u root -p gfgdb > F:\backup.sql
Step 2: Install MariaDB
Install MariaDB on your server. The installation process will depend on your operating system.
also create a new database in maiadb server to import.
Step 3: Stop MySQL Service
net stop MySQL
Step 4: Start MariaDB Service
net start MariaDB
Step 5: Import the MySQL Data into MariaDB
After installing MariaDB, open Command Prompt and start the MariaDB service, then import your data:
mysql -u [username] -p[password] [database_name] < [backup_path]
- [username]: Your MariaDB username.
- [database_name]: The name of the database you want to restore.
- [the_path]: The path where the backup file was saved.
example,
mysql -u root -p newgfgdb < F:\backup.sql
Step 6: Verify the Migration
To verify the migration, retrieve the tables and data from new database in mariadb.
SHOW DATABASES;
USE newgfgdb;
SHOW TABLES;
SELECT * FROM users;
How to Migrating Data from MySQL to MariaDB?
Many times we developers and database administrators, want things like high performance, the ability to be open source, as well as additional features that MariaDB provides frequently move their data from MySQL to Maria DB.
So Migrating data from MySQL to MariaDB can be done through several steps that will allow your data and configurations to be properly migrated.
Contact Us