当前位置:网站首页>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
最后本地连接
边栏推荐
- [Sylar] framework Chapter 6 collaborative scheduling module
- Strlen introduction, and the difference between sizeof
- 【sylar】框架篇-Chapter20-守护进程模块
- 【sylar】框架篇-Chapter9-hook 模块
- [Sylar] framework Chapter 8 timer module
- Sort - cardinal sort
- 24-Openwrt dnsmasq
- Phpstorm2022 connect to the database
- Work fishing clock simulator wechat applet source code
- 重要的 SQL Server 函数 - 日期函数
猜你喜欢

Study notes of Gu Yujia on July 27, 2022

Learn regular expressions (regexp)

【二、移动web网页开发】2D&3D转换与动画、移动端布局、响应式布局

Information system project manager (2022) - key content: information system integrated testing and management, project management maturity model, quantitative project management (21)

Reading of a unified generic framework for aspect based sentimental analysis

Harmony's Application on the shelves reported an error. The solution of "please use the API of the released version to develop the application and apply for listing"

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

高数_第4章__曲线积分_习题解法

Jupyter Notebook安装代码提示功能
![RuntimeError: stack expects each tensor to be equal size, but got [8] at entry 0 and [2] at entry 2](/img/66/27de1ac0f642fc91fca5196ea6e141.png)
RuntimeError: stack expects each tensor to be equal size, but got [8] at entry 0 and [2] at entry 2
随机推荐
What to do when encountering slow SQL? (next)
Information system project manager (2022) - key content: intellectual property rights and standards and specifications (22)
Attempt method in laravel user authentication
Elementary level of C language -- while, for, do while
Bio annotation of emotion analysis aste triples extraction
[Sylar] framework chapter -chapter21- environment variable module
What is the account opening process of qiniu business school? Is it safe?
Destructor of member function
【sylar】框架篇-Chapter9-hook 模块
王爽汇编语言详细学习笔记三:寄存器(内存访问)
High number_ Chapter 4__ curvilinear integral
Important SQL server functions - other functions
关系数据库事务中的对象锁定
Fearless of side impact damage, Chery arize 8 fully protects the safety of passengers
26 openwrt port forwarding DMZ UPnP
Mac installs mysql5.7 through brew
CMake使用基础汇总
pytorch_ Lightning in lightning_ The output of hparams.yaml in logs is null
pytorch打包exe出现WARNING: file already exists but should not: C:\Users\workAI\AppData\Local\Temp\_MEI13
[Sylar] framework -chapter7-io coordination scheduling module