1、首先第一步是安装好CentOS 6.6
先下载好centos 6.6,然后,在虚拟机中安装好系统。
需要安装vmware tools,由于VMware Tools这个目录中包含了空格,所以要用 \ 来转义空格:
[root@ggg1 Desktop]# cd /media/VMware\ Tools [root@ggg1 Desktop]# tar -zvxf VMwareTools-9.2.0-799703.tar.gz -C /root/Desktop
安装后,就可以从LInux中复制粘贴。
2、下载MysqL 5.6
MysqL的下载地址是在 网页 http://downloads.MysqL.com/archives/community/ 中,我选择了MysqL 5.6.12版,具体的rpm包是:MysqL-server-5.6.12-2.el6.x86_64.rpm。
通过wget命令来下载,指定的下载地址是:http://dev.MysqL.com/get/Downloads/MysqL-5.6/MysqL-server-5.6.12-2.el6.x86_64.rpm
[root@wc1 Desktop]# wget http://dev.MysqL.com/get/Downloads/MysqL-5.6/MysqL-server-5.6.12-2.el6.x86_64.rpm --2016-08-16 11:34:47-- http://dev.MysqL.com/get/Downloads/MysqL-5.6/MysqL-server-5.6.12-2.el6.x86_64.rpm Resolving dev.MysqL.com... 137.254.60.11 Connecting to dev.MysqL.com|137.254.60.11|:80... connected. HTTP request sent,awaiting response... 302 Found Location: http://cdn.MysqL.com//archives/MysqL-5.6/MysqL-server-5.6.12-2.el6.x86_64.rpm [following] --2016-08-16 11:34:49-- http://cdn.MysqL.com//archives/MysqL-5.6/MysqL-server-5.6.12-2.el6.x86_64.rpm Resolving cdn.MysqL.com... 104.102.164.25 Connecting to cdn.MysqL.com|104.102.164.25|:80... connected. HTTP request sent,awaiting response... 200 OK Length: 57355800 (55M) [application/x-redhat-package-manager] Saving to: “MysqL-server-5.6.12-2.el6.x86_64.rpm” 100%[======================================>] 57,355,800 645K/s in 3m 25s 2016-08-16 11:38:15 (273 KB/s) - “MysqL-server-5.6.12-2.el6.x86_64.rpm” saved [57355800/57355800]
3、安装MysqL
运行如下命令来安装,但是并没有安装,显示有冲突,从字面的意思看出,大致上是我要安装的rpm包,和之前的MysqL-libs-5.1.73-3.el6_5.x86_64 有冲突:
[root@wc1 Desktop]# rpm -ivh MysqL-server-5.6.12-2.el6.x86_64.rpm Preparing... ########################################### [100%] file /usr/share/MysqL/czech/errmsg.sys from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/danish/errmsg.sys from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/dutch/errmsg.sys from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/english/errmsg.sys from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/estonian/errmsg.sys from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/french/errmsg.sys from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/german/errmsg.sys from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/greek/errmsg.sys from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/hungarian/errmsg.sys from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/italian/errmsg.sys from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/japanese/errmsg.sys from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/korean/errmsg.sys from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/norwegian-ny/errmsg.sys from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/norwegian/errmsg.sys from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/polish/errmsg.sys from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/portuguese/errmsg.sys from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/romanian/errmsg.sys from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/russian/errmsg.sys from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/serbian/errmsg.sys from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/slovak/errmsg.sys from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/spanish/errmsg.sys from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/swedish/errmsg.sys from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/ukrainian/errmsg.sys from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/charsets/Index.xml from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/charsets/armscii8.xml from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/charsets/ascii.xml from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/charsets/cp1250.xml from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/charsets/cp1256.xml from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/charsets/cp1257.xml from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/charsets/cp850.xml from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/charsets/cp852.xml from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/charsets/cp866.xml from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/charsets/dec8.xml from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/charsets/geostd8.xml from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/charsets/greek.xml from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/charsets/hebrew.xml from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/charsets/hp8.xml from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/charsets/keybcs2.xml from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/charsets/koi8r.xml from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/charsets/koi8u.xml from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/charsets/latin1.xml from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/charsets/latin2.xml from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/charsets/latin5.xml from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/charsets/latin7.xml from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/charsets/macce.xml from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/charsets/macroman.xml from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64 file /usr/share/MysqL/charsets/swe7.xml from install of MysqL-server-5.6.12-2.el6.x86_64 conflicts with file from package MysqL-libs-5.1.73-3.el6_5.x86_64
通过如下命令,删除MysqL-libs包,同时忽略软件包的依赖关系:
[root@wc1 Desktop]# rpm -e MysqL-libs --nodeps
再次尝试安装:
[root@wc1 Desktop]# rpm -ivh MysqL-server-5.6.12-2.el6.x86_64.rpm Preparing... ########################################### [100%] 1:MysqL-server ########################################### [100%] 2016-08-16 11:46:37 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2016-08-16 11:46:37 4680 [Note] InnoDB: The InnoDB memory heap is disabled 2016-08-16 11:46:37 4680 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 2016-08-16 11:46:37 4680 [Note] InnoDB: Compressed tables use zlib 1.2.3 2016-08-16 11:46:37 4680 [Note] InnoDB: Using Linux native AIO 2016-08-16 11:46:37 4680 [Note] InnoDB: Using cpu crc32 instructions 2016-08-16 11:46:37 4680 [Note] InnoDB: Initializing buffer pool,size = 128.0M 2016-08-16 11:46:37 4680 [Note] InnoDB: Completed initialization of buffer pool 2016-08-16 11:46:37 4680 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created! 2016-08-16 11:46:37 4680 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB 2016-08-16 11:46:37 4680 [Note] InnoDB: Database physically writes the file full: wait... 2016-08-16 11:46:38 4680 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB 2016-08-16 11:46:39 4680 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB 2016-08-16 11:46:40 4680 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0 2016-08-16 11:46:40 4680 [Warning] InnoDB: New log files created,LSN=45781 2016-08-16 11:46:40 4680 [Note] InnoDB: Doublewrite buffer not found: creating new 2016-08-16 11:46:40 4680 [Note] InnoDB: Doublewrite buffer created 2016-08-16 11:46:40 4680 [Note] InnoDB: 128 rollback segment(s) are active. 2016-08-16 11:46:40 4680 [Warning] InnoDB: Creating foreign key constraint system tables. 2016-08-16 11:46:40 4680 [Note] InnoDB: Foreign key constraint system tables created 2016-08-16 11:46:40 4680 [Note] InnoDB: Creating tablespace and datafile system tables. 2016-08-16 11:46:40 4680 [Note] InnoDB: Tablespace and datafile system tables created. 2016-08-16 11:46:40 4680 [Note] InnoDB: Waiting for purge to start 2016-08-16 11:46:40 4680 [Note] InnoDB: 5.6.12 started; log sequence number 0 A random root password has been set. You will find it in '/root/.MysqL_secret'. 2016-08-16 11:46:42 4680 [Note] Binlog end 2016-08-16 11:46:42 4680 [Note] InnoDB: FTS optimize thread exiting. 2016-08-16 11:46:42 4680 [Note] InnoDB: Starting shutdown... 2016-08-16 11:46:44 4680 [Note] InnoDB: Shutdown completed; log sequence number 1625977 2016-08-16 11:46:44 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2016-08-16 11:46:44 4705 [Note] InnoDB: The InnoDB memory heap is disabled 2016-08-16 11:46:44 4705 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 2016-08-16 11:46:44 4705 [Note] InnoDB: Compressed tables use zlib 1.2.3 2016-08-16 11:46:44 4705 [Note] InnoDB: Using Linux native AIO 2016-08-16 11:46:44 4705 [Note] InnoDB: Using cpu crc32 instructions 2016-08-16 11:46:44 4705 [Note] InnoDB: Initializing buffer pool,size = 128.0M 2016-08-16 11:46:44 4705 [Note] InnoDB: Completed initialization of buffer pool 2016-08-16 11:46:44 4705 [Note] InnoDB: Highest supported file format is Barracuda. 2016-08-16 11:46:44 4705 [Note] InnoDB: 128 rollback segment(s) are active. 2016-08-16 11:46:44 4705 [Note] InnoDB: Waiting for purge to start 2016-08-16 11:46:44 4705 [Note] InnoDB: 5.6.12 started; log sequence number 1625977 2016-08-16 11:46:45 4705 [Note] Binlog end 2016-08-16 11:46:45 4705 [Note] InnoDB: FTS optimize thread exiting. 2016-08-16 11:46:45 4705 [Note] InnoDB: Starting shutdown... 2016-08-16 11:46:46 4705 [Note] InnoDB: Shutdown completed; log sequence number 1625987 A RANDOM PASSWORD HAS BEEN SET FOR THE MysqL root USER ! You will find that password in '/root/.MysqL_secret'. You must change that password on your first connect,no other statement but 'SET PASSWORD' will be accepted. See the manual for the semantics of the 'password expired' flag. Also,the account for the anonymous user has been removed. In addition,you can run: /usr/bin/MysqL_secure_installation which will also give you the option of removing the test database. This is strongly recommended for production servers. See the manual for more instructions. Please report any problems with the /usr/bin/MysqLbug script! The latest information about MysqL is available on the web at http://www.MysqL.com Support MysqL by buying support/licenses at http://shop.MysqL.com New default config file was created as /usr/my.cnf and will be used by default by the server when you start it. You may edit this file to change server settings [root@wc1 Desktop]#
从上面的安装日志中,能够看到很多有用的信息,比如:
A RANDOM PASSWORD HAS BEEN SET FOR THE MysqL root USER !
You will find that password in '/root/.MysqL_secret'.
至此,安装成功
4、下载并安装MysqL 客户端
安装好了MysqL之后,我们需要连接到MysqL,但是由于MysqL-server并不包含客户端,所以还要下载客户端。
先下载:
[root@wc1 Desktop]# wget http://dev.MysqL.com/get/Downloads/MysqL-5.6/MysqL-client-5.6.12-2.el6.x86_64.rpm --2016-08-16 13:20:48-- http://dev.MysqL.com/get/Downloads/MysqL-5.6/MysqL-client-5.6.12-2.el6.x86_64.rpm Resolving dev.MysqL.com... 137.254.60.11 Connecting to dev.MysqL.com|137.254.60.11|:80... connected. HTTP request sent,awaiting response... 302 Found Location: http://cdn.MysqL.com//archives/MysqL-5.6/MysqL-client-5.6.12-2.el6.x86_64.rpm [following] --2016-08-16 13:20:50-- http://cdn.MysqL.com//archives/MysqL-5.6/MysqL-client-5.6.12-2.el6.x86_64.rpm Resolving cdn.MysqL.com... 23.42.233.185 Connecting to cdn.MysqL.com|23.42.233.185|:80... connected. HTTP request sent,awaiting response... 200 OK Length: 18527048 (18M) [application/x-redhat-package-manager] Saving to: “MysqL-client-5.6.12-2.el6.x86_64.rpm” 100%[======================================>] 18,527,048 959K/s in 31s 2016-08-16 13:21:24 (582 KB/s) - “MysqL-client-5.6.12-2.el6.x86_64.rpm” saved [18527048/18527048]
然后安装:
[root@wc1 Desktop]# rpm -ivh MysqL-client-5.6.12-2.el6.x86_64.rpmPreparing... ########################################### [100%] 1:MysqL-client ########################################### [100%]
5、启动MysqL
[root@wc1 Desktop]# service MysqL start Starting MysqL.... [ OK ]
[root@wc1 Desktop]# chkconfig --list | grep MysqL MysqL 0:off 1:off 2:on 3:on 4:on 5:on 6:off
如果没有设置,可以通过如下命令来设置:
[root@wc1 Desktop]# chkconfig MysqL on
6、登录MysqL
要登录MysqL,就得有密码,而密码就在这个文件里'/root/.MysqL_secret'.
于是找到这个文件,这里ls的参数a只指显示所有隐藏的文件,包含以点开头的,而l参数表示显示详细列表:
[root@wc1 ~]# ls -al | grep 'secret' -rw-------. 1 root root 96 Aug 16 11:46 .MysqL_secret [root@wc1 ~]# cat .MysqL_secret # The random password set for the root user at Tue Aug 16 11:46:41 2016 (local time): 6g2niot5
登录MysqL: @H_403_86@[root@wc1 ~]# MysqL -uroot -p Enter password: Welcome to the MysqL monitor. Commands end with ; or \g. Your MysqL connection id is 5 Server version: 5.6.12 MysqL Community Server (GPL) 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> set password for root@"wc1.localdomain" = password("yupeigu"); Query OK,1 rows affected (0.03 sec)
给用户授权,并刷新权限:
MysqL> grant all privileges on *.* to root@'%' identified by 'yupeigu' with grant option; Query OK,0 rows affected (0.03 sec) MysqL> flush privileges; Query OK,0 rows affected (0.02 sec)原文链接:https://www.f2er.com/centos/381162.html