linux系统yum安装mysql

硅谷探秘者 3106 0 0

linux系统yum安装mysql

1.下载并安装MySQL官方的 Yum Repository

[root@localhost /]# wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
[root@localhost /]# yum -y install mysql57-community-release-el7-10.noarch.rpm

2.安装mysql

[root@localhost /]# yum -y install mysql-community-server

    出现这样的提示表示安装成功

menu.saveimg.savepath20190325111236.jpg



数据库设置

1.启动mysql

[root@localhost /]# systemctl start  mysqld.service

2.查看MySQL运行状态

[root@localhost /]# systemctl status mysqld.service

2.jpg


3.此时mysql已经运行,要进入mysql需要找出mysql默认的密码

[root@localhost /]# grep "password" /var/log/mysqld.log

    红框中就是初始密码

4.jpg


4.进入mysql

[root@localhost /]# mysql -uroot -p

此时不能做任何事情,因为MySQL默认必须修改密码之后才能操作数据库

[root@localhost /]# ALTER USER 'root'@'localhost' IDENTIFIED BY '新密码';

如果出现:ERROR 1819 (HY000): Your password does not satisfy the current policy requirements  错误

意思是你的密码不符合要求

执行:

mysql> set global validate_password_policy=0;
Query OK, 0 rows affected (0.00 sec)
mysql> set global validate_password_length=1;
Query OK, 0 rows affected (0.00 sec)

这时密码就可以设置成简单密码了

mysql> alter user 'root'@'localhost' identified by '123456';
Query OK, 0 rows affected (0.00 sec)


修改完密码以后就可以操作数据库了

6.jpg


5.可视化工具登录授权

[root@localhost /]# grant all on *.* to root@'%' identified by '数据库密码';

连接的时候记得开启3306端口http://www.jiajiajia.club/weblog/blog/artical/154

menu.saveimg.savepath20190325102005.jpg


6.卸载Yum Repository

[root@localhost /]# yum -y remove mysql57-community-release-el7-10.noarch






评论区
请写下您的评论...
暂无评论...
猜你喜欢
工具 1431 命令yum-yinstallgit查看版本git--version配置远程ssh,执行:gitconfig--globaluser.name"yourname"gitconfig
minio,linux 1076 / 使用wget下载minio的包wgethttps://dl.minio.io/server/minio/release/linux-amd64/minio 下载完成后赋予minio文件的执行权
linux 1067 一、erlang二、socat三、rabbitmq四、启动服务五、开启用户远程访问六、rabbitmq服务常用命令一、erlang文件下载地址:https://github.com
其他 4100 -yhttpd.x86_642.在线命令:yum-yinstallhttpd开启apache服务:systemctlstarthttpd.service设置apache服务开机启动:systemctlenablehttp
框架 1559 环境::centos7java环境:jdk1.8版本:elasticsearch-7.3.2elasticsearch下载官网:https://www.elastic.co/cn
weblog 1023 环境:centos7rabbitmq:rabbitmq-server-3.6.10-1.el7.noarch.rpmsocatyum-yinstallsocat
linux系统 1841 软件版本:一、linux版本:CentOS-7-x86_64-DVD-1708.iso下载地址:http://mirror.nsc.liu.se/centos-store/7.4.1708
linux系统 1794 linuxnginx1.检查和依赖[root@localhost~]#yum-yinstallgcczlibzlib-develpcre-developensslopenssl-devel2
归档
2018-11  12 2018-12  33 2019-01  28 2019-02  28 2019-03  32 2019-04  27 2019-05  33 2019-06  6 2019-07  12 2019-08  12 2019-09  21 2019-10  8 2019-11  15 2019-12  25 2020-01  9 2020-02  5 2020-03  16 2020-04  4 2020-06  1 2020-07  7 2020-08  13 2020-09  9 2020-10  5 2020-12  3 2021-01  1 2021-02  5 2021-03  7 2021-04  4 2021-05  4 2021-06  1 2021-07  7 2021-08  2 2021-09  8 2021-10  9 2021-11  16 2021-12  14 2022-01  7 2022-05  1 2022-08  3 2022-09  2 2022-10  2 2022-12  5 2023-01  3 2023-02  1 2023-03  4 2023-04  2 2023-06  3 2023-07  4 2023-08  1 2023-10  1 2024-02  1 2024-03  1 2024-04  1
标签
算法基础 linux 前端 c++ 数据结构 框架 数据库 计算机基础 储备知识 java基础 ASM 其他 深入理解java虚拟机 nginx git 消息中间件 搜索 maven redis docker dubbo vue 导入导出 软件使用 idea插件 协议 无聊的知识 jenkins springboot mqtt协议 keepalived minio mysql ensp 网络基础 xxl-job rabbitmq haproxy srs 音视频 webrtc javascript
目录
没有一个冬天不可逾越,没有一个春天不会来临。最慢的步伐不是跬步,而是徘徊,最快的脚步不是冲刺,而是坚持。