当前位置:网站首页>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
边栏推荐
- 2022-2-13 learning the imitation Niuke project - home page of the development community
- LeetCode 508. 出现次数最多的子树元素和
- 低代码前景可期,JNPF灵活易用,用智能定义新型办公模式
- Excel is not as good as jnpf form for 3 minutes in an hour. Leaders must praise it when making reports like this!
- Liteide is easy to use
- 浅谈企业信息化建设
- Jenkins learning (II) -- setting up Chinese
- Linxu learning (4) -- Yum and apt commands
- [kotlin learning] classes, objects and interfaces - classes with non default construction methods or attributes, data classes and class delegates, object keywords
- What are the stages of traditional enterprise digital transformation?
猜你喜欢

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

Just graduate student reading thesis

精彩回顾|I/O Extended 2022 活动干货分享

AcWing 787. Merge sort (template)

Vs2019 configuration opencv3 detailed graphic tutorial and implementation of test code

AcWing 785. Quick sort (template)

Spark structured stream writing Hudi practice

教育信息化步入2.0,看看JNPF如何帮助教师减负,提高效率?
![[point cloud processing paper crazy reading classic version 14] - dynamic graph CNN for learning on point clouds](/img/7d/b66545284d6baea2763fd8d8555e1d.png)
[point cloud processing paper crazy reading classic version 14] - dynamic graph CNN for learning on point clouds

2022-2-14 learning xiangniuke project - Session Management
随机推荐
[point cloud processing paper crazy reading frontier edition 13] - gapnet: graph attention based point neural network for exploring local feature
Low code momentum, this information management system development artifact, you deserve it!
即时通讯IM,是时代进步的逆流?看看JNPF怎么说
LeetCode 57. Insert interval
图像修复方法研究综述----论文笔记
Severity code description the project file line prohibits the display of status error c2440 "initialization": unable to convert from "const char [31]" to "char *"
【点云处理之论文狂读经典版13】—— Adaptive Graph Convolutional Neural Networks
Serializer rewrite: update and create methods
Crawler career from scratch (IV): climb the bullet curtain of station B through API
State compression DP acwing 291 Mondrian's dream
【点云处理之论文狂读前沿版10】—— MVTN: Multi-View Transformation Network for 3D Shape Recognition
拯救剧荒,程序员最爱看的高分美剧TOP10
Overview of database system
Tag paste operator (#)
精彩回顾|I/O Extended 2022 活动干货分享
Hudi integrated spark data analysis example (including code flow and test results)
The less successful implementation and lessons of RESNET
Notes on numerical analysis (II): numerical solution of linear equations
【Kotlin学习】类、对象和接口——定义类继承结构
Simple use of MATLAB