如何在centos6.8中安装mysql5.5

[html]  view plain  copy
  1. /etc/init.d/mysql  

本来想安装mysql5.6或者5.7的,无奈,总是安装出错,所以改为安装5.5

安装步骤

1.确保把yum的mysql源删除干净

Code:
yum clean all
Code:
yum clean metadata
Code:
yum clean dbcache
Code:
yum update

2.安装mysql 5.5

[plain]  view plain  copy
  1. wget http://dev.mysql.com/get/Downloads/MySQL-5.5/MySQL-server-5.5.48-1.el6.x86_64.rpm  
  2. wget http://dev.mysql.com/get/Downloads/MySQL-5.5/MySQL-client-5.5.48-1.el6.x86_64.rpm  
  3. wget http://dev.mysql.com/get/Downloads/MySQL-5.5/MySQL-devel-5.5.48-1.el6.x86_64.rpm  
  4. rpm -ivh MySQL-server-5.5.48-1.el6.x86_64.rpm  
  5. rpm -ivh MySQL-client-5.5.48-1.el6.x86_64.rpm  
  6. rpm -ivh MySQL-devel-5.5.48-1.el6.x86_64.rpm  
3.设置root可以远程登录

1.启动mysql

[html]  view plain  copy
  1. /etc/init.d/msyql start  
2.设置mysql的root密码

[html]  view plain  copy
  1. /usr/bin/mysqladmin -u root password '123456'  

3.设置远程登录


a本地登录mysql

mysql -u root –p

  b update user set host ='%' where user= 'root';

c:flush privileges

你可能感兴趣的:(运维)