门门雨 2019-06-26
rpm -qa|grep -i mysql
rpm -e -nodeps 包名 --dedeps
上传到/usr/local/mysql文件夹,进行安装
rpm -ivh mysql-community-common-5.7.21-1.el6.x86_64.rpm rpm -ivh mysql-community-libs-5.7.21-1.el6.x86_64.rpm rpm -ivh mysql-community-client-5.7.21-1.el6.x86_64.rpm rpm -ivh mysql-community-server-5.7.21-1.el6.x86_64.rpm
/etc/init.d/mysqld start
5.7版本的话安装完后会生成一个随机密码,密码记录在log日志里,日志文件在/var/log/mysqld.log,
用vi或其他编辑器打开后搜索下root@localhost,后面跟着的无规则字符串就是密码,用户名是root,在本机服务器上登录。
set password for root@localhost = password('111111');
/etc/init.d/mysqld xxxxx
/etc/my.cnf
Mysql 主从同步
/etc/my.cnf
中可以找到错误日志的位置),一般可能是master那边防火墙没有开放3306端口.【解决】ERROR 2003 (HY000): Can't connect to MySQL server on "host" (113)
rpm -qa |grep yum
rpm -qa|grep yum|xargs rpm -e --nodeps
(不检查依赖,直接删除rpm包)rpm -qa|grep yum
(查询确认)rpm -e python-2.6.6-52.el6.x86_64 --nodeps
rpm -e python-libs-2.6.6-52.el6.x86_64 --nodeps
(如果不是这个版本的话,用rpm -qa|grep python-2.6
查一下再删 )
下载新的yum包。使用Centos6.5的yum包
cat /etc/redhat-release
我的是 Red Hat Enterprise Linux Server release 6.4 (Santiago)arch
---x86_64根据上一步,找到对应的yum包,然后下载(wget下载不下来的话弄个vpn直接去http://mirror.centos.org/cent...里面找,版本可能会变化)。我的服务器对应的为:
wget http://mirror.centos.org/centos/6/os/x86_64/Packages/yum-3.2.29- 73.el6.centos.noarch.rpm wget http://mirror.centos.org/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm wget http://mirror.centos.org/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm wget http://mirror.centos.org/centos/6/os/x86_64/Packages/python-2.6.6-66.el6_8.x86_64.rpm wget http://mirror.centos.org/centos/6/os/x86_64/Packages/python-libs-2.6.6-66.el6_8.x86_64.rpm
这几个rpm,我都放进了/usr/local/yum
安装rpm
cd /usr/local/yum rpm -ivh python-libs-2.6.6-66.el6_8.x86_64.rpm python-2.6.6-66.el6_8.x86_64.rpm --nodeps rpm -ivh --force python-urlgrabber-3.9.1-11.el6.noarch.rpm rpm -ivh yum*.rpm
更换yum源
cd /etc/yum.repos.d/ wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
编辑文件,把文件CentOS6-Base-163.repo
里面的$releasever
全部替换为版本号:6
(注意,不是6.4!)最后保存!
7 .清除原有缓存,重建缓存: yum makecache
8.更新系统: yum update
可以不更新。