当前位置:网站首页>CentOS install MySQL
CentOS install MySQL
2022-07-01 00:05:00 【Shuaiyu yeah~】
Mysql Official website download address
Select universal 
Selected historical version 
Upload to centos In and .tar.xz Format file is converted to .tar File format
xz -d mysql-8.0.27-linux-glibc2.12-x86_64.tar
Unzip it to the corresponding folder
tar -xvf mysql-8.0.27-linux-glibc2.12-x86_64.tar -C /usr/local/shuai
Modify file name
mv mysql-8.0.27-linux-glibc2.12-x86_64/ mysql-8.0.27
Modify the configuration file
cd /
vi /etc/my.cnf
[client]
port=3306
socket=/var/lib/mysql/mysql.sock
[mysqld]
port=3306
user=mysql
socket=/var/lib/mysql/mysql.sock
basedir=/usr/local/shuai/mysql-8.0.27
datadir=/usr/local/shuai/mysql-8.0.27/data
add to mysql Groups and users
groupadd mysql
useradd -g mysql mysql
initialization Mysql Generate initial password
cd /
/usr/local/shuai/mysql-8.0.27/bin/mysqld --initialize --user=mysql --basedir=/usr/local/shuai/mysql-8.0.27/ --datadir=/usr/local/shuai/mysql-8.0.27/data/
Record the initial password 
establish sock The folder is linked to the command
mkdir -p /var/lib/mysql ; chown -R mysql:mysql /var/lib/mysql
ln -s /usr/local/shuai/mysql-8.0.27/bin/mysql /usr/bin
Start the service
/usr/local/shuai/mysql-8.0.27/support-files/mysql.server start
Change the initial password
mysql -uroot -p
Report errors : Enter the following command 
sudo ln -s /usr/lib64/libtinfo.so.6.1 /usr/lib64/libtinfo.so.5
Change the initial password again
mysql -uroot -p
Enter the initial password , Input does not display , Directly enter 
ALTER USER 'root'@'localhost' IDENTIFIED BY 'root';
Turn on remote
use mysql;
update user set host='%' where user='root';
flush privileges;
exit;

Set boot up
cp /usr/local/shuai/mysql-8.0.27/support-files/mysql.server /etc/init.d/mysql
chkconfig mysql on
chkconfig --add mysql
Tencent cloud firewall needs to add rules 
边栏推荐
- Simple application example of rhai script engine
- ABAQUS 2022 latest edition - perfect realistic simulation solution
- Pycharm is very fast to learn from installation to full armament. There are so many pictures because it is too detailed!
- Vmware16 installing win11 virtual machine (the most complete step + stepping on the pit)
- C# /platform:anycpu32bitpreferred 只能与 /t:exe、/t:winexe 和 /t:appcontainerexe 一起使用
- Fund customer service
- Fund clients and sales agencies
- Why did kubernetes win? The changes in the container circle!
- 35家巨头科技公司联合组成元宇宙标准论坛组织
- [PHP] self developed framework qphp, used by qphp framework
猜你喜欢

ABAQUS 2022 latest edition - perfect realistic simulation solution

Quick start of wechat applet -- project introduction

Vmware16 installing win11 virtual machine (the most complete step + stepping on the pit)

shell 同时执行多任务下载视频

Prospects of world digitalization and machine intelligence in the next decade

Ms17-010 Eternal Blue vulnerability of MSF

6-1 exploit -ftp exploit

Maxpool2d explanation -- Application in arrays and images

Manage edge browser settings (ie mode, homepage binding, etc.) through group policy in the enterprise

SSM integration process (integration configuration, function module development, interface test)
随机推荐
1. crawler's beautifulsoup parsing library & online parsing image verification code
How to mention hot fix and cherry pick
Fh6908a negative pole turn off synchronous rectification analog low voltage drop diode control IC chip tsot23-6 ultra low power rectifier 1W power consumption < 100ua static replacement mp6908
Never use redis expired monitoring to implement scheduled tasks!
leetcode 474. Ones and zeroes (medium)
未来十年世界数字化与机器智能展望
Lombok
Detailed explanation of conv2d -- use in arrays and images
Cesiumjs 2022 ^ source code interpretation [6] - new architecture of modelempirical
206页上海BIM技术应用与发展报告2021
ABAQUS 2022 software installation package and installation tutorial
Fund customer service
When is it appropriate to replace a virtual machine with a virtual machine?
On the application of cluster analysis in work
QQmlApplicationEngine failed to load component qrc:/main. qml:-1 No such file or directory
Prospects of world digitalization and machine intelligence in the next decade
shell 同时执行多任务下载视频
[designmode] singleton pattern
Design e-commerce seckill system
What is SRM system and how to standardize the internal procurement process of the company