配置LANMP环境(4)-- 安装MYSQL与安装相关软件,配置
一、安装MySQL 5.7
1.下载配置与安装
cd ~
wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
rpm -ivh mysql-community-release-el7-5.noarch.rpm
yum-config-manager --disable mysql56-community
yum-config-manager --enable mysql57-community-dmr
yum install mysql-community-server
安装完成后开始下面的配置操作
启动mysql:
systemctl start mysqld
开机自动启动mysql:
systemctl enable mysqld
查看mysql进程是否开启:
ps aux |grep mysql
查看初始密码:
grep 'temporary password' /var/log/mysqld.log
用初始密码登录:
mysql –uroot –p
降低密码安全等级:
mysql > set global validate_password_policy=0;
更改密码长度: mysql > set global validate_password_length=0;
修改密码:
mysql > alter user 'root'@'localhost' identified by 'XXXXXXXX(8位密码)';
进入mysql配置文件:
vim /etc/my.cnf > 添加 default_password_lifetime=0
开启root帐号的远程操作权限:
mysql > use mysql
mysql > GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'XXXXXXXX(root远程登录8位密码)' WITH GRANT OPTION;
重启mysql:
systemctl restart mysqld
执行:
set global sql_mode='';
开启binlog,直接在配置文件中添加以下配置,然后重启mysqld服务
log-bin=mysql-bin server-id=1 binlog_format=ROW
二、安装远程操作数据库客户端软件Navicat
1.傻瓜安装
2.操作
如果一切顺利,就可以在window系统上面用Navicat控制liunx系统的mysql数据库了。