linux下安装mysql(编译mysql源码)
编译所需软件地址
http://mysql.mirror.kangaroot.net/Downloads/ -- 下载需要的mysql版本例如mysql-5.5.39.tar.gz 目前还不太理解mysql那么多的安装包都是干嘛用的,先mark一下。下载的时候注意要下mysql-版本号.tar.gz的包。
http://www.cmake.org/files/v2.8/cmake-2.8.10.2.tar.gz
开始安装
1,安装cmake
1)下载Cmake
[root@test1 software]# wget http://www.cmake.org/files/v2.8/cmake-2.8.3.tar.gz

2)解压
[root@test1 software]# tar -zvxf cmake-2.8.3.tar.gz
3)进入解压后的文件夹
[root@test1 software]# cd cmake-2.8.3
4)生成安装文件
[root@test1 cmake-2.8.3]# ./configure
5)编译
[root@test1 cmake-2.8.3]# make
6)安装
[root@test1 cmake-2.8.3]# make install
2,安装mysql
2,安装mysql
1)下载mysql
[root@test1 software]# wget http://mysql.mirror.kangaroot.net/Downloads/MySQL-5.5/mysql-5.5.39.tar.gz
2)解压
[root@test1 software]# tar -zvxf mysql-5.5.39.tar.gz
3)创建mysql的安装目录及数据库存放目录
[root@test1 software]# mkdir -p /usr/local/mysql //安装mysql
[root@test1 software]# mkdir -p /usr/local/mysql/data //存放数据库
4)创建mysql用户及用户组
[root@test1 software]# groupadd mysql
[root@test1 software]# useradd -r -g mysql mysql
5)进入到mysql的文件夹
[root@test1 software]# cd mysql-5.5.39
6)生成安装文件
[root@test1 mysql-5.5.39]#cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_MEMORY_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DENABLED_LOCAL_INFILE=1 \
-DMYSQL_DATADIR=/usr/local/mysql/data \
-DMYSQL_USER=mysql \
-DMYSQL_TCP_PORT=3306
7)编译
[root@test1 mysql-5.5.39]# make
8)安装
[root@test1 mysql-5.5.39]# make install
配置mysql
9)设置mysql目录权限 mysql/mysql
[root@test1 mysql]#cd /usr/local/mysql //把当前目录中所有文件的所有者设为root,所属组为mysql
[root@test1 mysql]# chown -R mysql:mysql /usr/local/mysql
10)将mysql的启动服务添加到系统服务中并设置开机启动
[root@test1 mysql]# cp support-files/my-small.cnf /etc/my.cnf
cp: overwrite `/etc/my.cnf'? y
[root@test1 mysql]# cp support-files/mysql.server /etc/init.d/mysqld
[root@test1 mysql]#cd /etc/init.d/
[root@test1 init.d]#chkconfig --add mysqld
11)创建系统数据库表
[root@test1 mysql]# scripts/mysql_install_db --user=mysql
12)设置系统环境变量
[root@test1 mysql]# vi /root/.bash_profile

[root@test1 mysql]# source /root/.bash_profile
14)启动mysql
[root@test1 mysql]# service mysqld start
Starting MySQL.. SUCCESS!
--------------------------------------------------------------------------------------------------------------
遇到问题
[root@test1 cmake-2.8.]# ./configure
---------------------------------------------
CMake 2.8., Copyright - Kitware, Inc.
---------------------------------------------
Error when bootstrapping CMake:
Cannot find appropriate C compiler on this system.
Please specify one using environment variable CC.
See cmake_bootstrap.log for compilers attempted. ---------------------------------------------
Log of errors: /home/software/cmake-2.8./Bootstrap.cmk/cmake_bootstrap.log
缺少C的编译环境
[root@test1 cmake-2.8.3]# yum install gcc
[root@test1 cmake-2.8.]# ./configure
---------------------------------------------
CMake 2.8., Copyright - Kitware, Inc.
C compiler on this system is: cc
---------------------------------------------
Error when bootstrapping CMake:
Cannot find appropriate C++ compiler on this system.
Please specify one using environment variable CXX.
See cmake_bootstrap.log for compilers attempted.
---------------------------------------------
Log of errors: /home/software/cmake-2.8./Bootstrap.cmk/cmake_bootstrap.log
缺少C++编译器
[root@test1 cmake-2.8.3]# yum install gcc-c++
注:yum安装需要root权限
远程连接mysql的服务器的时候,出现2003 - Can't connect to MySQL server on '192.168.1.80'(10038)。
mysql服务器的防火墙没有关闭。
查看防火墙的状态
service iptable status
关闭防火墙的办法
1) 重启后生效
开启: chkconfig iptables on
关闭: chkconfig iptables off
2) 即时生效,重启后失效
开启: service iptables start
关闭: service iptables stop
-------------------------------------------------------------------------------------------------------------------------
在安装了N遍之后终于安装成功了。里面的很多原理还不甚清楚。安装过程中也参考可很多网友的博客,在此一一谢过。

linux下安装mysql(编译mysql源码)的更多相关文章
- Linux下安装方法总结(源码安装)
很久之前安装过windows下以及Mac下的node,感觉还是很方便的,不成想今天安装Linux下的坑了老半天,特此记录. 首先去官网下载代码,这里一定要注意安装分两种,一种是Source Code源 ...
- MySQL入门——在Linux下安装和卸载MySQL
MySQL入门——在Linux下安装和卸载MySQL 摘要:本文主要学习了如何在Linux系统中安装和卸载MySQL数据库. 查看有没有安装过MySQL 使用命令查看有没有安装过: [root@loc ...
- 在linux下安装并配置mysql数据库
在linux下安装并配置mysql数据库 工具/原料 MySql5.6 CentOS 方法/步骤 1 查找以前是否安装有mysql,使用下面命令: rpm -qa|grep -i mysql ...
- linux下使用gdb对php源码调试
title: linux下使用gdb对php源码调试 date: 2018-02-11 17:59:08 tags: --- linux下使用gdb进行php调试 调试了一些php的漏洞,记录一下大概 ...
- 在Linux下安装和使用MySQL
[简 介] 想使用Linux已经很长时间了,由于没有硬性任务一直也没有系统学习,近日由于工作需要必须使用Linux下的MySQL.本以为有Windows下使用SQL Server的经验,觉得在Linu ...
- Ubuntu12.04编译Android4.0.1源码全过程-----附wubi安装ubuntu编译android源码硬盘空间不够的问题解决
昨晚在编译源码,make一段时间之后报错如下: # A fatal error has been detected by the Java Runtime Environment: # # SIGSE ...
- linux下安装nginx+php+mysql环境 详细教程
话不多说上代码 linux环境:centos 7.0 64位 nginx:nginx-1.8.0.tar.gz php: php-7.1.1.tar.gz mysql: mysql-5.6.21.ta ...
- 【Lamp】 Linux 下安装PHP+Apache+Mysql 手记
[0]写在最前 由于准备实习原因,今天又重温了Lamp的搭建过程,之前一直是看燕十八老师2012年的教程学习,因此今天也是拿了十八哥的lamp搭建笔记作参考.但这次按照笔记重新搭建,发现了很多问题,由 ...
- linux下安装和卸载mysql
卸载: 1 . rpm -qa | grep -i mysql命令查看已经安装过的组件. 2. 使用yum -y remove命令卸载已经安装的MySQL组件,使用下面的命令,对于上面已经安装 ...
- Linux下安装以及使用MySQL数据库
1.官网下载mysql数据库:https://dev.mysql.com/downloads/mysql/ 2.linux 下可直接下载:wget https://cdn.mysql.com//Dow ...
随机推荐
- shortcut to open a linux terminal
1) alt+ f2 2) input "gnome-terminal" 3) press "enter"
- source.list
deb http://www.anheng.com.cn/debian/ squeeze maindeb-src http://www.anheng.com.cn/debian/ squeeze ma ...
- 任意2个io直接驱动LCD1602,并且不需外加芯片(转)
http://www.amobbs.com/thread-4301955-1-1.html *此处只摘录部分内容,详细内容请关注原贴. 这就是电路,细心的朋友会发现实物图中有几个贴片的阻容件,秘密就在 ...
- 用JavaScript 来将数字转换成字符。
背景: 一切嵌入式设备上面的信息,比如设备名称,设备时区是可以写入到设备上面的寄存器中的(一个寄存器两个字节,2*8 bit),比如 -1 ,写入到寄存器中为 2d31,然后可以通过一些进程将寄存器中 ...
- android脚步---UI界面修改,增加按钮和监听
我的UU界面,其布局如下: 需要修改的部分: 意见反馈居中,还有增加backbutton 首先在mainactivity中找到我的UU的定义:dialogue public void showAbou ...
- initWithNibName与viewDidLoad的执行关系以及顺序
转载自:http://www.java123.net/v/380331.html 一个ViewController,一般通过init或initWithNibName来加载.二者没有什么不同,init最 ...
- kali系统安装
kali live 安装到U盘 http://www.backtrack.org.cn/thread-17197-1-1.html 用Live U盘安装Kali Linux http://cn.doc ...
- PAT (Advanced Level) 1054. The Dominant Color (20)
简单题 #include<cstdio> #include<cstring> #include<cmath> #include<vector> #inc ...
- POJ 3905 Perfect Election
2-SAT 裸题,搞之 #include<cstdio> #include<cstring> #include<cmath> #include<stack&g ...
- js 获取n天前的时间
<script type="text/javascript"> var strdate = new Date(); var begindate = strdate.ge ...