Directadmin - Downgrade MariaDB 10.4 to 10.2

dr1361teh

Verified User
Joined
Aug 6, 2019
Messages
28
I want to downgrade MariaDB 10.4 to 10.2 regarding Directadmin 1.57.5

Please help me. Thanks
 
Hello,

Downgrading MariaDB is not supported. The only reliable way to downgrade is to restore from a full backup made before upgrading, and start the old version of MariaDB (https://mariadb.com/kb/en/library/downgrading-between-major-versions-of-mariadb/)

So you will need to do the following:

1. Dump all databases:

Code:
cd /usr/local/directadmin/custombuild
./build udpate
./build mysql_backup

2. Uninstall MariaDB 10.4 (instructions depends on OS distributive) and rename /var/lib/mysql to /var/lib/mysql.old

3. Do a fresh install of MariaDB

Code:
cd /usr/local/directadmin/scripts
./mysql.sh [B]rootpass[/B] da_admin [B]daadminpass[/B]

- replace rootpass per your needs
- replace daadminpass per your needs

4. Update MariaDB to your desired version with custombuild.

https://help.directadmin.com/?query=downgrade
 
Do not!

If you downgrade from options.conf and rebuild, it will leave you in unusable state - no databases will work. If you are lucky, reverting back to the newer version will make the things back up and running.

If it is 100% necessarily, do what Alex said. You will have to start from fresh installation.
 
I completely remove MariaDB 10.4

To confirm I run following command:
Code:
$ sudo systemctl stop mysqld.service && sudo yum remove -y mariadb mariadb-server && sudo rm -rf /var/lib/mysql /etc/my.cnf

Loaded plugins: fastestmirror
No Match for argument: mariadb
No Match for argument: mariadb-server
No Packages marked for removal

After that Set MariaDB 10.0 in options.conf :
Code:
MariaDB: 10.0.38
MySQL backup: yes
MySQL backup directory: /usr/local/directadmin/custombuild/mysql_backups
MySQL compress backups: yes

Then, to install fresh MariaDB 10.0 I run the command that Alex advised:
Code:
./mysql.sh [my root pass] da_admin [my DA admin pass]

the result was not successful :(

Code:
Installing MariaDB
ls: cannot access /usr/local/directadmin/scripts/packages/MariaDB-server*.rpm: No such file or directory
warning: /usr/local/directadmin/scripts/packages/MariaDB-10.0.38-centos73-x86_64-server.rpm: Header V4 DSA/SHA1 Signature, key ID 1bb943db: NOKEY
warning: package MariaDB-server-10.0.38-1.el7.centos.x86_64 was already added, skipping MariaDB-server-5.5.62-1.el7.centos.x86_64
Preparing...                          ################################# [100%]
Updating / installing...
   1:MariaDB-server-10.0.38-1.el7.cent################################# [100%]
190808 19:05:17 [Note] /usr/sbin/mysqld (mysqld 10.0.38-MariaDB) starting as process 28786 ...
190808 19:05:17 [Note] InnoDB: innodb_empty_free_list_algorithm has been changed to legacy because of small buffer pool size. In order to use backoff, increase buffer pool at least up to 20MB.

190808 19:05:17 [Note] InnoDB: Using mutexes to ref count buffer pool pages
190808 19:05:17 [Note] InnoDB: The InnoDB memory heap is disabled
190808 19:05:17 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
190808 19:05:17 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
190808 19:05:17 [Note] InnoDB: Compressed tables use zlib 1.2.7
190808 19:05:17 [Note] InnoDB: Using Linux native AIO
190808 19:05:17 [Note] InnoDB: Using CPU crc32 instructions
190808 19:05:17 [Note] InnoDB: Initializing buffer pool, size = 128.0M
190808 19:05:17 [Note] InnoDB: Completed initialization of buffer pool
190808 19:05:17 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
190808 19:05:17 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
190808 19:05:17 [Note] InnoDB: Database physically writes the file full: wait...
190808 19:05:20 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
190808 19:05:21 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
190808 19:05:24 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
190808 19:05:24 [Warning] InnoDB: New log files created, LSN=45781
190808 19:05:24 [Note] InnoDB: Doublewrite buffer not found: creating new
190808 19:05:24 [Note] InnoDB: Doublewrite buffer created
190808 19:05:24 [Note] InnoDB: 128 rollback segment(s) are active.
190808 19:05:24 [Warning] InnoDB: Creating foreign key constraint system tables.
190808 19:05:24 [Note] InnoDB: Foreign key constraint system tables created
190808 19:05:24 [Note] InnoDB: Creating tablespace and datafile system tables.
190808 19:05:24 [Note] InnoDB: Tablespace and datafile system tables created.
190808 19:05:24 [Note] InnoDB: Waiting for purge to start
190808 19:05:24 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.42-84.2 started; log sequence number 0
190808 19:05:26 [Note] InnoDB: FTS optimize thread exiting.
190808 19:05:26 [Note] InnoDB: Starting shutdown...
190808 19:05:26 [Note] InnoDB: Waiting for page_cleaner to finish flushing of buffer pool
190808 19:05:28 [Note] InnoDB: Shutdown completed; log sequence number 1616697
190808 19:05:28 [Note] /usr/sbin/mysqld (mysqld 10.0.38-MariaDB) starting as process 28818 ...
190808 19:05:28 [Note] InnoDB: innodb_empty_free_list_algorithm has been changed to legacy because of small buffer pool size. In order to use backoff, increase buffer pool at least up to 20MB.

190808 19:05:28 [Note] InnoDB: Using mutexes to ref count buffer pool pages
190808 19:05:28 [Note] InnoDB: The InnoDB memory heap is disabled
190808 19:05:28 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
190808 19:05:28 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
190808 19:05:28 [Note] InnoDB: Compressed tables use zlib 1.2.7
190808 19:05:28 [Note] InnoDB: Using Linux native AIO
190808 19:05:28 [Note] InnoDB: Using CPU crc32 instructions
190808 19:05:28 [Note] InnoDB: Initializing buffer pool, size = 128.0M
190808 19:05:28 [Note] InnoDB: Completed initialization of buffer pool
190808 19:05:28 [Note] InnoDB: Highest supported file format is Barracuda.
190808 19:05:28 [Note] InnoDB: 128 rollback segment(s) are active.
190808 19:05:28 [Note] InnoDB: Waiting for purge to start
190808 19:05:28 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.42-84.2 started; log sequence number 1616697
190808 19:05:28 [Note] InnoDB: FTS optimize thread exiting.
190808 19:05:28 [Note] InnoDB: Starting shutdown...
190808 19:05:29 [Note] InnoDB: Waiting for page_cleaner to finish flushing of buffer pool
190808 19:05:30 [Note] InnoDB: Shutdown completed; log sequence number 1616707

PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following commands:

'/usr/sbin/mysqladmin' -u root password 'new-password'
'/usr/sbin/mysqladmin' -u root -h srv.maralnethost.tk password 'new-password'

Alternatively you can run:
'/usr/sbin/mysql_secure_installation'

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the MariaDB Knowledgebase at http://mariadb.com/kb or the
MySQL manual for more instructions.

Please report any problems at http://mariadb.org/jira

The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/

warning: /usr/local/directadmin/scripts/packages/MariaDB-10.0.38-centos73-x86_64-client.rpm: Header V4 DSA/SHA1 Signature, key ID 1bb943db: NOKEY
warning: package MariaDB-client-10.0.38-1.el7.centos.x86_64 was already added, skipping MariaDB-client-5.5.62-1.el7.centos.x86_64
Preparing...                          ################################# [100%]
Updating / installing...
   1:MariaDB-client-10.0.38-1.el7.cent################################# [100%]
warning: /usr/local/directadmin/scripts/packages/MariaDB-10.0.38-centos73-x86_64-devel.rpm: Header V4 DSA/SHA1 Signature, key ID 1bb943db: NOKEY
warning: package MariaDB-devel-10.0.38-1.el7.centos.x86_64 was already added, skipping MariaDB-devel-5.5.62-1.el7.centos.x86_64
Preparing...                          ################################# [100%]
Updating / installing...
   1:MariaDB-devel-10.0.38-1.el7.cento################################# [100%]
warning: /usr/local/directadmin/scripts/packages/MariaDB-10.0.38-centos73-x86_64-shared.rpm: Header V4 DSA/SHA1 Signature, key ID 1bb943db: NOKEY
warning: package MariaDB-shared-10.0.38-1.el7.centos.x86_64 was already added, skipping MariaDB-shared-5.5.62-1.el7.centos.x86_64
Preparing...                          ################################# [100%]
Updating / installing...
   1:MariaDB-shared-10.0.38-1.el7.cent################################# [100%]
warning: /usr/local/directadmin/scripts/packages/MariaDB-10.0.38-centos73-x86_64-common.rpm: Header V4 DSA/SHA1 Signature, key ID 1bb943db: NOKEY
warning: package MariaDB-common-10.0.38-1.el7.centos.x86_64 was already added, skipping MariaDB-common-5.5.62-1.el7.centos.x86_64
Preparing...                          ################################# [100%]
Updating / installing...
   1:MariaDB-common-10.0.38-1.el7.cent################################# [100%]
warning: /usr/local/directadmin/scripts/packages/MariaDB-10.0.38-centos73-x86_64-compat.rpm: Header V4 DSA/SHA1 Signature, key ID 1bb943db: NOKEY
warning: package MariaDB-compat-10.0.38-1.el7.centos.x86_64 was already added, skipping MariaDB-compat-5.5.62-1.el7.centos.x86_64
Preparing...                          ################################# [100%]
Updating / installing...
   1:MariaDB-compat-10.0.38-1.el7.cent################################# [100%]
usermod: no changes
Job for mysqld.service failed because a timeout was exceeded. See "systemctl status mysqld.service" and "journalctl -xe" for details.
● mysqld.service - MariaDB database server
   Loaded: loaded (/etc/systemd/system/mysqld.service; disabled; vendor preset: disabled)
   Active: failed (Result: timeout) since Thu 2019-08-08 19:08:34 +0430; 1s ago
  Process: 29107 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 29105 ExecStartPre=/bin/sh -c [ -x /usr/bin/galera_recovery ] || exit 0; VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] &&   systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
  Process: 29103 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
 Main PID: 29107 (code=exited, status=0/SUCCESS)

Aug 08 19:08:31 srv.maralnethost.tk mysqld[29107]: 190808 19:08:31 [Note] /usr/sbin/mysqld: Normal shutdown
Aug 08 19:08:31 srv.maralnethost.tk mysqld[29107]: 190808 19:08:31 [Note] Event Scheduler: Purging the queue. 0 events
Aug 08 19:08:31 srv.maralnethost.tk mysqld[29107]: 190808 19:08:31 [Note] InnoDB: FTS optimize thread exiting.
Aug 08 19:08:31 srv.maralnethost.tk mysqld[29107]: 190808 19:08:31 [Note] InnoDB: Starting shutdown...
Aug 08 19:08:32 srv.maralnethost.tk mysqld[29107]: 190808 19:08:32 [Note] InnoDB: Waiting for page_cleaner to finish flushing of buffer pool
Aug 08 19:08:33 srv.maralnethost.tk mysqld[29107]: 190808 19:08:33 [Note] InnoDB: Shutdown completed; log sequence number 1616717
Aug 08 19:08:34 srv.maralnethost.tk mysqld[29107]: 190808 19:08:34 [Note] /usr/sbin/mysqld: Shutdown complete
Aug 08 19:08:34 srv.maralnethost.tk systemd[1]: Failed to start MariaDB database server.
Aug 08 19:08:34 srv.maralnethost.tk systemd[1]: Unit mysqld.service entered failed state.
Aug 08 19:08:34 srv.maralnethost.tk systemd[1]: mysqld.service failed.
Waiting for mysqld to start....
Setting MySQL Root Password...
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2 "No such file or directory")
Setting DirectAdmin user and password...
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2 "No such file or directory")
Securing installation...
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2 "No such file or directory")


Any idea?
 
It seems you've got both MariaDB 5.5 and 10.0 under /usr/local/directadmin/scripts/packages/, you need to remove rpm files for one of the versions and try again.
 
Back
Top