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

Detailed explanation of the processing of the three Docker Nginx Logs

Because colleagues in the company need Nginx log ...

Two ways to implement square div using CSS

Goal: Create a square whose side length is equal ...

Ubuntu 16.04 mysql5.7.17 open remote port 3306

Enable remote access to MySQL By default, MySQL u...

Solve the problem of no my.cnf file in /etc when installing mysql on Linux

Today I wanted to change the mysql port, but I fo...

Implementation of multiple instances of tomcat on a single machine

1. Introduction First of all, we need to answer a...

The perfect solution for MySql version problem sql_mode=only_full_group_by

1. Check sql_mode select @@sql_mode The queried v...

Detailed explanation of how to select all child elements using CSS

How to recursively select all child elements usin...

30 minutes to give you a comprehensive understanding of React Hooks

Table of contents Overview 1. useState 1.1 Three ...

10 bad habits to avoid in Docker container applications

There is no doubt that containers have become an ...

Implementation of vertical centering with unknown height in CSS

This article mainly introduces the implementation...

React implements paging effect

This article shares the specific code for React t...

MySQL table return causes index invalidation case explanation

Introduction When the MySQL InnoDB engine queries...

js memory leak scenarios, how to monitor and analyze them in detail

Table of contents Preface What situations can cau...