Linux下如何使用yum安装MySQL
Linux下yum安装MySQL具体步骤1、先检查系统是否安装有mysql[root@localhost~]#yumlistinstalledmysql*``[root@localhost~]#rpm–qa|grepmysql*2、查看有没有安装包[root@localhost~]#yumlistmysql*3、安装mysql客户端[root@localhost~]#yuminstallmysql4、安装mysql服务端提示:如果输入此命令没有报错,则跳过下面步骤,继续安装下一个服务端1[ro
Linux下yum安装MySQL具体步骤
1、先检查系统是否安装有mysql
[root@localhost ~]#yum list installed mysql*``[root@localhost ~]#rpm –qa|grep mysql*
2、查看有没有安装包
[root@localhost ~]#yum list mysql*
3、安装mysql客户端
[root@localhost ~]#yum install mysql

4、安装mysql服务端
提示:如果输入此命令没有报错,则跳过下面步骤,继续安装下一个服务端
1 [root@localhost ~]#yum install mysql-server

注意:此处错误提示为安装失败。
原因:CentOS7自带有MariaDB而不是MySQL,MariaDB和MySQL一样也是开元的数据库
解决方案:如果必须要安装MySQL,首先必须添加mysql社区repo通过输入命令:sudo rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

执行完后,则继续执行:yum install mysql-server

2 [root@localhost ~]#yum install mysql-devel

到此mysql数据库安装完成了,接下来需要对数据库进行一些简单配置
5、在/etc/my.cnf 文件中加入默认字符集
[root@localhost ~]#vim /etc/my.cnf

6、启动或关闭mysql服务
[root@localhost ~]#service mysqld start --启动mysql [root@localhost ~]#service mysqld stop --关闭mysql· [root@localhost ~]#lsof -i:3306 --数据库端口是否开启

7、设置开机启动mysql服务
[root@localhost ~]# chkconfig --add mysqld
8、创建root管理员
mysqladmin -u root password 密码
9、进入mysql容器中
mysql -u root -p

9、设置允许远程访问
开放防火墙的端口号
mysql增加权限:mysql库中的user表新增一条记录host为“%”,user为“root”。
use mysql; UPDATE user SET `Host` = '%' WHERE `User` = 'root' LIMIT 1;


%表示允许所有的ip访问
10、开放防火墙端口,允许外部访问
a、修改防火墙配置
vi /etc/sysconfig/iptables
加入:-A INPUT -p tcp -m tcp –dport 3306 -j ACCEPT 这段配置,然后进行保存

iptables基本命令
systemctl restart iptables.service -- 重启防火墙 systemctl status iptables.service -- 查看状态 service iptables save -- 保存规则 systemctl enable iptables.service -- 设置开机启动 systemctl start iptables.service -- 开启服务
注意:如果用的是阿里云服务器,需要配置安全组规则,否则无法访问
11、测试远程访问
我用的是SQLyog客户端进行连接,如果弹出该提示框,则表示连接成功!

Windows 10 是一款微软推出的经典操作系统,拥有硬件兼容性与多任务处理能力。它更偏向把系统状态查看和常用调节动作放在一起,适合需要持续观察和微调设备状态的场景。
极度公式是一款跨平台专业LaTeX公式识别编辑软件,支持OCR公式识别和多平台编辑。和使用说明,避免使用,享受完整功能与稳定支持。做扫描整理、文字提取和表格转换时,它能把识别后的处理步骤接得更顺,资料录入这类场景会省下不少时间。
















