当前位置:网站首页>Install database -linux-5.7
Install database -linux-5.7
2022-07-03 09:23:00 【Great you don't know】
1、 download tar package , Use here wget Download from official website
wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.22-linux-glibc2.12-x86_64.tar.gz
2、 take mysql The installation to /usr/local/mysql Next
decompression
tar -xvf mysql-5.7.22-linux-glibc2.12-x86_64.tar.gz
Move
mv mysql-5.7.22-linux-glibc2.12-x86_64 /usr/local/
rename
mv /usr/local/mysql-5.7.22-linux-glibc2.12-x86_64 /usr/local/mysql
3、 newly build data Catalog
mkdir /usr/local/mysql/data
4、 newly build mysql user 、mysql User group
mysql User group
groupadd mysql
mysql user
useradd mysql -g mysql
5、 take /usr/local/mysql The owner and group of are changed to mysql
chown -R mysql.mysql /usr/local/mysql
6、 To configure
/usr/local/mysql/bin/mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data
If the following error occurs :
Copy code
2018-07-14 06:40:32 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize
2018-07-14 06:40:32 [ERROR] Child process: /usr/local/mysql/bin/mysqldterminated prematurely with errno= 32
2018-07-14 06:40:32 [ERROR] Failed to execute /usr/local/mysql/bin/mysqld --bootstrap --datadir=/usr/local/mysql/data --lc-messages-dir=/usr/local/mysql/share --lc-messages=en_US --basedir=/usr/local/mysql
– server log begin –
– server log end –
Copy code
Then use the following command :
/usr/local/mysql/bin/mysqld --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data --initialize
If the following error occurs :
/usr/local/mysql/bin/mysqld: error while loading shared libraries: libnuma.so.1: cannot open shared object file: No such file or directory
Then execute the following command :
yum -y install numactl
Continue installation after completion :
/usr/local/mysql/bin/mysqld --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data --initialize
edit /etc/my.cnf
Copy code
[mysqld]
datadir=/usr/local/mysql/data
basedir=/usr/local/mysql
socket=/tmp/mysql.sock
user=mysql
port=3306
character-set-server=utf8
Cancel password verification
skip-grant-tables
Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
skip-grant-tables
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
Copy code
7、 Opening service
take mysql Join the service
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
Boot from boot
chkconfig mysql on
Turn on
service mysql start
8、 Set the password
Sign in ( because /etc/my.cnf Canceling password authentication is set in , So the password here is arbitrary )
/usr/local/mysql/bin/mysql -u root -p
operation mysql database
use mysql;
Change Password
update user set authentication_string=password(‘ Your password ’) where user=‘root’;
flush privileges;
exit;
9、 take /etc/my.cnf Medium skip-grant-tables Delete
10、 Log in and set the password again ( I don't know why I can't operate the database without setting the password again )
/usr/local/mysql/bin/mysql -u root -p
ALTER USER ‘root’@‘localhost’ IDENTIFIED BY ‘ Modified password ’;
exit;
11、 Allow remote connections
/usr/local/mysql/bin/mysql -u root -p
use mysql;
update user set host=’%’ where user = ‘root’;
flush privileges;
eixt;
12、 Add shortcut
ln -s /usr/local/mysql/bin/mysql /usr/bin
边栏推荐
- [point cloud processing paper crazy reading classic version 12] - foldingnet: point cloud auto encoder via deep grid deformation
- LeetCode 1089. 复写零
- Sword finger offer II 029 Sorted circular linked list
- Hudi学习笔记(三) 核心概念剖析
- Linxu learning (4) -- Yum and apt commands
- LeetCode 513. Find the value in the lower left corner of the tree
- Matlab dichotomy to find the optimal solution
- 【Kotlin学习】类、对象和接口——定义类继承结构
- 数字化转型中,企业设备管理会出现什么问题?JNPF或将是“最优解”
- Basic knowledge of network security
猜你喜欢

On February 14, 2022, learn the imitation Niuke project - develop the registration function

AcWing 785. Quick sort (template)

Basic knowledge of network security

LeetCode 871. Minimum refueling times
![[point cloud processing paper crazy reading classic version 12] - foldingnet: point cloud auto encoder via deep grid deformation](/img/62/edb888200e3743b03e5b39d94758f8.png)
[point cloud processing paper crazy reading classic version 12] - foldingnet: point cloud auto encoder via deep grid deformation

Hudi learning notes (III) analysis of core concepts
![[kotlin learning] classes, objects and interfaces - classes with non default construction methods or attributes, data classes and class delegates, object keywords](/img/ee/d982fd9e1f2283e09ad1a81d0b61b5.png)
[kotlin learning] classes, objects and interfaces - classes with non default construction methods or attributes, data classes and class delegates, object keywords

推荐一个 yyds 的低代码开源项目
![[point cloud processing paper crazy reading frontier version 10] - mvtn: multi view transformation network for 3D shape recognition](/img/94/2ab1feb252dc84c2b4fcad50a0803f.png)
[point cloud processing paper crazy reading frontier version 10] - mvtn: multi view transformation network for 3D shape recognition

拯救剧荒,程序员最爱看的高分美剧TOP10
随机推荐
Spark 结构化流写入Hudi 实践
We have a common name, XX Gong
【点云处理之论文狂读经典版13】—— Adaptive Graph Convolutional Neural Networks
Introduction to the basic application and skills of QT
[point cloud processing paper crazy reading frontier version 8] - pointview gcn: 3D shape classification with multi view point clouds
With low code prospect, jnpf is flexible and easy to use, and uses intelligence to define a new office mode
Derivation of Fourier transform
Utilisation de hudi dans idea
低代码起势,这款信息管理系统开发神器,你值得拥有!
Beego learning - Tencent cloud upload pictures
[point cloud processing paper crazy reading classic version 10] - pointcnn: revolution on x-transformed points
【Kotlin学习】类、对象和接口——定义类继承结构
Problems in the implementation of lenet
2022-2-14 learning xiangniuke project - generate verification code
传统办公模式的“助推器”,搭建OA办公系统,原来就这么简单!
【点云处理之论文狂读前沿版11】—— Unsupervised Point Cloud Pre-training via Occlusion Completion
Digital statistics DP acwing 338 Counting problem
低代码前景可期,JNPF灵活易用,用智能定义新型办公模式
[graduation season | advanced technology Er] another graduation season, I change my career as soon as I graduate, from animal science to programmer. Programmers have something to say in 10 years
Crawler career from scratch (IV): climb the bullet curtain of station B through API