在Virtual Box安装好CentOS起来后,还需要做一些修改配置。


1)网络配置,进行如下的修改。这样,每次启动后,就可以自动获取动态IP。

这对于你安装多个虚拟系统非常有帮助。以后,我介绍MySQL Cluster可能需要很多台虚拟机器。

vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE="eth0"
BOOTPROTO="dhcp"
HWADDR="08:00:27:02:6e:05"
NM_CONTROLLED="yes"
ONBOOT="yes"
TYPE="Ethernet"
UUID="fd7f93f5-4816-49f0-850e-ae6e67382170"


2)配置ftp,可方便你在本地电脑与虚拟机间传送文件

先安装ftp包。这个需要你配置虚拟机为NAT网络,这样才能连接外网。

#yum install vsftpd
#yum install ftp


a).关闭/开启/重启防火墙
/etc/init.d/iptables stop   #start 开启   #restart 重启  
b).永久性关闭防火墙
chkconfig --level 35 iptables off   /etc/init.d/iptables stop   iptables -P INPUT DROP  
c)关闭SELINUX,以免FTP无法上传
编辑/etc/selinux/config,找到SELINUX 行修改成为:SELINUX=disabled

d)开机自启动ftp服务

chkconfig --level 35 vsftpd on


3)安装libaio包,这个包在安装MySQL前需要使用

#yum install libaio*


4)关闭虚拟机,配置虚拟机网络启动方式为Host Only,再重新启动虚拟机

使用ifconfig查看服务器的ip地址,通常为192.168.56.101。

通过ftp把相关的MySQL文件传送到虚拟机。如下

你可使用

"rpm -ivh" 安装如下4个包,如此服务器就配置好了。

MySQL-shared-advanced-5.6.14-1.el6.x86_64
MySQL-server-advanced-5.6.14-1.el6.x86_64
MySQL-client-advanced-5.6.14-1.el6.x86_64
MySQL-devel-advanced-5.6.14-1.el6.x86_64


5)安装好后,你可以通过/etc/init.d/mysql start/stop 启动、停止服务

成功后,你应该可以通过如下方式连接服务器。

# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1973
Server version: 5.6.14-enterprise-commercial-advanced-log MySQL Enterprise Server - Advanced Edition (Commercial)

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>


祝你好运