当前位置:网站首页>Linux安装mysql最简单教程(一次成功)
Linux安装mysql最简单教程(一次成功)
2022-08-04 00:29:00 【猫爷阿呆】
(1)查询mariadb并卸载
rpm -qa | grep mariadb
rpm -e --nodeps mariadb-libs-5.5.68-1.el7.x86_64
(2)如果未安装wget,须安装wget,如果已安装,可跳过
yum install -y wget
(3) 下载mysql的repo源并安装rpm包
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
rpm -ivh mysql-community-release-el7-5.noarch.rpm
(4)安装mysql
yum install mysql-server -y
(5)授予权限
chown -R root:root /var/lib/mysql
chown root /var/lib/mysql/
(6)紧接着要修改中文乱码的文件
先输入命令 vim /etc/my.cnf
接着把光标移动到socket=/var/lib/mysql/mysql.sock下面
写 character-set-server=utf8
保存退出 :wq
(7)重启mysql数据库
service mysqld restart
(8)登录mysql数据库并授权
mysql -u root -p --->登录,直接回车即可
use mysql;
update user set password=password('ok') where user='root';GRANT ALL PRIVILEGES ON *.* TO [email protected]"%" IDENTIFIED BY "ok";
(9)使配置生效并退出
flush privileges;
exit;
(10)完成上述操作,再次登录mysql数据库,即可进行相应数据库操作
mysql -u root -pok
边栏推荐
- JVM垃圾回收总结(未完待续)
- LeetCode第三题(Longest Substring Without Repeating Characters)三部曲之三:两次优化
- 中原银行实时风控体系建设实践
- ping数据包中的进程号
- Getting started with MATLAB 3D drawing command plot3
- vscode插件设置——Golang开发环境配置
- win10+cuda11.7+pytorch1.12.0 installation
- C语言实验十五 文件
- It will invest about 200 billion US dollars in the United States in 20 years, and Samsung Electronics looks so handsome
- Jmeter-参数化
猜你喜欢

分布式事务框架 seata

并查集详解

新一代服务网关Gateway的实践笔记

如何通过单步调试的方式找到引起 Fiori Launchpad 路由错误的原因试读版

Go编译原理系列7(Go源码调试)

Salesforce's China business may see new changes, rumors may be closing

苹果对高通说:我4.45亿美元买下一个新园区,可能计划加快基带芯片自研
![[Miscellaneous] How to install the specified font into the computer and then use the font in the Office software?](/img/15/23b0724f9c9672c61b91320f1b84d8.png)
[Miscellaneous] How to install the specified font into the computer and then use the font in the Office software?

互斥锁、读写锁、自旋锁,以及原子操作指令xaddl、cmpxchg的使用场景剖析

动态内存二
随机推荐
电子组装行业对MES管理系统的需求分析
迭代扩展卡尔曼滤波IEKF
LeetCode第三题(Longest Substring Without Repeating Characters)三部曲之三:两次优化
面试必问的HashCode技术内幕
NLP resources that must be used for projects [Classified Edition]
数据库扩容也可以如此丝滑,MySQL千亿级数据生产环境扩容实战
【杂项】如何将指定字体装入电脑然后能在Office软件里使用该字体?
typescript55-泛型约束
ping数据包中的进程号
【超详细】手把手教你搭建MongoDB集群搭建
MPLS Comprehensive Experiment
c语言分层理解(c语言操作符)
研究生新生培训第四周:MobileNetV1, V2, V3
孙宇晨:Web3.0和元宇宙将协助人类更加全面地进入网络世界
【每日一题】899. 有序队列
求解同余方程 数论 扩展欧几里得
C语言 函数递归
win10+cuda11.7+pytorch1.12.0 installation
typescript52-简化泛型函数调用
并查集详解