虚拟机安装mysql日志

因项目开发需要安装mysql数据库,之前博主也安装过mysql但是只在windows下,这次我尝试在linux虚拟机上安装,现在将安装步骤整理发布,希望可以帮助到其他人。
1.安装rz命令,博主是新装的虚拟机很多命令都没有,因为要上传文件所以首先要安装rz命令 yum install lrzsz -y
2.上传mysql压缩包mysql-5.7.13-1.el6.x86_64.rpm-bundle.tar,如果没有rpm文件也可以直接在linux上通过wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.12-1.el6.x86_64.rpm-bundle.tar命令下载(这种方式需要首先安装wget命令 yum install wget -y)
3.解压压缩包到指定目录下# tar -xvf mysql-5.7.13-1.el6.x86_64.rpm-bundle.tar
这里写图片描述
4.安装rpm文件# yum install mysql-community-{server,client,common,libs}-*
这里写图片描述
5.安装完毕,启动mysql:# service mysqld start
这里写图片描述
6.mysql默认登录名为root地址localhost,启动后可以通过# grep ‘temporary password’ /var/log/mysqld.log命令查询临时密码
这里写图片描述
7.登陆mysql;

[root@localhost mysql]# mysql -uroot -p
Enter password: (这里输入上面查出来的临时密码)
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.13

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

8.修改密码并退出:因为mysql要求密码要包含至少一个大写字母,一个小写字母,一个数字,一个特殊字符,总数至少是8位所以我们设定密码为Passwd0

mysql> alter user root@localhost identified by 'Passwd0';
Query OK, 0 rows affected (0.00 sec)
mysal>exit
Bye
[root@localhost mysql]#

9.查看服务
这里写图片描述
至此mysql安装成功!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

夜雪天晴

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值