当前位置:网站首页>Tencent cloud installs MySQL database
Tencent cloud installs MySQL database
2022-06-30 17:45:00 【twinkle||cll】
Database migration , Record how to install on the new server mysql, It is convenient for others as well as for yourself
1、 uninstall MariaDB
1、 see rpm -qa|grep mariadb
Copy code
2、 uninstall yum remove mariadb
Copy code
3、 Delete data directory rm -rf /var/lib/mysql/*
Copy code
4、 Delete profile rm -f /etc/my.cnf
Copy code
2. Download the corresponding package
========
- Download and install MySQL Official Yum Repository
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
Copy code
2. download MySQL Repository configuration
yum -y install mysql57-community-release-el7-10.noarch.rpm
Copy code
- download mysql service
yum -y install mysql-community-server
Copy code
 This prompt indicates that the installation is successful
Installation did not succeed ,
------
> In step 3, an error may be reported during installation , as follows :

** The solution is as follows :**
Execute first : yum module disable mysql
Re execution : yum install mysql-community-server
Copy code
> Then you can execute successfully
2. MySQL Database settings
=============
- see mysql The location of
find / -name mysql
Copy code

> The position shown in the figure is mysql The default installation location for
2. start-up MySQL
systemctl start mysqld.service
Copy code
3. see MySQL state
systemctl status mysqld.service
Copy code
```

```
4. Get the initial password
grep "password" /var/log/mysqld.log
Copy code
```

```
5. Enter the database to change the password
mysql -u root -p xxxxx,
And then execute :
ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password'
Copy code
```
Here's the problem , If the new password is set too simply, an error will be reported :

The reason is because MySQL There are specifications for password settings , Specifically validate\_password\_policy The value of :

** Change password rules **
```
1. set global validate_password_policy=0;
2. set global validate_password_length=1;
Copy code
```
Reset the password
```
ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';
Copy code
```
Sign out and log back in
mysql -u user name -p password
The configuration is complete
Open the firewall
=====
> For firewalls , Everybody knows mysql The default port is 3306, If you can, you can change it yourself . Then open the port . Prevent malicious attacks from others
```
1. View firewall status
systemctl status firewalld
Copy code
```

```
2. Start the firewall
systemctl start firewalld
Copy code
```

```
3. see mysql Whether the port of is open
firewall-cmd --zone=public --query-port=3306/tcp
// If you are open, the result is yes, It is no
Copy code
- Open ports
firewall-cmd --zone=public --add-port=3306/tcp --permanent
// The console will output success
Copy code
5. service iptables restart
firewall-cmd --reload
// Console output sucess, Just ok 了
Copy code
```
Login authorization for visualization tools
==========
> Do you think , After the above operations are completed , You can connect remotely , Not yet
Authorize remote clients , Otherwise, the connection fails , Permission validation failed .
(1)SSH Sign in root Administrator account
(2) Sign in MySql
```
mysql -u root -p
Enter password:
Copy code
```
(3) Execute the authorization order
```
mysql> grant all privileges on *.* to [email protected]'localhost' identified by ' password ';
mysql> flush privileges;
Copy code
```
or
```
mysql> grant all privileges on *.* to [email protected]'%' identified by ' password ';
mysql> flush privileges;
Copy code
```
(4) Exit and try again
```
mysql> quit
Bye
Copy code
```
(5) Log in again
> thereafter , The database installation is complete
边栏推荐
- Servlet operation principle_ API details_ Advanced path of request response construction (servlet_2)
- 浅析搭建高速公路视频监控平台的建设方案及必要性
- JS from prototype chain to inheritance
- Horizontal visual error effect JS special effect code
- Six photos vous montrent pourquoi TCP serre la main trois fois?
- 解决方法:STM32使用cJSON解析数据失败
- Solution: STM32 failed to parse data using cjson
- 网络:服务器网卡组技术原理与实践
- Spin lock exploration
- canvas鼠标控制重力js特效
猜你喜欢

Property or method “approval1“ is not defined on the instance but referenced during render

EMQ helps Qingdao Yanbo build a smart water platform

Radio and television 5g officially set sail, attracting attention on how to apply the golden band

6 張圖帶你搞懂 TCP 為什麼是三次握手?
![万卷书 - 书单整理 [01]](/img/d4/124101b919a4d8163a32fc0f158efa.png)
万卷书 - 书单整理 [01]

2022上半年盘点:20+主流数据库重大更新及技术要点汇总

Splitting.js文本标题缓慢加载js特效

Hyper-V: enable SR-IOV in virtual network

Building a basic buildreoot file system

将 EMQX Cloud 数据通过公网桥接到 AWS IoT
随机推荐
k线图快速入门必读
Advanced Mathematics (Seventh Edition) Tongji University General exercises one person solution
Parker proportional overflow valve rs10r35s4sn1jw
Is there an optimal solution to the energy consumption anxiety in the data center?
【剑指Offer】剑指 Offer 53 - II. 0~n-1中缺失的数字
The gates of Europe
Exch:Exchange Server 2013 即将终止支持
Alibaba cloud disk sharing compressed package
Hyper-v:在虚拟网络中启用 SR-IOV
flutter 音乐 录音 播放 audioplayers
力士乐液控单向阀Z2S10-1-3X/
Hyper-V: enable SR-IOV in virtual network
Cesium-1.72 learning (earth rotation)
[untitled] write a student achievement and information management system in C language to realize the operation interface, clear screen display of current operation functions, reading and inputting st
数据中心的能耗焦虑, 到底有没有最优解?
The new version of Shangding cloud | favorites function has been launched to meet personal use needs
【C语言】详解线程 — 线程分离函数 pthread_detach
Nouvelle version de shangdingyun | la fonction favorite est en ligne pour répondre aux besoins d'utilisation personnelle
New skill: accelerate node through code cache JS startup
NFT铸造交易平台开发详情