测试连接
- 修改网卡配置,文件位置 /etc/sysconfig/network-scripts/ifcfg-ens32
TYPE=Ethernet
BOOTPROTO=dhcp //启动地址协议=使用dhcp协议
DEFROUTE=yes //将该接口设置为默认路由
NAME=ens33 //网络连接名字
DEVICE=ens33 //网卡名称
- 修改完重启
# systemctl restart network
# ip a
- 测试与外界是否连通
安装界面
# yum -y groups install "GNOME Desktop"
//下次自动启动
# systemctl set-default graphical.target
# reboot
安装Mysql
# yum install -y mysql
# service mysql start
# yum -y install wget
# wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
# rpm -ivh mysql-community-release-el7-5.noarch.rpm
# yum install mysql-sever
# systemctl status mysqld
# systemctl enable mysqld #开机自启动
# systemctl start mysql
# systemctl status mysqld #查看mysqld状态
# grep "password" /var/log/mysqld.log
# mysql-u root - p //输入默认密码
mysql> ALTER USER ‘root‘@‘localhost‘ IDENTIFIED BY ‘新密码‘;
mysql> SHOW VARIABLES LIKE ‘validate_password%‘;
- 简单密码不能通过的原因是mysql有完整的初始密码规则
mysql> SHOW VARIABLES LIKE ‘validate_password%‘;
+--------------------------------------+-------+
| Variable_name | Value |
+--------------------------------------+-------+
| validate_password_check_user_name | OFF |
| validate_password_dictionary_file | |
| validate_password_length | 4 |
| validate_password_mixed_case_count | 1 |
| validate_password_number_count | 1 |
| validate_password_policy | LOW |
| validate_password_special_char_count | 1 |
+--------------------------------------+-------+
7 rows in set (0.01 sec)
mysql> set global validate_password_policy=0;
mysql> set global validate_password_length=1;
mysql> ALTER USER ‘root‘@‘localhost‘ IDENTIFIED BY ‘r00t‘; //此时可以修改为较简单密码
grant all privileges on . to ‘test‘@‘%‘ identified by ‘test‘;
···
Centos7虚拟机首次安装后配置MYSQL(超详细)