CustomBuild 2 on CentOS 7 always always default to MariaDB

kaon

Verified User
Joined
Aug 7, 2008
Messages
42
Hello All,

I am suffering from CustomBuild. I have wasted all day on it.

I DONT want MariaDB.
I get clean CentOS 7. I then remove MariaDB and install MySQL.
I check MySQL by typing # mysql

After that I create the file options.conf using this command
Code:
# mkdir -p /usr/local/directadmin/custombuild/; nano /usr/local/directadmin/custombuild/options.conf

I pasted my options

Code:
#PHP Settings
php1_release=7.0
php1_mode=php-fpm
php2_release=5.6
php2_mode=php-fpm
opcache=no
htscanner=no
php_ini=no
php_timezone=Europe/London
php_ini_type=production
ioncube=yes
zend=no
suhosin=yes
x_mail_header=yes

#MySQL Settings
mysql=5.6
mysql_inst=mysql
mysql_backup=yes
mysql_backup_gzip=no
mysql_backup_dir=/usr/local/directadmin/custombuild/mysql_backups
mysql_force_compile=no

#WEB Server Settings
webserver=nginx
litespeed_serialno=trial
modsecurity=no
modsecurity_ruleset=comodo
apache_ver=2.4
apache_mpm=auto
mod_ruid2=no
userdir_access=yes
harden_symlinks_patch=yes
use_hostname_for_alias=no
redirect_host=host1.pearlwebhost.com
redirect_host_https=no

#WEB Applications Settings
phpmyadmin=yes
phpmyadmin_ver=4
squirrelmail=no
roundcube=no
webapps_inbox_prefix=no

#ClamAV-related Settings
clamav=no
clamav_exim=yes
modsecurity_uploadscan=no
proftpd_uploadscan=no
pureftpd_uploadscan=no
suhosin_php_uploadscan=no

#Mail Settings
exim=yes
eximconf=no
eximconf_release=4.4
blockcracking=no
easy_spam_fighter=no
spamassassin=no
sa_update=daily
dovecot=yes
dovecot_conf=yes
pigeonhole=no

#FTP Settings
ftpd=proftpd

#Statistics Settings
awstats=no
webalizer=no

#CustomBuild Settings
custombuild=2.0
autover=no
bold=yes
clean=yes
cleanapache=yes
clean_old_tarballs=yes
clean_old_webapps=yes
downloadserver=files18.directadmin.com

#Cronjob Settings
cron=no
cron_frequency=weekly
[email protected]
notifications=yes
da_autoupdate=no
updates=no
webapps_updates=yes

#CloudLinux Settings
cloudlinux=no
cloudlinux_beta=no
cagefs=no

#Advanced Settings
autoconf=yes
automake=yes
libtool=yes
curl=yes
new_pcre=no

Still when I start install ./setup.sh It removes my MYSQL installed with so much hard work and installs MariaDB.

Why cant i have a clean install working with customBuild....?

Why this post is not correct

There are a few hidden trick you can use.

If you plan on using custombuild, you can create the file:
/usr/local/directadmin/custombuild/options.conf

before calling the setup.sh.
http://forum.directadmin.com/showthread.php?t=39339&p=197041#post197041


See the custom build going for MariaDB ignoring my options.conf

Code:
mysql_inst=mysql is set in the options.conf, but MariaDB is currently installed
If you wish to use MySQL, please remove MariaDB and install MySQL before setting CustomBuild to manage it.
*******************************************
*******************************************

Cannot find /usr/local/bin/php
Please recompile php with custombuild, eg:
cd /usr/local/directadmin/custombuild
./build all d

Please help. I am very frustrated.
 
Last edited:
MariaDB 5.5 is a drop-in replacement for MySQL. You can simply go back to MySQL 5.5 after installation of DirectAdmin :) It's as simple as:
Code:
cd /usr/local/directadmin/custombuild
./build set mysql_inst mysql
./build set mysql 5.5
rm -f /usr/bin/mysql
./build mysql
 
MariaDB 5.5 is a drop-in replacement for MySQL. You can simply go back to MySQL 5.5 after installation of DirectAdmin :) It's as simple as:
Code:
cd /usr/local/directadmin/custombuild
./build set mysql_inst mysql
./build set mysql 5.5
rm -f /usr/bin/mysql
./build mysql

How about if I want to go with MySQL 5.6
 
Just use './build set mysql 5.6' instead of './build set mysql 5.5' then :)
 
Just use './build set mysql 5.6' instead of './build set mysql 5.5' then :)

Already tried it.
My options.conf clearly says I need MySQL.

Code:
#MySQL Settings
mysql=5.6
mysql_inst=mysql
mysql_backup=yes
mysql_backup_gzip=no
mysql_backup_dir=/usr/local/directadmin/custombuild/mysql_backups
mysql_force_compile=no

See this image: where it installs MariaDB: https://ibb.co/ikhLKv

Still it installs MariaDB and then later in the installation it halts at error

Code:
mysql_inst=mysql is set in the options.conf, but MariaDB is currently installed
If you wish to use MySQL, please remove MariaDB and install MySQL before setting CustomBuild to manage it.
*******************************************


There is clearly a BUG in installer.
 
/usr/local/mysql indicates that it's not CentOS, or DA license used is not set to be CentOS :) "rm -f /usr/bin/mysql" part is for CentOS. For debian it's "rm -f /usr/local/mysql/bin/mysql" instead of it. You should execute it before "./build mysql", otherwise CustomBuild will not allow you to switch to MySQL.
 
MariaDB 5.5 is a drop-in replacement for MySQL. You can simply go back to MySQL 5.5 after installation of DirectAdmin :) It's as simple as:

Code:
cd /usr/local/directadmin/custombuild
./build set mysql_inst mysql
./build set mysql 5.5
rm -f /usr/bin/mysql
./build mysql


Even this does not work. You should really test your CentOS installer in both cases. I have today pointed out two issues, either install MySQL first and then run ./setup.sh or either just let the MariaDB installed and then change to MySQL.

In both cases it does not work and there is a bug here (IMHO).

Code:
A MySQL server package (MariaDB-server-5.5.57-1.el7.centos.x86_64) is installed.

The current MySQL server package is provided by a different
vendor (Monty Program AB) than MySQL AB, Sun Microsystems, Inc., or Oracle and/or its affiliates.
Some files may be installed to different locations, including log
files and the service startup script in /etc/init.d/.

Upgrading directly from MySQL 5.5 to MySQL 5.6 may not
be safe in all cases.  A manual dump and restore using mysqldump is
recommended.  It is important to review the MySQL manual's Upgrading
section for version-specific incompatibilities.

A manual upgrade is required.

- Ensure that you have a complete, working backup of your data and my.cnf
  files
- Shut down the MySQL server cleanly
- Remove the existing MySQL packages.  Usually this command will
  list the packages you should remove:
  rpm -qa | grep -i '^mysql-'

  You may choose to use 'rpm --nodeps -ev <package-name>' to remove
  the package which contains the mysqlclient shared library.  The
  library will be reinstalled by the MySQL-shared-compat package.
- Install the new MySQL packages supplied by Oracle and/or its affiliates
- Ensure that the MySQL server is started
- Run the 'mysql_upgrade' program

This is a brief description of the upgrade process.  Important details
can be found in the MySQL manual, in the Upgrading section.
******************************************************************
error: %pre(MySQL-server-5.6.36-1.linux_glibc2.5.x86_64) scriptlet failed, exit status 1
error: MySQL-server-5.6.36-1.linux_glibc2.5.x86_64: install failed
   2:MySQL-devel-5.6.36-1.linux_glibc2################################# [ 50%]
   3:MySQL-client-5.6.36-1.linux_glibc################################# [ 75%]
Ensuring local-infile is disabled for security reasons in MySQL configuration file...
Giving mysqld a few seconds to start up...
This installation of MySQL is already upgraded to 5.5.57-MariaDB, use --force if you still need to run mysql_upgrade
cp: '/usr/lib/libmysqlclient.so' and '/usr/lib/mysql/libmysqlclient.so' are the same file
Restarting MySQL.
[root@host1 custombuild]#
 
You are correct, it is impossible to install DirectAdmin on CentOS 7 with mySQL. You first have to install MariaDB and after DirectAdmin installation convert it back to mySQL.

I had this communication with DirectAdmin Support a couple of months ago:

Me:
Code:
Dear,
 
OS: CentOS 7.
 
Custombuild options.conf:
#Possible values - 5.1, 5.5, 5.6
mysql=5.6
mariadb=10.1
mysql_inst=mysql
mysql_backup=yes
mysql_backup_dir=/usr/local/directadmin/custombuild/mysql_backups
mysql_force_compile=no
 
Commands:
cd /root
mkdir mysql
cd mysql
wget http://files.directadmin.com/services/all/mysql/64-bit/5.6.36/MySQL-client-5.6.36-1.linux_glibc2.5.x86_64.rpm
wget http://files.directadmin.com/services/all/mysql/64-bit/5.6.36/MySQL-devel-5.6.36-1.linux_glibc2.5.x86_64.rpm
wget http://files.directadmin.com/services/all/mysql/64-bit/5.6.36/MySQL-server-5.6.36-1.linux_glibc2.5.x86_64.rpm
wget http://files.directadmin.com/services/all/mysql/64-bit/5.6.36/MySQL-shared-5.6.36-1.linux_glibc2.5.x86_64.rpm
rpm -e `rpm -qa | grep MariaDB`
rpm -Uvh MySQL*.rpm
 
Then mySQL is installed. When i now start the DirectAdmin installation the setup.exe installs MariaDB 5.5 and then the DirectAdmin installation fails with:
 
mysql_inst=mysql is set in the options.conf, but MariaDB is currently installed
If you wish to use MySQL, please remove MariaDB and install MySQL before setting CustomBuild to manage it.
 
If setup.sh always installs MariaDB 5.5 then removing it before the installation does not make sense.

DA support:
Code:
Conversion still requires manual intervention.. there are many cases which cannot be done, so we don't automate it.

Looking at the mysql.sh installer, if I'm correct, you can pre-download the service.tar.gz, and delete the MaraiDB rpms from:
/usr/local/directadmin/scripts/pacakges/MariaDB*
and place the 4 MySQL rpms there instead.
The mysql.sh will install whichever is there.
If both are present, MariaDB is installed.
So to install MySQL right off the bat, download and extract the services.tar.gz, so that it's not re-downloaded.
wget -O /usr/local/directadmin/scripts/packages/services.tar.gz http://files.directadmin.com/services/services_es70_64.tar.gz
wget -O /usr/local/directadmin/scripts/packages/services.tar.gz.md5 http://files.directadmin.com/services/services_es70_64.tar.gz.md5

Delete the MariaDB rpms from services/packages/* 
Download the MySQL rpms to the scripts/pacakges/ folder:
http://files.directadmin.com/services/all/mysql/5.6.36/
then run the setup.sh normally.
Let me know if that doesn't work.
Thank you,

Me:
Code:
I installed the server with MariaDB and then replaces MariaDB to mySQL.

Your post “MariaDB 5.5 -> MySQL 5.5 -> MySQL 5.6” in https://forum.directadmin.com/showthread.php?t=50797 does help a bit, I used the following commands (didn’t retest it but according to history this was it).
This is on CentOS 7, on 6 it could be a bit different.

cd /usr/local/directadmin/custombuild
mkdir -p mysql
cd mysql
wget http://files.directadmin.com/services/all/mysql/64-bit/5.5.53/MySQL-client-5.5.53-1.linux2.6.x86_64.rpm
wget http://files.directadmin.com/services/all/mysql/64-bit/5.5.53/MySQL-devel-5.5.53-1.linux2.6.x86_64.rpm
wget http://files.directadmin.com/services/all/mysql/64-bit/5.5.53/MySQL-server-5.5.53-1.linux2.6.x86_64.rpm
wget http://files.directadmin.com/services/all/mysql/64-bit/5.5.53/MySQL-shared-5.5.53-1.linux2.6.x86_64.rpm
yum remove net-snmp
rpm -e --noscripts `rpm -qa | grep MariaDB`
rm -f /etc/systemd/system/mysqld.service
rm -f /var/lib/mysql/*.pid
./build set mysql 5.6
./build set mysql_inst yes
./build mysql
<here I added --skip-grant-tables to the file “ExecStart=/usr/bin/mysqld_safe --basedir=/usr” in file /etc/systemd/system/mysqld.service>
systemctl daemon-reload
service mysqld restart

If MySQL does not start up or got errors during startup it could be related to some MySQL tables that are different. I removed all innodb files and used innodb_force_recovery = 4 to rebuild the innodb database.
Next time I tell the customer he gets MariaDB if he wants MySQL .
 
You can simply go back to MySQL 5.5 after installation of DirectAdmin
Yes but that is extra work/time. Can't it be made a choice option, just like you can choose which php option you want or something like that?
Makes life a bit easier during installation.
 
I am a bit confused, MariaDB is officially the default replacement for CentOS 7, it means that CentOS 7 does not have packages in their repository for MySQL, they have been replaced to use MariaDB (which I have to say works great!).

I don't understand the panic here, DA is following the standard of the OS which guarantee better compatibility for example (and probably more help online since everyone with CentOS 7 would possibly use MariaDB in most of the case).

I have to admit that I wasn't sure about switch from MySQL to MariaDB, but I have to say that it went smoothly (because basically it is a fork made from the creator of MySQL after that Oracle acquired it) and it is actually faster.

My personal opinion would be move to MariaDB, it works as a MySQL Server which means absolutely no changes are required on your websites and on any configuration.

Then, if you really want to use MySQL, you need to manually go for it (as it is for a normal CentOS 7 OS), it is not a bug in DA or in it's setup, it is part of the basic installation, the one that guarantee that everything it is installed correctly and works immediatly.

Anyway, up to you :)

Best regards
 
Hmmz... wel it's not real panic. But the I'm confused about the fact that there are 2 MariaDB versions, which is odd. Mysql is just Mysql, not version 5 and 10 like MariaDB. Which version is to be used best? This is confusing.

Next to that, it's right away MariaDB only in Centos 7. I understand that this is the default of Centos 7 and it's not a DA bug. But you can also choose between different apache versions in CB. There is a choice option there too. And CB also uses RPM's and not always yum.
Maybe it's just the thought that MySQL is more stable and mysql repair commands can just be used. Not sure if that can be done with MariaDB too.
MariaDB does not support InnoDB, so what to do if you are using that now? It's all confusing not panic.
A lot of us got these lines in the my.cnf:
Code:
innodb_file_format=Barracuda
innodb_file_per_table=1
innodb_max_dirty_pages_pct = 0
So I presume this needs to be change before going over, since MariaDB does not support Innodb.

And if I'm not mistaken, when you go to Centos 7, you first have to convert to MariaDB on your current server, before transferring the accounts, because a Centos 7 install would be using MariaDB and I presume you can't just (for example) import MySQL 5.5 databases in some MariaDB 10.x version without converting them before. I've read mysql 5.x is compatible with MariaDB 5.x but why then the MariaDB 10.x version or which version is it?

So no panic, just confused and a bit worried because it's mostly live servers with paying customers.
 
MariaDB 5.x was made to strictly follow MySQL. They moved to versioning 10.x because they stopped following MySQL at some point and they continued in their own road (which is MUCH BETTER imho). That does not mean that they made some huge difference - not at all. Differences between 5.5 and 10.0 are not very major - they changed default values of some variables, they cleaned up some deprecated code, they tweaked some things to run faster, etc. Higher versions of MariaDB are almost fully compatible with older versions, which means that they continue to be compatible with MySQL 5.5 too. There are new features in MariaDB that MySQL won't have and slowly there are new features (in MySQL 5.7 - see at the bottom of this post) which won't be ported to MariaDB. But in their core - they will continue to work similarly. For most (if not all) CMS-es and commercial php/mysql software available, MariaDB 10.x will work just fine as a replacement of MySQL. And yeah, many open source products are favoring MariaDB now. I personally think that MariaDB is the future, not MySQL.

Which version should be used best? There is a simple answer: the newest one. Go for MariaDB 10.2 and you won't miss anything from the lower versions, unless you have some veeeery specific product which used some veeeery specific feature which is now outdated. I highly doubt the last one. The general sites like wordpress/joomla/drupal/phpbb/etc will work just fine under MySQL 5.5/MariaDB 5.5/Maria DB 10.2/ etc. They won't feel a difference other than some extra speed with newer versions. That's all.

XtraDB was a replacement of InnoDB in 10.1 and older versions. It was fully compatible with InnoDB so there was nothing to worry about using it (and it WAS a bit faster). Still InnoDB was available as a plugin which you can include easily. About the my.cnf - even if you are using XtraDB, your innodb_* variables will work and have the same effects over the XtraDB engine as they had over InnoDB. The my.cnf files from MySQL will work directly on MariaDB with no problems.

With MariaDB 10.2+ InnoDB is the default storage engine and XtraDB was removed (still available as a plugin but it is missing the latest InnoDB features). MariaDB will most probably continue to work with InnoDB from now on.

You can import MySQL 5.5 and older databases to MariaDB (any version) with no problems. I recently restored a backup made by DA like 5 and a half years ago when I was using MySQL (not sure which version) and it restored the database to MariaDB 10.2 fluently.

P.S. Here is a list of the unsupported features from MySQL 5.7 when upgrading to MariaDB 10.2. It's the JSON data type for example (which is not supported in MariaDB). Note that these are 5.7 features - older MySQL versions are fully compatible and can be converted with no problems.

https://mariadb.com/kb/en/mariadb/upgrading-from-mysql-57-to-mariadb-102/
 
Hi Richard,

Well, I was going to reply that everything goes smoothly without need to upgrade first and import after, but I guess that wattie's post was more than complete about everything :)

So, as I said, I would highly recommend the change to MariaDB.

Also, for my clustering project I have to say that use MariaDB with Galera Cluster it's extremely easy, way more easy than the master-master/slave replication that was required in MySQL, is literally about 10 lines in the my.cnf file and it work perfectly, specially for a DB Cluster plan :)

Best regards
 
I changed over to MariaDB 10.1 last week and was expecting major downtime and a long night ahead of me getting it running at all, or even facing having to restore an entire server snapshot again.

But to my surprise it was none of that.
Changed options.conf, did rebuilt and was done in just a couple of minutes.
 
You can import MySQL 5.5 and older databases to MariaDB (any version) with no problems. I recently restored a backup made by DA like 5 and a half years ago when I was using MySQL (not sure which version) and it restored the database to MariaDB 10.2 fluently.
That takes away one of my major considerations.

@Wattie, @Sellerone, @BBM: Thank you for your contributions and explanations. It took away a great deal of worries.
I did not even know that Mysql 5.5 could be converted to MariaDB 10.2.

I will create another topic, I don't want to be off-topic or stealing more of Kaon's topic space.
 
Back
Top