The whole process of installing mysql5.7.22 under ARM64 architecture

The whole process of installing mysql5.7.22 under ARM64 architecture

MySQL download address:

https://obs.cn-north-4.myhuaweicloud.com/obs-mirror-ftp4/database/mysql-5.7.27-aarch64.tar.gz

1. Add mysql user group and mysql user to isolate mysql process
# groupadd -r mysql && useradd -r -g mysql -s /sbin/nologin -M mysql
2. Install dependent libraries
# yum install -y libaio*
3. Download and decompress MySQL
# wgethttps://obs.cn-north-4.myhuaweicloud.com/obs-mirror-ftp4/database/mysql-5.7.27-aarch64.tar.gz
# tar xzvf mysql-5.7.27-aarch64.tar.gz -C /usr/local/
4. Configure Mysql
# mv /usr/local/mysql-5.7.27-aarch64 /usr/local/mysql
# mkdir -p /usr/local/mysql/logs
# chown -R mysql:mysql /usr/local/mysql
# ln -sf /usr/local/mysql/my.cnf /etc/my.cnf
# cp -rf /usr/local/mysql/extra/lib* /usr/lib64/
# mv /usr/lib64/libstdc++.so.6 /usr/lib64/libstdc++.so.6.old
# ln -s /usr/lib64/libstdc++.so.6.0.24 /usr/lib64/libstdc++.so.6

# Set the boot
# cp -rf /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
# chmod +x /etc/init.d/mysqld
# systemctl enable mysqld
5. Add environment variables
# vim /etc/profile

Add the following two lines of code:
export MYSQL_HOME=/usr/local/mysql
export PATH=$PATH:$MYSQL_HOME/bin

# source /etc/profile

5. Initialize and start mysql
# Initialize login without password
# mysqld --initialize-insecure --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data

! ! ! An error occurred while executing here:

Solution:

vim /etc/my.cnf
View the file and look for datadir=...
Check: datadir=/usr/local/mysql/data, 
This is the data storage directory.
After entering /usr/local/mysql/data, I found that there is indeed data:
Back up /usr/local/mysql/data,
cd /usr/local/mysql
mv data data.bak
Then execute:
mysqld --initialize-insecure --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data

#Open mysql

# systemctl start mysqld

#Check the status
# systemctl status mysqld

This indicates that mysql has been installed successfully.

Because the initial password of MySQL will go wrong if there is any mistake in installing it, and this situation has occurred before when installing on Win10, so here we first set it up without password review.

Find my.ini in the mysql installation path (usually in /etc/my.ini on Linux systems)
vim opens:
Under the [mysqld] line:
Add skip-grant-tables to skip password verification! ! ! The file name in my environment is: my.cnf

Use: mysql -u root to log in

! ! ! After restarting the development board, an error occurred:

# mysql -u root
-bash: mysql: command not found

Reason: This is because the system will search for commands in /usr/bin by default. If the command is not in this directory, of course it will not be found. What we need to do is map a link to the /usr/bin directory, which is equivalent to creating a link file.
First, you need to know the full path of the mysql command or mysqladmin command. For example, the path of mysql is: /usr/local/mysql/bin/mysql. We can execute the command like this:

# ln -s /usr/local/mysql/bin/mysql /usr/bin

! ! ! Prompt an error

The reason is the missing libncurses.so.5 shared library.

Solution:

I am using the EAIDK-610 development board, and I found that the system has the libncurses.so.6.1 file in the /lib64 folder of the board.
So use a soft link to create a link from libncurses.so.6.1 pointing to libncurses.so.5, and this shared library can be backward compatible.
Please refer to the following picture examples for details.

Use mysql -u root to log in again. The login is successful.

This is the end of this article about the whole process of installing mysql5.7.22 under ARM64 architecture. For more relevant content about installing mysql5.7.22 on ARM64, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • iOS Assembly Tutorial - ARM64 Assembly Basics Tutorial
  • MySQL 5.7.22 binary package installation and installation-free version Windows configuration method
  • Ubuntu16.04 installation mysql5.7.22 graphic tutorial
  • How to install MySQL server community version MySQL 5.7.22 winx64 in win10
  • Installation process of MySQL5.7.22 on Mac

<<:  How many ports can a Linux server open at most?

>>:  Getting Started with Website Building for Beginners ③ Alias ​​(CNAME) Records and URL Forwarding

Recommend

MySQL 8.0.13 installation and configuration graphic tutorial

Msyql database installation, for your reference, ...

Docker case analysis: Building a MySQL database service

Table of contents 1 Create configuration and data...

This article will show you what Vite does to the browser's request

Table of contents Working principle: What does th...

Why the table file size remains unchanged after deleting data in MySQL

For databases that have been running for a long t...

Example code for implementing page floating box based on JS

When the scroll bar is pulled down, the floating ...

How to configure MGR single master and multiple slaves in MySQL 8.0.15

1. Introduction MySQL Group Replication (MGR for ...

Making a simple game engine with React Native

Table of contents Introduction Get started A brie...

Configure VIM as a C++ development editor in Ubuntu

1. Copy the configuration file to the user enviro...

How to install jupyter in docker on centos and open ports

Table of contents Install jupyter Docker port map...

Solution to the problem that the image name is none after Docker load

Recently, I found that after using the docker loa...

Detailed explanation of Nginx timed log cutting

Preface By default, Nginx logs are written to a f...

How to use Docker to limit container resources

Problem Peeping In the server, assuming that the ...

Nginx restricts IP access to certain pages

1. To prohibit all IP addresses from accessing th...

Analyze the selection problem of storing time and date types in MySQL

In general applications, we use timestamp, dateti...

HTML mouse css control

Generally speaking, the mouse is displayed as an u...