linux centOS7.4 安装mysql5.7数据库

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/gu6020586/article/details/83541338

安装的是5.7版本

yum install lrzsz 安装上传工具 使用rz命令上传

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

# 安装mysql源 shell> yum localinstall mysql57-community-release-el7-8.noarch.rpm

验证是否安装好

yum repolist enabled | grep “mysql.*-community.*”

安装mysql

yum install mysql-community-server

启动mysql

systemctl start mysqld

service mysqld start

扫描二维码关注公众号,回复: 3778823 查看本文章

查看mysql启动状态

systemctl status mysqld

开机启动mysql

systemctl enable mysqld ystemctl daemon-reload

查看root临时生成的密码

grep ‘temporary password’ /var/log/mysqld.log (这个有用!)

grep ‘password’ /var/log/mysqld.log |head -n 1

//临时密码登录不上去

SET PASSWORD FOR ‘root’@’localhost’ = PASSWORD(‘Gu6020586!@#’);

// mysql登录root

mysql -uroot -p

、、更改密码 需要大小写字母数字加特殊符号

ALTER USER ‘root’@’localhost’ IDENTIFIED BY ‘密码’;

ALTER USER ‘root’@’localhost’ IDENTIFIED BY ‘Gu6020586!@#’;

//新增一个远程登录账户

GRANT ALL PRIVILEGES ON *.* TO ‘yangxin’@’%’ IDENTIFIED BY ‘Yangxin0917!’ WITH GRANT OPTION;

猜你喜欢

转载自blog.csdn.net/gu6020586/article/details/83541338