Centos 5.5 安装Mysql5.5过程
这几天在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)
參考:
Centos 5.5 安装Mysql5.5过程的更多相关文章
- 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 ...
- Centos 7.6 安装Mysql5.7(离线)
Centos 7.6 安装Mysql5.7(离线) 标签(空格分隔): mysql 安装包下载 https://dev.mysql.com/downloads/mysql/ [image.png-14 ...
- centos下编译安装mysql5.5/5.6
2013年11月16日 19:39:13 centos 6 mysql 5.5.28 我只说些我出错的地方: cmake后删除的方法是 xargs rm < install_manifest.t ...
- centos下编译安装mysql5.5/5.6/5.7
2018-12-28 14:38:46 星期五 centos 系统在mysql官网, 按照教程去配置yum源, 然后安装, 不用自己找依赖了: https://dev.mysql.com/doc/my ...
- CentOS 6.5 安装MySQL5.7 RPM
一.新特性 MySQL 5.7可谓是一个令人激动的里程碑,在默认了InnoDB引擎的基础上,新增了ssl.json.虚拟列等新特性.相对于postgreSQL和MariaDB而言,MySQL5.7做了 ...
- centos 7下安装MySQL5.7 的安装和配置
原文链接: http://blog.csdn.net/xyang81/article/details/51759200 安装环境:CentOS7 64位 MINI版,安装MySQL5.7 1.配置Y ...
- centos系统下安装MySQL5.7.18
1.首先安装依赖包 yum install -y gcc gcc-c++ ncurses-devel perl openssl-devel 最最重要的是,不要忘了安装openssl-devel 2.安 ...
- Red Hat5下源码安装mysql5.6过程记录
1.安装cmake包 [root@edu soft]# tar -xzf cmake-.tar.Z [root@edu soft]# cd cmake- [root@edu cmake-]# ./co ...
- 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 ~]# ...
随机推荐
- BZOJ 1207: [HNOI2004]打鼹鼠( dp )
dp.. dp[ i ] = max( dp[ j ] + 1 ) ------------------------------------------------------------------ ...
- 09-C语言数组
目录: 一.使用xcode编辑工具 二.数组 三.数组遍历 四.多维数组 回到顶部 一.使用xcode编辑工具 1 打开xcode程序 2 创建一个项目 OSX -> Application - ...
- jQuery.ui autoComplete使用
官网 http://api.jqueryui.com/autocomplete/#option-source 参考了 http://www.cnblogs.com/lwme/archive/2012 ...
- MVC-07 案例1
>>>>>ContosoUniversity网站 ------------------------------------------- 一.并发冲突 1. 为什么会并发 ...
- Spring Boot Admin Reference Guide
1. What is Spring Boot Admin? Spring Boot Admin is a simple application to manage and monitor your S ...
- 带你走进EJB--MDB
在之前的文章中我们介绍了带你走进EJB--JMS 和 带你走进EJB--JMS编程模型 对JMS有了初步的了解, 作为EJB系列的文章我们会继续对EJB相关的内容做进一步深的学习和了解.而此次需要进行 ...
- STC12C5201AD AD采样+串口发送模板
#include<reg52.h> sfr ADC_CONTR = 0xBC; //ADC control register sfr ADC_RES = 0xBD; //ADC 8-bit ...
- 初次接触VC++载入自己定义LIB 即静态链接
分为两部分 第一部分 LIBproject 用来生成LIB文件 #ifndef _myfun #define _myfun int myfun(int x,int y) { return x+y; ...
- 积跬步,聚小流------关于UML类图
UML的存在 类图是使用频率比較高的UML图,它用于描写叙述系统中所含的类以及它们之间的相互关系,帮助人们简化对系统的理解,也是系统分析和设计阶段的重要产物,也是系统编码和測试的重要类型根据. UML ...
- document.execCommand()函数可用参数解析
隐藏在暗处的方法-execCommand() 关键字: javascript document document.execCommand()方法可用来执行很多我们无法实现的操作. execComman ...