当前位置:网站首页>CentOS7 installation MySQL graphic detailed tutorial
CentOS7 installation MySQL graphic detailed tutorial
2022-07-31 12:32:00 【m0_67391518】
目录
7.?安装完之后修改当前目录拥有者为root用户,修改data目录拥有者为mysql
一. 检查是否已经安装过MySQL
这里介绍两种方法
方法一
1.rpm查看mysql安装
rpm -qa|grep -i mysql
2.卸载前关闭mysql服务
rpm -ev --nodepsmysql-community-release-el7-5.noarch
rpm -ev --nodepsmysql-community-common-5.6.38-2.el7.x86_64
…
执行完命令之后再次执行 rpm-qa|grep -i mysql 会发现已经卸载完成.
方法二
1. 执行命令 查找mysql文件夹
find / -name mysql
2. 把查找出的目录删除
rm -rf /run/lock/subsys/mysql /usr/local/mysql /usr/local/mysql/include/mysql /usr/local/mysql/data/mysql /usr/local/mysql/bin/mysql
二.安装MySQL
1.将压缩包传到服务器
我这里用的是mysql-5.6.36 , 如需其他版本可自行下载
这里是mysql-5.6.36的压缩包 :
链接:https://pan.baidu.com/s/1Kles21GxwyfEkyqicgyzhQ?pwd=sin7
提取码:sin7
2. 解压文件
tar -zxvf mysql-5.6.36-linux-glibc2.5-x86_64.tar.gz
3.重命名解压后的文件
mv mysql-5.6.36-linux-glibc2.5-x86_64/ mysql
4.检查是否有mysql用户组和mysql用户
groups mysql
若有----跳过此步
若无----添加
groupadd mysql
useradd -r -g mysql mysql
5.进入mysql目录-----更新权限
cd mysql/
chown -R mysql:mysql ./
6.执行安装脚本
./scripts/mysql_install_db --user=mysql
如果提示 FATAL ERROR: please install the following Perl modules before executing ./scripts/mysql_install_db:Data::Dumper的话,那么原因是缺少perl-module
yum -y install perl-Module-Install.noarch
安装perl-module模块,等待perl-module安装成功之后,再继续执行上一步安装
7.安装完之后修改当前目录拥有者为root用户,修改data目录拥有者为mysql
chown -R root:root ./
chown -R mysql:mysql data
8.启动mysql
./support-files/mysql.server start
9. 修改密码
./bin/mysqladmin -u root password ‘你的密码’
10.登录
./bin/mysql -h127.0.0.1 -uroot -p
输入刚设置的密码即可登录
11.添加远程登录权限
grant all privileges on *.* to [email protected]‘%’ identified by ‘你的密码’;
flush privileges;
12. 将MySQL注册为服务
cp support-files/mysql.server /etc/init.d/mysqld
chkconfig --add
mysqld chkconfig mysqld on
service mysqld restart(重启)
service mysqld status (状态)
先自我介绍一下,小编13年上师交大毕业,曾经在小公司待过,去过华为OPPO等大厂,18年进入阿里,直到现在.深知大多数初中级java工程师,想要升技能,往往是需要自己摸索成长或是报班学习,但对于培训机构动则近万元的学费,着实压力不小.自己不成体系的自学效率很低又漫长,而且容易碰到天花板技术停止不前.因此我收集了一份《java开发全套学习资料》送给大家,初衷也很简单,就是希望帮助到想自学又不知道该从何学起的朋友,同时减轻大家的负担.添加下方名片,即可获取全套学习资料哦
边栏推荐
- Error EPERM operation not permitted, mkdir ‘Dsoftwarenodejsnode_cache_cacach两种解决办法
- Addition logic for SAP Commerce Cloud Product Review
- VBA实现双击单元格自动输出对号再次双击取消对号
- Use ODBC in Excel to read data from CDS view on SAP BTP platform
- FastAPI 封装一个通用的response
- Character Functions and String Functions
- 使用 Excel 读取 SAP ABAP CDS View 通过 ODBC 暴露出来的数据
- Basic use of dosbox [easy to understand]
- ESP8266-Arduino编程实例-HDC1008温度湿度传感器驱动
- kubernetes之服务发现
猜你喜欢
随机推荐
PyQt5 rapid development and actual combat 10.2 compound interest calculation && 10.3 refresh blog clicks
JS列表数据通过递归实现树形结构
使用openssl命令生成证书和对应的私钥,私钥签名,公钥验签
Different lower_case_table_names settings for server (‘1‘) and data dictionary (‘0‘) 解决方案
JVM 运行时数据区与JMM 内存模型详解
In Excel using ODBC consumer SAP ABAP CDS view
Quickly learn database management
Use docker to build mysql master-slave
Hybrid brain-computer interface system based on steady-state visual evoked potentials and attentional EEG
Cognitive-exercise rehabilitation medical robot application design
Getting started with jmeter performance testing steps (performance testing tool jmeter)
跨境电商小知识之跨境电商物流定义以及方式讲解
[core]-ARMV7-A, ARMV8-A, ARMV9-A Architecture Introduction "Recommended Collection"
busybox之reboot命令流程分析
imx6ull看门狗使用
PyQt5 rapid development and actual combat 10.1 Get city weather forecast
DCM middleware family welcomes a new member
JVS低代码能力简介及功能清单
认知—运动康复医疗机器人应用设计
WebGL给Unity传递参数问题1: Cannot read properties of undefined (reading ‘SendMessage‘)