当前位置:网站首页>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 
边栏推荐
- The full technology stack, full scene and full role cloud native series training was launched to help enterprises build a hard core cloud native technology team
- 2022-06-30:以下golang代码输出什么?A:0;B:2;C:运行错误。 package main import “fmt“ func main()
- MaxPool2d详解--在数组和图像中的应用
- Red Hat将在Project Atomic上运用容器负载服务器
- Inventory the six second level capabilities of Huawei cloud gaussdb (for redis)
- Using Excel to quickly generate SQL statements
- 1. crawler's beautifulsoup parsing library & online parsing image verification code
- Which is better, server rental or hosting services in the United States?
- 如何区分平台安全和网上炒作?网络投机有哪些止损技巧?
- CentOS 6.3 x64 PHP 5.2.6 扩展安装OpenSSL出错的解决方法
猜你喜欢

ABAQUS 2022 latest edition - perfect realistic simulation solution
![Cesiumjs 2022 ^ source code interpretation [6] - new architecture of modelempirical](/img/ce/519778cd731f814ad111d1e37abd10.png)
Cesiumjs 2022 ^ source code interpretation [6] - new architecture of modelempirical

76页智慧物流园区综合解决方案2022(附下载)

The programmer's girlfriend gave me a fatigue driving test

什么是SRM系统,如何规范公司内部采购流程

206页上海BIM技术应用与发展报告2021

5g smart building solution 2021

What is SRM system and how to standardize the internal procurement process of the company

Design e-commerce seckill system

In 2022, the latest JCR officially released the list of the latest global impact factors (top 600)
随机推荐
基金管理人公司治理和风险管理
DNS server setup, forwarding, master-slave configuration
Red hat will apply container load server on project atomic
The girlfriend said: if you want to understand the three MySQL logs, I will let you heiheihei!
CentOS 6.3 x64 PHP 5.2.6 扩展安装OpenSSL出错的解决方法
Combining online and offline, VR panorama is a good way to transform furniture online!
What does it mean to open an account online? Is it safe to open an account online?
Don't worry about whether you can be a coder if you don't learn English well. Learn it first
SSM integration process (integration configuration, function module development, interface test)
2022-06-30: what does the following golang code output? A:0; B:2; C: Running error. package main import “fmt“ func main()
Software supply chain security risk pointing North for enterprise digitalization and it executives
35 giant technology companies jointly form the meta universe standard Forum Organization
leetcode 474. Ones and Zeroes 一和零(中等)
5g smart building solution 2021
6-1 exploit -ftp exploit
In 2022, the latest JCR officially released the list of the latest global impact factors (top 600)
NATs cluster deployment
Warmup preheating learning rate "suggestions collection"
Development of wireless U-shaped ultrasonic electric toothbrush
How do I open a stock account on my mobile phone? In addition, is it safe to open a mobile account?