最简单之在线安装mysql

1,下载Repo

wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm

2,安装repo

yum -y install mysql57-community-release-el7-10.noarch.rpm

3,安装MySQL服务

yum -y install mysql-community-server

 4,启动服务

systemctl start  mysqld
systemctl status mysqld

5,查看密码

grep "password" /var/log/mysqld.log

 6,修改密码

[root@192-168-**-** mysql5]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.7.28

Copyright (c) 2000, 2019, 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> ALTER USER 'root'@'localhost' IDENTIFIED BY '123abc****';
Query OK, 0 rows affected (0.01 sec)

PS:允许简单密码

set global validate_password_policy=0;

set global validate_password_length=1;

#修改完成后再使用

ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';

猜你喜欢

转载自www.cnblogs.com/CGCong/p/12021169.html