1.准备工作
从MySQL官网上分别下载mysql服务器端于客户端包。
下载地址如下:
http://downloads.mysql.com/archives/community/
进行server与client两个rpm包的下载,(注:好像还有个devel的rpm的包,在网上看着说可以先下下来,做为备用,但是我具体也不清楚其作用,若有了解的望给我留言告知,感激不尽!!!)
MySQL-server-5.6.10-1.el6.i686.rpm
MySQL-client-5.6.10-1.el6.i686.rpm
一般在linux下我们会自己建立一个/root/software,专用来放下载的软件,根据个人爱好,这样只是为了方便查找位置,养成良好的习惯而已。
2.检测系统是否安装MySQL
(1)进入系统后,检测是否安装mysql.
rpm -qa | grep -i mysql
若已安装,会出现以下:
(这个具体看你之前安装过什么样的版本)
MySQL-server-5.0.22-0.i386
MySQL-client-5.0.22-0.i386
那么输入以下命令删除它
rpm -ev MySQL-server-5.0.22-0.i386
rpm -ev MySQL-client-5.0.22-0.i386
****rpm -e --nodeps mysql-libs-5.1.71-1.el6.i686****
这个是linux上自带的,你查看时有这个,就用这命令进行删除
注意:若删除的时候,出现删除不成功,出现依赖的包,前提必须删除依赖项。
rpm -ev dovecot-1.0.7-7.el5.x86_64
3.安装MySQL
(1)第一步:安装mysql服务端,输入以下命令
rpm -ivh /opt/MySQL-server-5.5.15-1.linux2.6.x86_64.rpm
然后出现如下信息,这个都发出来,是给大家参考下:大家有时间可以细细看看这些英文。
[root@CentOS pyset]# rpm -ivh MySQL-server-5.6.10-1.el6.i686.rpm
Preparing... ########################################### [100%]
1:MySQL-server ########################################### [100%]
2016-05-14 12:24:02 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-05-14 12:24:03 12803 [Note] InnoDB: The InnoDB memory heap is disabled
2016-05-14 12:24:03 12803 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-05-14 12:24:03 12803 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-05-14 12:24:03 12803 [Note] InnoDB: CPU does not support crc32 instructions
2016-05-14 12:24:03 12803 [Note] InnoDB: Using Linux native AIO
2016-05-14 12:24:04 12803 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-05-14 12:24:07 12803 [Note] InnoDB: Completed initialization of buffer pool
2016-05-14 12:24:12 12803 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2016-05-14 12:24:12 12803 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2016-05-14 12:24:12 12803 [Note] InnoDB: Database physically writes the file full: wait...
2016-05-14 12:24:21 12803 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2016-05-14 12:24:57 12803 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2016-05-14 12:25:31 12803 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2016-05-14 12:25:31 12803 [Warning] InnoDB: New log files created, LSN=45781
2016-05-14 12:25:31 12803 [Note] InnoDB: Doublewrite buffer not found: creating new
2016-05-14 12:25:33 12803 [Note] InnoDB: Doublewrite buffer created
2016-05-14 12:25:33 12803 [Note] InnoDB: 128 rollback segment(s) are active.
2016-05-14 12:25:33 12803 [Warning] InnoDB: Creating foreign key constraint system tables.
2016-05-14 12:25:33 12803 [Note] InnoDB: Foreign key constraint system tables created
2016-05-14 12:25:33 12803 [Note] InnoDB: Creating tablespace and datafile system tables.
2016-05-14 12:25:33 12803 [Note] InnoDB: Tablespace and datafile system tables created.
2016-05-14 12:25:33 12803 [Note] InnoDB: Waiting for purge to start
2016-05-14 12:25:34 12803 [Note] InnoDB: 1.2.10 started; log sequence number 0
A random root password has been set. You will find it in '/root/.mysql_secret'.
2016-05-14 12:25:41 12803 [Note] Binlog end
2016-05-14 12:25:41 12803 [Note] InnoDB: FTS optimize thread exiting.
2016-05-14 12:25:41 12803 [Note] InnoDB: Starting shutdown...
2016-05-14 12:25:43 12803 [Note] InnoDB: Shutdown completed; log sequence number 1625977
2016-05-14 12:25:43 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-05-14 12:25:43 12830 [Note] InnoDB: The InnoDB memory heap is disabled
2016-05-14 12:25:43 12830 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-05-14 12:25:43 12830 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-05-14 12:25:43 12830 [Note] InnoDB: CPU does not support crc32 instructions
2016-05-14 12:25:43 12830 [Note] InnoDB: Using Linux native AIO
2016-05-14 12:25:43 12830 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-05-14 12:25:47 12830 [Note] InnoDB: Completed initialization of buffer pool
2016-05-14 12:25:47 12830 [Note] InnoDB: Highest supported file format is Barracuda.
2016-05-14 12:25:47 12830 [Note] InnoDB: 128 rollback segment(s) are active.
2016-05-14 12:25:47 12830 [Note] InnoDB: Waiting for purge to start
2016-05-14 12:25:48 12830 [Note] InnoDB: 1.2.10 started; log sequence number 1625977
2016-05-14 12:25:48 12830 [Note] Binlog end
2016-05-14 12:25:48 12830 [Note] InnoDB: FTS optimize thread exiting.
2016-05-14 12:25:48 12830 [Note] InnoDB: Starting shutdown...
2016-05-14 12:25:49 12830 [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
表示MySQL安装完成。
(2)检测mysql 3306是否安全打开
netstat -nat
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN
上面显示可以看出MySQL服务已经启动。
(3)安装mysql客户端
rpm -ivh /opt/ MySQL-client-5.5.15-1.linux2.6.x86_64.rpm
[root@CentOS pyset]# rpm -ivh MySQL-client-5.6.10-1.el6.i686.rpm
Preparing... ########################################### [100%]
1:MySQL-client ########################################### [100%]
显示安装完毕
本文也是转载过来,详情可见原文地址
请移步原文地址