How to install mariadb from source along VestaCP

i want to know how can i install MariaDB from source along VestaCP ?

am running debian 8 jessie

Supporter Asked on March 22, 2016 in Software.
Add Comment
1 Answer(s)
Best answer

complicated question , process is long you can copy paste commands and can read comments with commands

first lets install nano because we will need to edit files

 apt-get update && apt-get install nano

next edit source list

 nano /etc/apt/sources.list

add to source list

deb-src jessie main contrib non-free
deb-src jessie main contrib non-free

next we will install curl to install vestacp

 apt-get update && apt-get install curl && apt-get install zip

now lets install vestacp

 mkdir temp
 cd temp
 curl -O

Now change enter your hostname and your mail address and password in below command before running it in terminal

 bash --nginx yes --apache yes --phpfpm no --vsftpd no --proftpd yes --exim yes --dovecot yes --spamassassin no --clamav no --named yes --iptables yes --fail2ban yes --mysql yes --postgresql no --remi yes --quota no --hostname your_host_name_here --email --password your_password_here

VestaCP Installation is completed now time to install Mariadb from source

first we need to install some environment build tools

 sudo apt-get build-dep mysql-server
 sudo apt-get build-dep mysql-server # for Debian and Ubuntu-based distributions
 sudo yum-builddep mysql # for Fedora 17-18 (part of the yum-utils package)
 sudo yum-builddep mariadb # for Fedora 19+ (part of the yum-utils package)
 sudo zypper si -d mysql-community-server # for OpenSUSE

make sure you in temp directory we created it start , now get latest version of mariadb source from github

 cd server-mariadb-10.1.12

now you have to run these massive list of commands

 make && make install
 cd /usr/local/mysql
 ln -s lib lib64
 groupadd mysql
 useradd -r -g mysql mysql
 cd /usr/local/mysql
 chown -R mysql.mysql .
 scripts/mysql_install_db --user=mysql
 chown -R root .
 chown -R mysql data
 mkdir -p /usr/local/mysql/InnoDB/{redoLogs,undoLogs,ib_data}
 chgrp -R mysql /usr/local/mysql
 chown -R mysql /usr/local/mysql/data
 mkdir /usr/local/mysql/logs /usr/local/mysql/tmp
 chown mysql:mysql /usr/local/mysql/{tmp,logs}
 chown -R mysql:mysql /usr/local/mysql/data
 cd /usr/local/mysql/support-files
 cp mysql.server /etc/init.d/mysqld
 update-rc.d mysqld defaults
 echo "/usr/local/mysql/lib" > /etc/

// for 64 bit

 [root@yongbok ~]# cd /usr/local/mysql
 [root@yongbok ~]# ln -s lib lib64

add to system paths

 ln -s /usr/local/mysql/bin/mysql /usr/local/bin/mysql
 ln -s /usr/local/mysql/bin/mysqladmin /usr/local/bin/mysqladmin
 ln -s /usr/local/mysql/bin/mysqldump /usr/local/bin/mysqldump

finally start mariadb demon

 /etc/init.d/mysqld start

change root password
 mysqladmin -u root password 'your new passwrd'

Now let’s secure the server setting the password for root and deleting the test db


> cd /usr/local/mysql/bin
> ./mysql -u root -p
Maria DB> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpwd');
Maria DB> SET PASSWORD FOR 'root'@'' = PASSWORD('newpwd');
Maria DB> SET PASSWORD FOR 'root'@'host_name' = PASSWORD('newpwd');
Maria DB> DELETE FROM user WHERE Password = '';


and finally update new mariadb root password in vestacp by editing

restart apache and mariadb demon
 service apache2 restart
 service mysql restart

 /etc/init.d/apache2 restart
 /etc/init.d/mysql restart
Supporter Answered on March 22, 2016.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.