当前位置:网站首页>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
边栏推荐
- Notes on numerical analysis (II): numerical solution of linear equations
- 【点云处理之论文狂读经典版14】—— Dynamic Graph CNN for Learning on Point Clouds
- 网络安全必会的基础知识
- Build a solo blog from scratch
- [point cloud processing paper crazy reading cutting-edge version 12] - adaptive graph revolution for point cloud analysis
- In the digital transformation, what problems will occur in enterprise equipment management? Jnpf may be the "optimal solution"
- 2022-2-13 learning xiangniuke project - version control
- There is no open in default browser option in the right click of the vscade editor
- 【Kotlin学习】运算符重载及其他约定——重载算术运算符、比较运算符、集合与区间的约定
- Hudi 集成 Spark 数据分析示例(含代码流程与测试结果)
猜你喜欢
Digital statistics DP acwing 338 Counting problem
2022-2-13 learn the imitation Niuke project - Project debugging skills
传统办公模式的“助推器”,搭建OA办公系统,原来就这么简单!
Using Hudi in idea
State compression DP acwing 91 Shortest Hamilton path
【点云处理之论文狂读经典版8】—— O-CNN: Octree-based Convolutional Neural Networks for 3D Shape Analysis
【Kotlin学习】高阶函数的控制流——lambda的返回语句和匿名函数
Crawler career from scratch (3): crawl the photos of my little sister ③ (the website has been disabled)
LeetCode 508. 出现次数最多的子树元素和
推荐一个 yyds 的低代码开源项目
随机推荐
Hudi学习笔记(三) 核心概念剖析
Notes on numerical analysis (II): numerical solution of linear equations
LeetCode 871. Minimum refueling times
Detailed steps of windows installation redis
Digital management medium + low code, jnpf opens a new engine for enterprise digital transformation
[point cloud processing paper crazy reading classic version 12] - foldingnet: point cloud auto encoder via deep grid deformation
LeetCode 508. 出现次数最多的子树元素和
Discussion on enterprise informatization construction
AcWing 787. Merge sort (template)
Recommend a low code open source project of yyds
[point cloud processing paper crazy reading frontier edition 13] - gapnet: graph attention based point neural network for exploring local feature
Win10 quick screenshot
MySQL installation and configuration (command line version)
[point cloud processing paper crazy reading frontier version 8] - pointview gcn: 3D shape classification with multi view point clouds
[point cloud processing paper crazy reading classic version 14] - dynamic graph CNN for learning on point clouds
Move anaconda, pycharm and jupyter notebook to mobile hard disk
With low code prospect, jnpf is flexible and easy to use, and uses intelligence to define a new office mode
Sword finger offer II 091 Paint the house
Liteide is easy to use
LeetCode 513. Find the value in the lower left corner of the tree