linux安装mysql

1、 下载mysql源安装包
shell> wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
2、安装mysql源
shell> yum localinstall mysql57-community-release-el7-8.noarch.rpm

3、检查mysql源是否安装成功

shell> yum repolist enabled | grep "mysql.*-community.*"

4、安装mysql

shell> yum install mysql-community-server

5、启动mysql

shell> systemctl start mysqld

6、查看mysql的启动状态

7、开机启动

shell> systemctl enable mysqld
shell> systemctl daemon-reload

8、修改root本地登录密码

mysql安装完成之后,在/var/log/mysqld.log文件中给root生成了一个默认密码。通过下面的方式找到root默认密码,然后登录mysql进行修改:

shell> grep 'temporary password' /var/log/mysqld.log

shell>  mysql -u root -p

登录成功后修改密码:

set password=password("yourpassword");

9、重新启动mysql服务使配置生效:

systemctl restart mysqld

10、配置mysql远程连接

mysql -uroot -p  

输入密码登陆,

grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option;
flush privileges;
 

qq:1992093891

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值