Mysql5.6.10源码安装步骤

时间:2022-09-22 12:26:06

Mysql5.6.10源码安装步骤

//MySQL 5.6.10源码安装步骤: 


系统环境:CentOS 5.6 
MySQL版本:mysql-5.6.10.tar.gz 

安装路径:/usr/local/mysql 
数据目录:/data/mysql/data 

CentOS 5.6 下MySQL 5.6源码安装 

Linux操作系统:CentOS 5.6

1:下载:当前mysql版本到了5.6.10 

下载地址:http://dev.mysql.com/downloads/mysql/5.6.html#downloads 
选择“Source Code” 
在此之前最好注册一个Oracle账号 

2:必要软件包 :
yum -y install gcc gcc-c++ gcc-g77 autoconf automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-devel* make cmake 
yum install bison 


3:编译安装 
[gcadmin004@xz2002 ~]$ sudo mkdir -p /usr/local/mysql5.6.10 
[gcadmin004@xz2002 ~]$ mkdir -p /data/mysql5.6.10 
mkdir: 无法创建目录"/data/mysql5.6.10": 权限不够 
[gcadmin004@xz2002 ~]$ sudo mkdir -p /data/mysql5.6.10 

[root@server1 ~]# groupadd mysql 

[root@server1 ~]# useradd -r -g mysql mysql 

[root@server1 ~]# tar -zxvf mysql-5.6.10.tar.gz 

[root@server1 ~]# cd mysql-5.6.10 

[root@server1 mysql-5.6.10]# cmake \ 
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql5.6.10 \ 
-DMYSQL_UNIX_ADDR=/tmp/mysql.sock \ 
-DDEFAULT_CHARSET=utf8 \ 
-DDEFAULT_COLLATION=utf8_general_ci \ 
-DWITH_MYISAM_STORAGE_ENGINE=1 \ 
-DWITH_INNOBASE_STORAGE_ENGINE=1 \ 
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \ 
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \ 
-DWITH_MEMORY_STORAGE_ENGINE=1 \ 
-DWITH_PARTITION_STORAGE_ENGINE=1 \ 
-DWITH_READLINE=1 \ 
-DENABLED_LOCAL_INFILE=1 \ 
-DMYSQL_DATADIR=/data/mysql5.6.10 \ 
-DMYSQL_USER=mysql \ 
-DMYSQL_TCP_PORT=3306 

[root@localhost mysql-5.6.11]# make install 

[root@localhost mysql-5.6.11]# chown -R mysql:mysql /usr/local/mysql5.6.10 
[root@localhost mysql-5.6.11]# chown -R mysql:mysql /data/mysql5.6.10 

[root@localhost scripts]# cd /usr/local/mysql5.6.10/scripts/ 

[root@localhost scripts]# ./mysql_install_db --user=mysql --basedir=/usr/local/mysql5.6.10 --datadir=/data/mysql5.6.10 

[root@localhost scripts]# cd /usr/local/mysql5.6.10/support-files 

[root@server1 support-files]# cp mysql.server /etc/init.d/mysqld 

[root@server1 support-files]# cp my-default.cnf /etc/my.cnf 

[root@server1 ~]# chkconfig --add mysqld 

[root@server1 ~]# chkconfig mysqld on 

[root@server1 ~]# service mysqld start 

Starting MySQL. SUCCESS! 



[root@server1 support-files]# mysql 

Welcome to the MySQL monitor. Commands end with ; or \g. 

Your MySQL connection id is 1 

Server version: 5.6.10 Source distribution 



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> 



//字符集检查 utf8 
show variables like 'char%'; 


//引擎检查 9个 ,插件43个


//添加Path路径 

//检查空用户,删除test数据库 

安装完毕。