Even though your question asks about how to compile 5.7 for Centos on an arm processor I was able to get it running on a Ubuntu 20.04 and the steps should be really similar. Be prepared for this to be a bit of a pain, but it can be done. I think that for centos the only difference will be that you might need different libraries, but as you try to compile mysql it will yell at you and tell you which ones you need.
Just as a heads up, my biggest beef with the installation steps and the post installation steps is that they seem very incomplete. They say that youâll need to install packages depending on your system, but it would be very nice to have a list at the start. Also, I thought the post installation steps were lacking, and missed a whole ton. I had to create a mysql user, group, change data ownership, create the conf file, run mysql in safe mode to create the sock file, kill mysql safe mode, then make sure iâm the mysql user since you canât run it as root. Then start it, and run the secure installation, and then, then I could finally login.
Anyway, hereâs the results of my bash file to setup mysql 5.7, compiled from the git source tree, and then installed on an ubuntu 20.04 instance in aws. This was run on a âr6g.xlargeâ instance. You could get by with a r6g.large, but I wouldnât go any lower since the make steps can take a ton of time.
Just follow these steps, but change apt install to yum install, and this runs you to the end of installing mysql, but Iâve commented out those two steps since we do the rest in ansible. Just uncomment those lines and mysql will likely install for you.
#!/bin/bash -xe
#Note: Make sure you have a beefy enough instance. Otherwise it can take a long time. I used a r6g.xlarge to compile this.
echo "Building Percona Server 5.7 From Source..."
sudo apt update
sudo apt install cmake libssl-dev libncurses5-dev libreadline-dev bison libaio-dev build-essential libcurl4-openssl-dev pkg-config
cd /usr/local
git clone https://github.com/percona/percona-server.git
mv percona-server mysql
cd mysql
git checkout 5.7
git submodule init
git submodule update
wget "https://sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz"
tar -zxvf boost_1_59_0.tar.gz -C /usr/local/
cmake . -DENABLE_DOWNLOADS=1 -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/usr/local/boost_1_59_0
make dist
cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_CONFIG=mysql_release -DFEATURE_SET=community -DWITH_EMBEDDED_SERVER=OFF
# Create a tar file here that we can use to run the rest of the make and make install steps in Ansible.
tar czvpf percona-server-5.7.35-38-compiled-full.tar.gz /usr/local/mysql
echo "Finished compressing the compiled build"
#Then you can either take the compiled tgz file, and then send that to ansible for it to untar and then install.
#Or at this point you could just run "make" and then "make install" from within the "/usr/local/mysql" dir and it would install mysql.
#To transfer it, you could run a command like this from your local laptop:
# rsync -avprP -e ssh ubuntu@10.200.110.130:/usr/local/mysql/percona-server-5.7.35-38.tar.gz ~
#### To install it locally after running the cmake step with the "-DBUILD_CONFIG=mysql_release" flag then you can run the rest of these commands.
#### Note, the next "make" command ran for over an hour for me.
#make
#make install
#and then run all these commands:
# useradd mysql
# sudo usermod -a -G mysql mysql
# sudo usermod -s /bin/bash mysql
# chown -R mysql:mysql /usr/local/mysql/data
# chown -R mysql:mysql error.log/
# cat > /usr/local/mysql/my.cnf << EOL
# [mysqld]
# server-id=10
# port = 3306
# datadir=/usr/local/mysql/data
# log_error = /var/log/mysql_error.log
# EOL
# #create the sock file through running safe mode.
# bin/mysqld_safe --skip-grant-tables&
# might have to find the mysql process and kill it once the sock file was created
# ps -ef | grep mysql
# get the pid and kill it wil "kill -9 myprocessid"
# sudo su mysql
# #then start mysql with this command
# /usr/local/mysql/bin/mysqld
# mysql_secure_installation
## enter new password here.
# mysql -uroot -p