当前位置:网站首页>Linux Installation and uninstallation of MySQL
Linux Installation and uninstallation of MySQL
2022-07-27 06:50:00 【Rice*】
1、 uninstall
because Linux By default, the system does not MySql, So we just use it without uninstalling .
If you need to uninstall , The steps are like uninstalling JDK equally : Linux Install and uninstall JDK_ rice * The blog of -CSDN Blog
Just execute
rpm -qa|grep mysqlcommand , Then follow uninstall JDK Just follow the same steps .
2、 install
Log on first ROOT account number !!!
1、 download MySql Official YumRepository
Carry out orders
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpmRemote download MySql5.7 edition , need Linux Connected to the Internet
If the error is not reported
wget, Then execute the commandyum -y install wget
2、Yum install
Carry out orders
yum -y install mysql57-community-release-el7-10.noarch.rpm
3、 install MySql The server
Carry out orders
yum -y install mysql-community-serverIf you make a mistake

Carry out orders
rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022Execute command again
yum -y install mysql-community-serverThat's all right.
4、 start-up MySql service
Carry out orders
systemctl start mysqld.serviceNeed to wait a little

5、 see MySql Start state
Carry out orders
systemctl status mysqld.service, You can see that it is running
6、 Find the password in the log
Carry out orders
grep "password" /var/log/mysqld.log
7、 Sign in MySql
Log in to the database , Enter the command
mysql –uroot -pAfter typing the command , Enter the password you found above , Just copy and paste

8、 Change Password
Change Password , Enter the command
set password for [email protected] = password('123_abC321');Passwords include case and special characters , Otherwise, it will not succeed ( You can modify the password policy to set )
9、 Open permission
Enter the command
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'Yc17630620280.';
10、 Refresh the permissions
Carry out orders
flush privileges;
11、 to open up 3306 port
Enter the command first
exit, sign out MySql
Carry out orders
firewall-cmd --zone=public --add-port=3306/tcp
12、 service iptables restart
Carry out orders
firewall-cmd –-reload
13、Navicat Connect the test
Enter the command
ip addr, View your own system ip Address
return Windows System , open Navicat Carry out connection test

If the above error is reported , You need to clear the rules in the chain in the firewall , Execute the following two commands respectively :
iptables -vnL iptables -F
14、 modify MySql Character encoding
Enter the first MySql, Enter the command
mysql -uroot -p, Then enter the password
Display original code , Enter the command
show variables like '%character%';
Use
exit;Command exit mysql, And then modify /etc/my.cnf The configuration fileafter , Enter the command
vim /etc/my.cnfAdd two new lines , After entering, press
iEditing[mysqld] character_set_server=utf8 init_connect='SET NAMES utf8'
When I'm done , Press
escPress to exit the edit page , Then input:wqSave and exitAfter exiting , Restart the database , Enter the command
systemctl restart mysqldUse navicat Perform the connection test again

This is the place ,Linux System installation MySql Task to complete !
边栏推荐
- logging日志的封装
- Installation, configuration and use of gradle
- ArcGIS for JS API (2) get the ID set of element services
- Shell Scripting format
- Install redis under Windows
- 程序、进程、线程、协程以及单线程、多线程基本概念
- Converting ArcGIS style stylesheet files to GeoServer SLD files
- 云原生运行环境搭建
- Use -wall to clear code hidden dangers
- Vscode solves the problem of using stuck ipynb files when running
猜你喜欢

To improve the baby's allergy, take yiminshu. Azg and aibeca love la Beijia work together to protect the growth of Chinese babies

FTX 基金会资助1500万帮助新冠疫苗临床实验,将影响全球公共卫生

Build cloud native operating environment

What if the website server is attacked? Sunflower tips that preventing loopholes is the key

账号管理与权限

项目实训经历1

2021-06-26

FTX Foundation funded 15million to help covid-19 clinical trials, which will affect global public health

Project training experience 1

3D打印品牌的康复骨科支具有何特别之处?
随机推荐
Webodm win10 installation tutorial (personal test)
Three methods to judge whether it is palindrome structure
FTP服务简介与配置
gin-vue-admin 使用docker容器中的数据库
自己动手实现容器
Cesium tutorial (1) interface introduction -3dfiles loading - change mouse operation settings
shell函数
账号管理与权限
Redis快速学习
Multimodal database | star ring technology multimode database argodb "one database for multiple purposes", building a high-performance Lake warehouse integrated platform
shell--变量的运算
Log in to Alibaba cloud server with a key
LVM与磁盘配额
Open source WebGIS related knowledge
Redis fast learning
Decorator functions and the use of class decorators
Shell语句判断练习题
Tips - completely delete the files on the USB flash drive
DNS域名解析服务
创建一个不依赖于任何基础镜像的容器