当前位置:网站首页>Linux下搭建集群环境(2)-----------linux下安装Mysql
Linux下搭建集群环境(2)-----------linux下安装Mysql
2022-06-25 22:13:00 【大魔王的日常Log】
1.检测是否安装了mysql
运行命令:rpm -qa | grep mysql
第一次安装的话会显示:mysql-libs-5.1.71-1.el6.i686
2.卸载系统自带的mysql
运行命令:rpm -e --nodeps mysql-libs-5.1.71-1.el6.i686
3.上传mysql
推荐一个工具(FileZilla)可以直接拖拽
4.在 /usr/local/ 创建一个mysql
运行命令:mkdir mysql
5.复制mysql 到 mysql目录下
运行命令:cp /root/Mysql-XXX.gz ./mysql
6.解压 tar
运行命令:tar -xvf Mysql-XXX
解压之后会有几个rpm文件
7.安装
安装mysql的服务器端
运行命令:rpm -ivh MySQL-server-XXX-XXX.rpm
注意:第一次登录mysql的时候没有不需要密码的 以后都需要
安装mysql的客户端
运行命令:rpm -ivh MySQL-client-XXX-XXXX.rpm
8.查看mysql的服务状态
运行命令:service mysql status
启动 mysql
运行命令:service mysql start
停止mysql
运行命令:service mysql stop
9.修改mysql的root的密码
登录:mysql -uroot
修改密码:
运行命令:use mysql;
运行命令:update user set password = password('1234') where user = 'root';
运行命令:flush privileges;(刷新的意思)
重新登录:mysql -uroot -p
10.开启远程访问
运行命令:grant all privileges on *.* to 'root' @'%' identified by '1234';
运行命令:flush privileges;
11.开启防火墙端口 3306 退出mysql
3306端口放行
运行命令:/sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
将该设置添加到防火墙的规则中
运行命令:/etc/rc.d/init.d/iptables save
可以用navicat premium在Windows环境下远程访问测试一下
12:设置mysql的服务随着系统的启动而启动
加入到系统服务:
运行命令:chkconfig --add mysql
自动启动:
运行命令:chkconfig mysql on
边栏推荐
- 关于运行scrapy项目时提示 ModuleNotFoundError: No module named 'pymongo‘的解决方案
- Redis之哨兵
- Redis之内存淘汰机制
- 详细讲解局部变量、全局变量、静态变量三种类型
- PCB生产为什么要做拼板和板边
- 迅为RK3568开发板使用RKNN-Toolkit-lite2运行测试程序
- SSM integrated learning notes (mainly ideas)
- 【微信公众号H5】 生成带参数进入公众号关注页的二维码 监听用户关注公众号事件 自定义菜单栏 (服务端)
- Network connection verification
- 14.1.1 promethues monitoring, four data types metrics, pushgateway
猜你喜欢

手工制作 pl-2303hx 的USB轉TTL電平串口的電路_過路老熊_新浪博客

How postman tests interfaces that require login

Hand made pl-2303hx USB to TTL level serial port circuit_ Old bear passing by_ Sina blog

11.1.1、flink概述_flink概述

Recommended system design

Explain in detail the three types of local variables, global variables and static variables

Connecting MySQL database with VBScript_ Old bear passing by_ Sina blog

数组常用的一些操作方法

Thrift入门学习

My blog is 2 years old and 167 days old today. I received the pioneer blogger Badge_ Old bear passing by_ Sina blog
随机推荐
linux安装redis
给定参数n,从1到n会有n个整数1,2,3,...,n,这n个数组共有n!种排列,按照大小顺序升序排列出所有列的情况,并一一标记,给定n和k,返回第k个值
My blog is 2 years old and 167 days old today. I received the pioneer blogger Badge_ Old bear passing by_ Sina blog
2021-04-28
smt贴片加工行业常见术语及知识汇总
Linking MySQL database with visual studio2015 under win10
记录一些cf的题
SMT行业AOI,X-RAY,ICT分别是什么?作用是?
SSM integrated learning notes (mainly ideas)
Network connection verification
JS中的数字数组去重
Simulation connection between WinCC and STEP7_ Old bear passing by_ Sina blog
[wechat official account H5] generates a QR code with parameters to enter the official account attention page to listen to user-defined menu bar for official account events (server)
Read CSV file data in tensorflow
(Reprint) visual explanation of processes and threads
P3052 [USACO12MAR]Cows in a Skyscraper G
Joint simulation of STEP7 and WinCC_ Old bear passing by_ Sina blog
Static keyword explanation
WINCC与STEP7的仿真连接_过路老熊_新浪博客
Talk about singleton mode!