1.下载linux中mysql安装包
https://dev.mysql.com/downloads/mysql/5.5.html#downloads
服务端:MySQL-server-5.5.61-1.el6.x86_64.rpm
客户端:MySQL-client-5.5.61-1.el6.x86_64.rpm
2.首先,linux中原本含有mysql,先将其卸载
查询:rpm -qa | grep -i mysql
删除:rpm -e --nodeps 复制查询内容
3.安装
安装服务端:rpm -ivh MySQL-server-5.5.61-1.el6.x86_64.rpm
安装客户端:rpm -ivh MySQL-client-5.5.61-1.el6.x86_64.rpm
4.启动mysql服务
service mysql start
5.重置mysql密码
/usr/bin/mysqladmin -u root password 'root'
设置mysql允许远程连接
1.创建用户
create user test identified by '123456';
2.授权
grant all privileges on *.* to 'test'@'%'identified by '123456' with grant option;
3.生效
flush privileges;
4.进行连接测试