配置安装mySQL
1. 卸载Linux自带的mysql组件
yum remove mysql mysql-server mysql-libs compat-mysql151 –y
2. 下载软件包
MySQL-client-5.5.62-1.el7.x86_64.rpm
MySQL-devel-5.5.62-1.el7.x86_64.rpm
MySQL-server-5.5.62-1.el7.x86_64.rpm
MySQL-shared-5.5.62-1.el7.x86_64.rpm
3. 注意安装顺序
rpm -ivh MySQL-devel-5.5.62-1.el7.x86_64.rpm
rpm -ivh MySQL-shared-5.5.62-1.el7.x86_64.rpm
rpm -ivh MySQL-client-5.5.62-1.el7.x86_64.rpm
安装依赖
yum install perl
yum -y install autoconf
rpm -ivh MySQL-server-5.5.62-1.el7.x86_64.rpm
4. 把/usr/share/mysql中的my-huge.cnf复制到/etc下,并重命名成my.cnf
cp /usr/share/mysql/my-huge.cnf /etc/my.cnf
5. 启动mysql服务
systemctl start mysql
6. 进入mysql
mysql
//选择系统数据库
use mysql;
//设置密码
update user set password=password(‘123456’) where user=‘root’;
//退出mysql
exit;
重启服务
systemctl restart mysql
//登录验证
mysql -u root –p
//展示当前所有数据库实例
show database;
设置其他机器可以远程访问mysql
1. 进入mysql
2. 授权
grant all privileges on . to ‘root’ @’%’ identified by ‘123456’ with grant option;
3. 写入权限
flush privileges;
4. 重启服务器
systemctl restart mysql
尝试使用navicat连接(请保存防火墙关闭,Linux防火墙开启时不能连接成功)