1. 下载MySQL 5.6 下载页面:http://dev.mysql.com/downloads/mysql/此处选择“Red Hat Enterprise Linux 6 / Oracle Linux 6 (x86, 32-bit), RPM Bundle”下载,下载至/root/Downloads/目录下,下载文件名为“MySQL-5.6.15-1.el6.i686.rpm-bundle.tar”2. 解压tar包cd /root/Downloads/tar -xvf MySQL-5.6.15-1.el6.i686.rpm-bundle.tar3. 以RPM方式安装MySQL在RHEL系统中,必须先安装“MySQL-shared-compat-5.6.15-1.el6.i686.rpm”这个兼容包,然后才能安装server和client,否则安装时会出错。yum install MySQL-shared-compat-5.6.15-1.el6.i686.rpm # RHEL兼容包yum install MySQL-server-5.6.15-1.el6.i686.rpm # MySQL服务端程序yum install MySQL-client-5.6.15-1.el6.i686.rpm # MySQL客户端程序yum install MySQL-devel-5.6.15-1.el6.i686.rpm # MySQL的库和头文件yum install MySQL-shared-5.6.15-1.el6.i686.rpm # MySQL的共享库
执行mysql_install_db
yum install perl-Data_Dumper
4. 配置MySQL登录密码cat /root/.mysql_secret # 获取MySQL安装时生成的随机密码service mysql start # 启动MySQL服务mysql -uroot -p # 进入MySQL,使用之前获取的随机密码SET PASSWORD FOR 'root'@'localhost' = PASSWORD('password'); # 在MySQL命令行中设置root账户的密码为passwordquit # 退出MySQL命令行service mysql restart # 重新启动MySQL服务