当前位置:网站首页>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
最后本地连接
边栏推荐
- Object locking in relational database transactions
- mysql分区表改造
- Elementary level of C language -- while, for, do while
- Fearless of side impact damage, Chery arize 8 fully protects the safety of passengers
- 【YOLOv5实战5】基于YOLOv5的交通标志识别系统-YOLOv5整合PyQt5
- could only be written to 0 of the 1 minReplication nodes. There are 0 datanode(s) running and 0 node
- [Sylar] framework -chapter9-hook module
- High number_ Chapter 4__ Curvilinear integral_ Exercise solution
- Constructor of member function
- Full resolution of the use of go native plug-ins
猜你喜欢

Destructor of member function

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

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

Learn regular expressions (regexp)

Fearless of side impact damage, Chery arize 8 fully protects the safety of passengers
![[II. Mobile web page development] 2D & 3D conversion and animation, mobile terminal layout, responsive layout](/img/9a/a3b36aa2e5bf53d9f8355ea3c18f1e.png)
[II. Mobile web page development] 2D & 3D conversion and animation, mobile terminal layout, responsive layout

Mac installs mysql5.7 through brew

Use animatedbuilder to separate components and animation, and realize dynamic reuse

Important SQL server functions - other functions

MySQL:数据类型和运算符
随机推荐
Pyqt based grouping tool
031 log4j log framework
Information system project manager (2022) - key content: Project Contract Management (13)
Attempt method in laravel user authentication
[yolov5 practice 5] traffic sign recognition system based on yolov5 -yolov5 integration pyqt5
Information system project manager (2022) - key content: Project Portfolio Management (19)
[Sylar] framework chapter -chapter21- environment variable module
方舟生存进化自建服务器要多少成本?
【sylar】框架篇-Chapter21-环境变量模块
Elementary level of C language -- while, for, do while
Idea start project MVN command terminal cannot recognize "MVN" item as cmdlet
[Sylar] framework -chapter7-io coordination scheduling module
【YOLOv5实战5】基于YOLOv5的交通标志识别系统-YOLOv5整合PyQt5
重要的 SQL Server 函数 - 数字函数
【sylar】框架篇-Chapter20-守护进程模块
MySQL数据库————初识数据库
Use animatedbuilder to separate components and animation, and realize dynamic reuse
Power consumption: leakage power
pytorch打包exe出现WARNING: file already exists but should not: C:\Users\workAI\AppData\Local\Temp\_MEI13
【sylar】框架篇-Chapter23-模块篇总结