这几天在centos下装mysql,这里记录一下安装的过程,方便以后查阅

Mysql5.5.37安装须要cmake,5.6版本号開始都须要cmake来编译,5.5以后的版本号应该也要装这个。

安装cmake

[root@local ~]# wget http://www.cmake.org/files/v2.8/cmake-2.8.12.2.tar.gz
[root@local ~]# tar xvf cmake-2.8.12.2.tar.gz
[root@local ~]# cd cmake-2.8.12.2
[root@local cmake-2.8.12.2]#./bootstrap
[root@local cmake-2.8.12.2]# make
[root@local cmake-2.8.12.2]# make install

安装mysql

[root@local ~]# wget http://cdn.mysql.com/Downloads/MySQL-5.5/mysql-5.5.37.tar.gz
[root@local ~]# tar xvf mysql-5.5.37.tar.gz
[root@local ~]# cd mysql-5.5.37
[root@local mysql-5.5.37]# cmake ./

可能还会报这个错,没有就跳过

CMake Error at cmake/readline.cmake:83(MESSAGE):
Curses library not found. Pleaseinstall appropriate package,
remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name islibncurses5-dev, on Redhat and derivates it is ncurses-devel.
Call Stack (most recent call first):
cmake/readline.cmake:127 (FIND_CURSES)
cmake/readline.cmake:217 (MYSQL_USE_BUNDLED_LIBEDIT)
CMakeLists.txt:355 (MYSQL_CHECK_READLINE
-- Configuring incomplete, errors occurred!
See also "/root/my/mysql-5.5.37/CMakeFiles/CMakeOutput.log".
See also"/root/my/mysql-5.5.37/CMakeFiles/CMakeError.log".

说明centos系统没有ncurses-devel

[root@local ~]# wget http://invisible-island.net/datafiles/release/ncurses.tar.gz
[root@local ~]# cd ncurses-5.9
[root@local ncurses-5.9]#./configure
[root@local ncurses-5.9]# make
[root@local ncurses-5.9]# make install

再删除刚才编译生成的 CMakeCache.txt 文件,否则无法进行下一步

[root@local mysql-5.5.37]# rm -f CMakeCache.txt

继续编译mysql

[root@local ~]# cmake ./
[root@local ~]# make
[root@local ~]# make install

这样,mysql默认将安装成功到/usr/local/mysql

创建mysql用户组

[root@local ~]# groupadd mysql
[root@local ~]# useradd –r –g mysql mysql
[root@local ~]# chown –R mysql.mysql /usr/local/mysql

启动mysql

[root@local ~]# /usr/local/mysql/bin/mysqld_safe --user=mysql

这里可能会错误发生,没有就跳过:

FATAL ERROR: Could not find./bin/my_print_defaults
If you compiled from source, you need torun 'make install' to
copy the software into the correct locationready for operation.
If you are using a binary release, you musteither be at the top
level of the extracted archive, or pass the --basedir option
pointing to that location.

解决方法:

[root@local ~]# /usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data

再启动mysql

[root@local ~]# /usr/local/mysql/bin/mysqld_safe --user=mysql

注冊mysql服务,开机自己主动启动

1.设置mysql配置文件到/etc文件夹

[root@local ~]# cp /usr/local/mysql/support-files/my-medium.cnf/etc/my.cnf

2.设置mysql开机自启

[root@local ~]# cp/usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
[root@local ~]# chmod +x /etc/init.d/mysql
[root@local ~]# /sbin/chkconfig --add mysql

3.启动mysql服务

[root@local ~]# service mysql start

測试mysql是否成功安装

[root@local ~]# /usr/local/mysql/bin/mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.37 Source distribution Copyright (c) 2000, 2014, Oracle and/or itsaffiliates. All rights reserved. Oracle is a registered trademark of OracleCorporation and/or its
affiliates. Other names may be trademarksof their respective
owners. Type 'help;' or '\h' for help. Type '\c' toclear the current input statement. mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.03 sec)

參考:

http://blog.csdn.net/mycwq/article/details/24488691

Centos 5.5 安装Mysql5.5过程的更多相关文章

  1. Centos 6.4 安装mysql-5.6.14-linux-glibc2.5-i686.tar.gz

    创建用户和组 创建链接 授权own和grp给mysql-5.5.8-linux2.6-i686文件夹,就是下面的BASE_DIR 执行的mysql_install_db的时候后面带参数 ./scrip ...

  2. Centos 7.6 安装Mysql5.7(离线)

    Centos 7.6 安装Mysql5.7(离线) 标签(空格分隔): mysql 安装包下载 https://dev.mysql.com/downloads/mysql/ [image.png-14 ...

  3. centos下编译安装mysql5.5/5.6

    2013年11月16日 19:39:13 centos 6 mysql 5.5.28 我只说些我出错的地方: cmake后删除的方法是 xargs rm < install_manifest.t ...

  4. centos下编译安装mysql5.5/5.6/5.7

    2018-12-28 14:38:46 星期五 centos 系统在mysql官网, 按照教程去配置yum源, 然后安装, 不用自己找依赖了: https://dev.mysql.com/doc/my ...

  5. CentOS 6.5 安装MySQL5.7 RPM

    一.新特性 MySQL 5.7可谓是一个令人激动的里程碑,在默认了InnoDB引擎的基础上,新增了ssl.json.虚拟列等新特性.相对于postgreSQL和MariaDB而言,MySQL5.7做了 ...

  6. centos 7下安装MySQL5.7 的安装和配置

    原文链接:  http://blog.csdn.net/xyang81/article/details/51759200 安装环境:CentOS7 64位 MINI版,安装MySQL5.7 1.配置Y ...

  7. centos系统下安装MySQL5.7.18

    1.首先安装依赖包 yum install -y gcc gcc-c++ ncurses-devel perl openssl-devel 最最重要的是,不要忘了安装openssl-devel 2.安 ...

  8. Red Hat5下源码安装mysql5.6过程记录

    1.安装cmake包 [root@edu soft]# tar -xzf cmake-.tar.Z [root@edu soft]# cd cmake- [root@edu cmake-]# ./co ...

  9. CentOS 6.5 安装 MySQL5.6 并用Navicat for MySQL 连接

    环境 : MySQL 5.6.21 64位 CentOS 6.5 64位 VMware 10 Navicat for MySQL 11 1.卸载自带mysql [root@localhost  ~]# ...

随机推荐

  1. 16进制的颜色怎么转换为我们iOS所用的RGB颜色

    这个我们就是可以直接宏定义到 我们的工程中,这样我们就可以用我们UI小妹,给我们16进制的颜色表示,愉快的编程了... #define UIColorFromRGB(rgbValue) [UIColo ...

  2. ExtJS002Window创建

    Ext.onReady(function () { Ext.create('Ext.window.Window', { title: 'window', width: 400, height: 300 ...

  3. POJ 2778 DNA Sequence(AC自动机+矩阵快速幂)

    题目链接:http://poj.org/problem?id=2778 题意:有m种DNA序列是有疾病的,问有多少种长度为n的DNA序列不包含任何一种有疾病的DNA序列.(仅含A,T,C,G四个字符) ...

  4. 《码农周刊》干货精选(Python 篇)

    <码农周刊>已经累计发送了 38 期,我们将干货内容进行了精选.此为 Python 篇. <码农周刊>往期回顾:http://weekly.manong.io/issues/ ...

  5. 我用过的Linux命令--修改主机名

    下面的所有设置都是在CentOS中实验的,其他的Linux系统的玩法是一样的,只是配置文件的目录可能不一样. 局域网中的主机名类似于广域网中的域名,修改主机名有两种方式: (1)在当前会话中修改主机名 ...

  6. mybatis日记配置Log4j

    拷贝log4j-1.2.16.jar到项目lib下 方式一是在src下新建一个log4j.xml文件,其具体内容如下 <?xml version="1.0" encoding ...

  7. linux历史发展

    1.什么是开源? 开源就是软件和源代码都是公开的. 可以修改(完善作者的代码)和创建自己的软件. 2.免费软件不同于自由软件,虽然它是免费的,但他不公布源代码,共享软件与免费软件有点类似,其初起是不收 ...

  8. C++标准程序库的输入输出流(I/O Stream)复制文件(4种方法)

    使用C++标准程序库的输入输出流(I/O   Stream)复制文件,存在许多的方法, 方法一:逐个字符复制#include   <   fstream   > std::ifstream ...

  9. Java多线程编程中Future模式的详解

    Java多线程编程中,常用的多线程设计模式包括:Future模式.Master-Worker模式.Guarded Suspeionsion模式.不变模式和生产者-消费者模式等.这篇文章主要讲述Futu ...

  10. URL中#(井号)的作用(转)

    2010年9月,twitter改版. 一个显著变化,就是URL加入了"#!"符号.比如,改版前的用户主页网址为 http://twitter.com/username 改版后,就变 ...