教程集 www.jiaochengji.com
教程集 >  数据库  >  mysql  >  正文 CentOS 6.3下源码编译安装MySQL 5.6

CentOS 6.3下源码编译安装MySQL 5.6

发布时间:2016-03-28   编辑:jiaochengji.com
介绍下CentOS 6.3下安装MySQL 5.6.10的方法,使用源码编译安装MySQL 5.6,有需要的朋友参考下。

Linux操作系统:CentOS 6.3
1、下载:当前mysql版本到了5.6.10
下载地址:http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.11.tar.gz

2、安装必要软件包
 

复制代码 代码示例:
yum -y install  gcc gcc-c++ gcc-g77 autoconf automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-devel* make cmake

3、开始编译安装(默认情况下是安装在/usr/local/mysql )
 

复制代码 代码示例:

[root@jbxue ~]# groupadd mysql
[root@jbxue ~]# useradd -r -g mysql mysql
[root@jbxue ~]# tar -zxvf mysql-5.6.10.tar.gz
[root@jbxue ~]# cd mysql-5.6.10
[root@jbxue mysql-5.6.10]# cmake .
[root@jbxue mysql-5.6.10]# make && make install
[root@jbxue ~]# chown -R mysql.mysql /usr/local/mysql
[root@jbxue ~]# cd /usr/local/mysql/scripts
[root@jbxue ~]# ./mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
[root@jbxue ~]# cd /usr/local/mysql/support-files
[root@jbxue support-files]# cp mysql.server /etc/rc.d/init.d/mysql
[root@jbxue support-files]# cp my-default.cnf /etc/my.cnf
[root@jbxue ~]# chkconfig -add mysql
[root@jbxue ~]# chkconfig mysql on
[root@jbxue ~]# ln -s /usr/local/mysql/lib/mysql /usr/lib/mysql
[root@jbxue ~]# ln -s /usr/local/mysql/include/mysql /usr/include/mysql
[root@jbxue ~]# ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql
[root@jbxue ~]# ln -s /usr/local/mysql/bin/mysqldump /usr/bin/mysqldump
[root@jbxue ~]# ln -s /usr/local/mysql/bin/myisamchk /usr/bin/myisamchk
[root@jbxue ~]# service mysql start
Starting MySQL SUCCESS!
[root@jbxue ~]# mysqladmin -u root password pwd
[root@jbxue ~]# mysql -uroot -ppwd
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.11 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.

4、开启远程连接权限
主机环境搭建之常用配置篇-Linux mysql 允许远程连接

通常,要在本地使用一些工具管理我们的数据库服务器,那么安装MySQL后,默认是不允许远程访问的,如何配置远程连接呢?
错误:
ERROR 1130: Host ’192.168.1.3′ is not allowed to connect to this MySQL server

解决方法:
 

复制代码 代码示例:
/usr/local/mysql/bin/mysql -u root -p (进入mysql)
use mysql;
select ‘host’ from user where ‘user’='root’;
update user set host = ‘%’ where ‘user’ = ‘root’;
flush privileges;

注意:在mysql 命令行形式下一定要输入”;”.

您可能感兴趣的文章:
CentOS 6.3下源码编译安装MySQL 5.6
mysql源码安装shell脚本
MySQL-5.6.13 zip解压版的安装与配置教程
安装MysQL出现No curses/termcap library found错误的解决方法
yum方式安装MySQL并设置密码
linux下mysql 5.5.8 源码编译安装
在CentOS-6.3中安装与配置Mysql-5.5.29
CentOS 6.5编译安装Percona 5.6.15(步骤)
CentOS6.4安装配置mysql 5.6服务器方法
学习centos安装php的mysql扩展

[关闭]
~ ~