当前位置:网站首页>linux下安装mysql
linux下安装mysql
2022-07-28 04:38:00 【爱吃咖喱鸡】
@linux下安装mysql
0、导入jar包到opt/mysql
1、检查
rpm -qa|grep mariadb
如果存在则卸载
请先执行卸载命令:rpm -e – nodeps mariadb-libs-5.5.56-2.e17.x86_64
必须有如下两个包
rpm -qa|grep libaio
rpm -qa|grep net-tools
2、授权 chmod -R 777 /tmp
3、安装mysql
rpm -ivh mysql-community-common-5.7.16-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.16-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-5.7.16-1.el7.x86_64.rpm
sudo rpm -ivh --nodeps mysql-community-server-5.7.16-1.el7.x86_64.rpm
另一种:yum安装
4、查看版本
mysqladmin --version命令
5、初始化服务
mysqld --initialize --user=mysql
6、查看密码
cat /var/log/mysqld.log
7、相关服务
启动 systemctl start mysqld.service
关闭 systemctl stop mysqld.service
8、登录修改密码
mysql -u root -p
ALTER USER ‘root’@‘localhost’ IDENTIFIED BY ‘123456’;
9、修改字符集
vim /etc/my.cnf
在最后加上:character_set_server=utf8
并重启
systemctl restart mysqld.service
skip-name-resolve 表示跳过dns解析以后连接mysql
10、授权远程连接
再次登录mysql授予远程连接
grant all privileges on . to [email protected]‘%’ identified by ‘123456’;
刷新权限
flush privileges;
关闭防火墙
systemctl stop firewalld.service
systemctl disable firewalld.service
systemctl restart mysqld.service
最后本地连接
边栏推荐
- How much does it cost to build a self built server for ark survival evolution?
- Reading of seq2path: generating sentimental tuples as paths of a tree
- Efficient practice intelligent analysis of massive log data in aviation industry
- Study notes of Gu Yujia on July 27, 2022
- Idea start project MVN command terminal cannot recognize "MVN" item as cmdlet
- 【sylar】实战篇-基于 redis 的参数查询服务
- [Sylar] framework -chapter20- daemon module
- Blooming old trees -- quickly build a map bed application with imageprocessor
- Jupyter Notebook安装代码提示功能
- 26 openwrt port forwarding DMZ UPnP
猜你喜欢

How to select reliable securities analysts?

Reading of seq2path: generating sentimental tuples as paths of a tree

重要的 SQL Server 函数 - 日期函数

Esp8266 WiFi module and mobile communication

Mac installs mysql5.7 through brew

Transformer landing | next vit realizes the real-time landing of industrial tensorrt, surpassing RESNET and cswin

Space complexity calculation super full sorting!! (calculation of hand tearing complexity

Seamless support for hugging face community, colossal AI low-cost and easy acceleration of large model

重要的 SQL Server 函数 - 字符串实用程序

空间复杂度计算超全整理!!(一起手撕复杂度计算
随机推荐
物联网工业串口转WiFi模块 无线路由WiFi模块的选型
Advanced architects, 16 common principles of microservice design and Governance
[Sylar] practical part - redis based parameter query service
Information system project manager (2022) - key content: Knowledge Management (15)
Reading of a unified generic framework for aspect based sentimental analysis
What is the account opening process of qiniu business school? Is it safe?
将数据库拿到的数据渲染到elementUI 中的table中去
C语言初阶——循环语句(while,for,do while)
CMake使用基础汇总
Artificial intelligence and RPA technology application (I) -rpa Hongji product introduction, designer interface function explanation
《KG-BERT: BERT for Knowledge Graph Completion》
上班摸鱼打卡模拟器微信小程序源码
[Sylar] framework chapter -chapter21- environment variable module
Use animatedbuilder to separate components and animation, and realize dynamic reuse
Object locking in relational database transactions
【sylar】框架篇-Chapter21-环境变量模块
How to select reliable securities analysts?
[Sylar] framework -chapter14 tcpserver module
[Sylar] framework -chapter11 socket module
Select sorting method