CentOS 6.6部署MySQL+Nginx+PHP环境

CentOS 6.6部署MySQL+Nginx+PHP环境 mysql安装

下载mysql安装包


选择 Linux-Generic
选择Linux - Generic (glibc 2.5) (x86, 64-bit), RPM

下载完毕后放到自定义放置目录,本例中放置在/usr/local/software/mysql目录下

解压缩

tar -xf MySQL-5.6.22-1.linux_glibc2.5.x86_64.rpm-bundle.tar

在安装MySQL之前,先检查CentOS系统中是否已经安装了一个MySQL,如果已经安装先卸载,不然会导致安装新的MySQL失败。

rpm -qa | grep mysql --查看系统之前是否已安装MySQL。

mysql-libs-5.1.47-4.el6.i686

显示结果说明 CentOS6.0系统自带了一个MySQL,我们需要删除这个老版本,用root用户执行下面语句

rpm -e --nodeps mysql-libs-5.1.47-4.el6.i686

在删除MySQL的rpm后,还要进行一些扫尾操作
第一种善后处理:使用下面命令进行处理。

rm -rf /var/lib/mysql*

rm -rf /usr/share/mysql*
另一种善后处理:卸载后 /var/lib/mysql 中的 /etc/my.cnf 会重命名为 my.cnf.rpmsave,/var/log/mysqld.log 会重命名为 /var/log/mysqld.log.rpmsave,如果确定没用后就手工删除。

开始安装mysql服务器

执行命令:

rpm -ivh MySQL-server-5.6.22-1.linux_glibc2.5.x86_64.rpm

结果如下:

Preparing… ########################################### [100%]
1:MySQL-server ########################################### [100%]
warning: user mysql does not exist - using root
warning: group mysql does not exist - using root
2014-08-10 22:43:44 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use –explicit_defaults_for_timestamp server option (see documentation for more details).
2014-08-10 22:43:44 23012 [Note] InnoDB: Using atomics to ref count buffer pool pages
2014-08-10 22:43:44 23012 [Note] InnoDB: The InnoDB memory heap is disabled
2014-08-10 22:43:44 23012 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-08-10 22:43:44 23012 [Note] InnoDB: Memory barrier is not used
2014-08-10 22:43:44 23012 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-08-10 22:43:44 23012 [Note] InnoDB: Using Linux native AIO
2014-08-10 22:43:44 23012 [Note] InnoDB: Not using CPU crc32 instructions
2014-08-10 22:43:44 23012 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2014-08-10 22:43:44 23012 [Note] InnoDB: Completed initialization of buffer pool
2014-08-10 22:43:45 23012 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2014-08-10 22:43:45 23012 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2014-08-10 22:43:45 23012 [Note] InnoDB: Database physically writes the file full: wait…
2014-08-10 22:43:45 23012 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2014-08-10 22:43:46 23012 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2014-08-10 22:43:46 23012 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2014-08-10 22:43:46 23012 [Warning] InnoDB: New log files created, LSN=45781
2014-08-10 22:43:46 23012 [Note] InnoDB: Doublewrite buffer not found: creating new
2014-08-10 22:43:46 23012 [Note] InnoDB: Doublewrite buffer created
2014-08-10 22:43:46 23012 [Note] InnoDB: 128 rollback segment(s) are active.
2014-08-10 22:43:46 23012 [Warning] InnoDB: Creating foreign key constraint system tables.
2014-08-10 22:43:47 23012 [Note] InnoDB: Foreign key constraint system tables created
2014-08-10 22:43:47 23012 [Note] InnoDB: Creating tablespace and datafile system tables.
2014-08-10 22:43:47 23012 [Note] InnoDB: Tablespace and datafile system tables created.
2014-08-10 22:43:47 23012 [Note] InnoDB: Waiting for purge to start
2014-08-10 22:43:47 23012 [Note] InnoDB: 5.6.22 started; log sequence number 0
A random root password has been set. You will find it in ‘/root/.mysql_secret’.
2014-08-10 22:43:48 23012 [Note] Binlog end
2014-08-10 22:43:48 23012 [Note] InnoDB: FTS optimize thread exiting.
2014-08-10 22:43:48 23012 [Note] InnoDB: Starting shutdown…
2014-08-10 22:43:50 23012 [Note] InnoDB: Shutdown completed; log sequence number 1625977

2014-08-10 22:43:50 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use –explicit_defaults_for_timestamp server option (see documentation for more details).
2014-08-10 22:43:50 23039 [Note] InnoDB: Using atomics to ref count buffer pool pages
2014-08-10 22:43:50 23039 [Note] InnoDB: The InnoDB memory heap is disabled
2014-08-10 22:43:50 23039 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-08-10 22:43:50 23039 [Note] InnoDB: Memory barrier is not used
2014-08-10 22:43:50 23039 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-08-10 22:43:50 23039 [Note] InnoDB: Using Linux native AIO
2014-08-10 22:43:50 23039 [Note] InnoDB: Not using CPU crc32 instructions
2014-08-10 22:43:50 23039 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2014-08-10 22:43:50 23039 [Note] InnoDB: Completed initialization of buffer pool
2014-08-10 22:43:50 23039 [Note] InnoDB: Highest supported file format is Barracuda.
2014-08-10 22:43:50 23039 [Note] InnoDB: 128 rollback segment(s) are active.
2014-08-10 22:43:50 23039 [Note] InnoDB: Waiting for purge to start
2014-08-10 22:43:50 23039 [Note] InnoDB: 5.6.22 started; log sequence number 1625977
2014-08-10 22:43:50 23039 [Note] Binlog end
2014-08-10 22:43:50 23039 [Note] InnoDB: FTS optimize thread exiting.
2014-08-10 22:43:50 23039 [Note] InnoDB: Starting shutdown…
2014-08-10 22:43:52 23039 [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’.

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/84459a42242b5d474c6cd531f82b88b7.html