upgrade mysql to mariadb

on August 2 | in LAMP | by | with No Comments

Upgrade mysql to mariadb. If face issue, please notify.

1) First take backup of all databases;

#mysqldump -u root -p –all-databases > mysqlbackup.sql
#cp /etc/my.cnf /etc/my.cnf-yyyy-mm-dd [ Take mysql configuration file backup ]

2) As your distribution got updated so its automatically update your database from mysql to mariadb. Now follow
below steps, to set new password.

#/bin/mysql_secure_installation

3) Restore mysql configure

# cp /etc/my.cnf.rpmsave /etc/my.cnf

4) Restore database backup

# mysql -u root -p < mysqlbackup.sql

5) Restart mysql service.

#systemctl restart mysqld.service

[snip]

140802 8:34:42 [Note] /usr/libexec/mysqld: ready for connections.
Version: ‘5.5.38-MariaDB-log’ socket: ‘/var/lib/mysql/mysql.sock’ port: 3306 MariaDB Server

[/snip]

6) Now login to mariadb for verification.

# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 4
Server version: 5.5.38-MariaDB-log MariaDB Server

Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

MariaDB [(none)]> show databases;
+——————–+
| Database |
+——————–+
| information_schema |
| dbmydnsconfig |
| performance_schema |
| rt3 |
| test |
+——————–+
9 rows in set (0.00 sec)

MariaDB [(none)]> status
————–
mysql Ver 15.1 Distrib 5.5.38-MariaDB, for Linux (x86-64) using readline 5.1

Connection id: 4
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ”
Using delimiter: ;
Server: MariaDB
Server version: 5.5.38-MariaDB-log MariaDB Server
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: latin1
Db characterset: latin1
Client characterset: utf8
Conn. characterset: utf8
UNIX socket: /var/lib/mysql/mysql.sock
Uptime: 1 min 44 sec

Threads: 1 Questions: 6 Slow queries: 0 Opens: 0 Flush tables: 2 Open tables: 26 Queries per second avg: 0.057
————–

MariaDB [(none)]> use rt3
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [rt3]> show tables;
+————————-+
| Tables_in_rt3 |
+————————-+
| ACL |
| Attachments |
| Attributes |
| CachedGroupMembers |
| CustomFieldValues |
| CustomFields |
| GroupMembers |
| Groups |
| Links |
| ObjectCustomFieldValues |
| ObjectCustomFields |
| Principals |
| Queues |
| ScripActions |
| ScripConditions |
| Scrips |
| Templates |
| Tickets |
| Transactions |
| Users |
| sessions |
+————————-+
21 rows in set (0.00 sec)

MariaDB [rt3]> select * from Users where Name=’root’;
+—-+——+——————————————+———–+———–+—————-+———————+————–+————+———-+——+—————+————-+———————–+——————-+—————-+————+——-+———–+———–+————-+————+———-+———-+——+——-+——+———+———-+——–+———+———————+—————+———————+
| id | Name | Password | Comments | Signature | EmailAddress | FreeformContactInfo | Organization | RealName | NickName | Lang | EmailEncoding | WebEncoding | ExternalContactInfoId | ContactInfoSystem | ExternalAuthId | AuthSystem | Gecos | HomePhone | WorkPhone | MobilePhone | PagerPhone | Address1 | Address2 | City | State | Zip | Country | Timezone | PGPKey | Creator | Created | LastUpdatedBy | LastUpdated |
+—-+——+——————————————+———–+———–+—————-+———————+————–+————+———-+——+—————+————-+———————–+——————-+—————-+————+——-+———–+———–+————-+————+———-+———-+——+——-+——+———+———-+——–+———+———————+—————+———————+
| 12 | root | tr0+iWKaNyTpBsfTtyXn3nyf/Kfxk/JTWY9BENLE | SuperUser | NULL | root@localhost | NULL | NULL | Enoch Root | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | root | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | 1 | 2011-11-27 17:22:57 | 1 | 2011-11-27 17:22:57 |
+—-+——+——————————————+———–+———–+—————-+———————+————–+————+———-+——+—————+————-+———————–+——————-+—————-+————+——-+———–+———–+————-+————+———-+———-+——+——-+——+———+———-+——–+———+———————+—————+———————+
1 row in set (0.00 sec)

Note: May be you required to repair some tables which you will get alert in mariadb log file, take action accordingly, if face issue, please contact me.

1934 Total Views 1 Views Today
Pin It

related posts

Comments are closed.

« »