当前位置:网站首页>MySQL5.7.21 Build For ARM
MySQL5.7.21 Build For ARM
2022-06-12 04:56:00 【hi_ LeTian】
If you are familiar with CMake Words , The compilation process is basically simple ! No big mistake , Here are some basic records !
One 、 Basic environment
Reference address
http://dp.nonoo.hu/cross-compiling-mysql/
http://blog.csdn.net/catemo/article/details/53136343
MYSQL edition
mysql-5.7.21-linux-glibc2.12-i686
Target system board
Hi3536
Compile toolchain
arm-hisiv400-linux
Compile environment
Ubuntu16.4 64bit Desktop
Two 、 Other software packages required
boost1.59.0 :(Mysql5.7.21 The prompt must be this version ), Host installation , In the download Mysql Found a containing boost Source code package of header file , If you download that , There should be no need to install boost1.59 Library. .
git: Host installation
Cmake3.5.1: Host installation
Ncurses: Cross compilation
3、 ... and 、 compile Mysql5.7.21
notes : If you are familiar with CMake Tools , Compilation will generally go smoothly , There are some small problems , It's also very easy to solve .
Unzip the installation package :
tar -zxf mysql-5.7.21.tar.gz
In the root directory of the package, there is a BUILD Catalog , Here are some pre-set compilation scripts . Compiling Mysql In the process , It will generate some PC Tools at the end , And with these PC Tools do some work , So compiling ARM The version on the board , First compile a complete PC The version on , Compiling ARM Version PC Version of the tool to execute .
compile PC edition
cd mysql-5.7.21/BUILD Directory , Use compile-pentium64 Script execution compilation ( Because mine is 64bit Of ubuntu edition , If your is 32bit I'll use it compile-pentium Script )
./compile-pentium64
install PC Version to a directory , The latter can be used to connect or compare ARM Test version .
./make install DESTDIR=/home/ubuntu/mysql5.7.21_pc
After compilation , This BUILD Catalog , Don't go clean Or delete , Now compile ARM The version also needs .
compile ARM edition
First, in the mysql In the root directory of the code, we create a BUILD_ARM The compiled directory of .
mkdir mysql-5.7.21/BUILD_ARM
cd mysql-5.7.21/BUILD_ARM
stay BUILD_ARM Create a compiled script in compile-arm:
The content is simple
cmake $path/.. -DWITH_DEBUG=0 -DSTACK_DIRECTION=1 -DENABLE_DOWNLOADS=1
that will do
modify mysql-5.7.21/CMakeLists.txt
Add the following configuration at the beginning of the header :
#=================for hi3536================================
SET(CMAKE_C_COMPILER "arm-hisiv400-linux-gcc")
SET(CMAKE_CXX_COMPILER "arm-hisiv400-linux-g++")
SET(CMAKE_SYSTEM_NAME "Linux")
SET(CMAKE_SYSTEM_PROCESSOR "arm")
SET(CMAKE_SYSTEM_VERSION 1)
SET(CMAKE_CROSSCOMPILING 1)
SET(CMAKE_C_FLAGS_DEBUG "-mcpu=cortex-a7 -mfloat-abi=softfp -mfpu=neon-vfpv4 -mno-unaligned-access -fno-aggressive-loop-optimizations")
SET(CMAKE_CXX_FLAGS_DEBUG "-mcpu=cortex-a7 -mfloat-abi=softfp -mfpu=neon-vfpv4 -mno-unaligned-access -fno-aggressive-loop-optimizations")
SET(CMAKE_LIBRARY_PATH "/home/ubuntu/build/hi3536/lib")
LINK_DIRECTORIES("/home/ubuntu/build/hi3536/lib")INCLUDE_DIRECTORIES("/home/ubuntu/build/hi3536/include")
#INCLUDE_DIRECTORIES("/home/ubuntu/build/hi3536/include/ncurses")
# necessary , Otherwise, you will be prompted at compile time that you cannot find boost The library of
SET(BOOST_INCLUDE_DIR "/usr/local/include")
SET(BOOST_LIBRARY_DIR "/usr/local/lib")
SET(LOCAL_BOOST_DIR "/usr/local/boost")
SET(CMAKE_FIND_ROOT_PATH "/opt/hisi-linux/x86-arm/arm-hisiv400-linux")
#2 Never find a tool program in a specified directory
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
#3 Only find the library files in the specified directory
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER)
#4 Only find the header file in the specified directory
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER)
SET(STACK_DIRECTION 1)
# necessary , Otherwise, there will be some related macro control definition error prompts during the compilation process
SET(WITH_UNIT_TESTS OFF)
SET(WITH_EMBEDDED_SERVER FALSE)
SET(DEFAULT_CHARSET utf8)
SET(DEFAULT_COLLATION utf8_general_ci)
SET(HAVE_LLVM_LIBCPP OFF)
#======================end for hi3536=======================================
notes : CMAKE_C_FLAGS_DEBUG and CMAKE_CXX_FLAGS_DEBUG These two values are only based on arm-hisiv400-linux Configured !
HAVE_LLVM_LIBCPP OFF This needs to be closed , Otherwise, code errors will be reported during compilation !
compile
Switch to mysql-5.7.21/BUILD_ARM, perform ./compile-arm
Again make
There are errors in the compilation process , If it is PC The tool on does not execute , Or can't find it , Just follow the prompts to the front PC Find out if there is a corresponding tool in the version , Copy to BUILD_ARM The corresponding directory in the !
At compile time , Encounter tips osOatomic.ic/osOatomic.h There are errors in these two files , Please refer to the solutions in the reference website mentioned above !
install
After compilation , Install to a directory
make install DESTDIR=/home/ubuntu/mysql5.7.21_arm
Four 、 To configure ARM Version Services
Copy /home/ubuntu/mysql5.7.21_arm/usr/local/mysql To target board
NFS Mount or whatever is OK !
To configure MYSQL: my.conf
As my configuration (mysql And data in one SSD On hard disk ):
/mnt/a/mysql # cat /etc/my.cnf
[mysql]
default-character-set=utf8
[mysqld]
port = 3306
basedir=/mnt/a/mysql
datadir=/mnt/a/mysql/data
max_connections=20
character-set-server=utf8
default-storage-engine=INNODB
skip-name-resolve
Initialize database directory
If in mysql Under the table of contents :
./bin/mysqld --initialize-insecure --user=root
This step will generate mysql A temporary password for , Pay attention to the print , Record , In use mysql When the connection , Use it to connect your server .
Execution services
If in mysql Under the table of contents :
./bin/mysql -uroot
Here for simplicity and direct use root The user runs the service , For the sake of safety , We should create a mysql Users to operate .
5、 ... and 、 It's over
These are basically the processes , About configuration MYSQL The problem of , You can baidu , Such as :
Set up root password
mysql> use mysql;
Database changed
mysql> update user set authentication_string=password("123456") where User="root";
Query OK, 1 row affected, 1 warning (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 1
mysql>
mysql>FLUSH PRIVILEGES;
or :
Set password=password(“123456”);
Remote connection
mysql>use mysql;
mysql>update user set host ='%'where user ='root' and host ='localhost';
mysql>flush privileges;
skip DNS analysis
my.conf Add
skip-name-resolve
Generally, if there is no setting on the board /etc/host.conf, or hostname No settings !
6、 ... and 、 Add a basic test data
300W Single table data test
The test is mainly compared to the one that exists 300W Row data table Select,Update,Insert Time consuming for query , With or without an index , The difference is very big .
PC Configuration is working i7-6700 The test of , It's a mechanical hard disk ,8G Memory , It's driving Ubuntu16.04 Tested under the virtual machine , It can only be used for a basic comparison !
MYSQL5.7.21 edition
ARM Test environment :
CPU:Hi3536
RAM:1024MB
Hard disk : SSD 16GB
PC Test environment :
CPU:i7
ARM:8G
Hard disk : Mechanical drive
ARM Without running any other business on the ,PC There are other tools on the machine , service , Virtual machines, etc .
UPDATE:
-2018/03/29
Recompiled once ,boost Not just header files , When generating tools , Also used its library , therefore boost It's better to compile it into ARM Version of , to mysql link :
boost arm The compilation method is shown in :
http://www.boost.org/build/doc/html/bbv2/tasks/crosscompile.html
Such as :
set project-config.jamusing gcc : arm : arm-none-linux-gnueabi-g++ ;
./b2 toolset=gcc-arm
边栏推荐
- February 19, 2022 [Nolan] Nolan resurrected? Change · Nolan [soul orchid] can be connected to XDD / silly girl
- Data processing and data set preparation
- Labor
- Betteland introduces milk products of non animal origin, which will be launched in the U.S. market in the near future
- Map coordinate conversion of Baidu map API
- QT compile 45 graphic report of security video monitoring system
- Simple Tetris
- [GIS tutorial] land use transfer matrix
- JS disable mobile sharing
- JS to determine whether the tags of multiple classes are empty
猜你喜欢

Longest palindrome string

Accumulated temperature spatial distribution data, temperature distribution data, sunshine data, rainfall distribution, solar radiation data, surface runoff data, land use data, NPP data, NDVI data
![[GIS tutorial] ArcGIS for sunshine analysis (with exercise data download)](/img/60/baebffb2024ddf5f2cb070f222b257.jpg)
[GIS tutorial] ArcGIS for sunshine analysis (with exercise data download)

2022 low voltage electrician test questions and simulation test

JWT學習與使用

@What happens if bean and @component are used on the same class?

JWT学习与使用

Enhanced vegetation index evi, NDVI data, NPP data, GPP data, land use data, vegetation type data, rainfall data

Install pycharm under Kali and create a shortcut access

In the era of smart retail, Weimeng reshapes the value of "shopping guide"
随机推荐
Font conversion optimization
Layer sublayer assigns values to the page elements of the parent layer to achieve the effect of transferring values to the page of the parent layer
Parallelization of accelerated training tf data. Dataset generator
LabVIEW關於TDMS和Binary存儲速度
Interview must ask: summary of ten classic sorting algorithms
one billion one hundred and eleven million one hundred and eleven thousand one hundred and eleven
Pytorch was reported by a large number of netizens that torchrec, a new library, was "born" and has a large scale
Unable to resolve dependency tree
kali下安装pycharm并创建快捷访问
Some problems of silly girl solved
Longest palindrome string
JS function and variable have the same name (function and variable parsing rules)
2022-02-28 WPF upper computer 126 understand mqtt
Token based authentication
Musk promotes the development of fascinating new products partners remind important questions
kali_ Nat mode, bridging Internet / host only_ detailed
SQL injection upload one sentence Trojan horse (turn)
How to count the total length of roads in the region and draw data histogram
JS to determine whether the tags of multiple classes are empty
22-2-28 there are many things to do at work today, ETH analysis