mysql-5.5 for linux源代码安装

1.使用Yum安装依赖软件包

# yum install -y gcc gcc-c++ gcc-g77 autoconf automake bison zlib* fiex* \

libxml* ncurses-devel libmcrypt* libtool-ltdl-devel*

 

2.安装cmake

# yum install -y cmake

 

3.解压缩并编译安装MySQL源代码包

 

# tar xzvf mysql-5.5.27.tar.gz

# mv mysql-5.5.27 mysql

# cd mysql

 

#配置编译(參考:http://dev.mysql.com/doc/refman/5.5/en/source-configuration-options.html)

# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \

-DSYSCONFDIR=/usrl/local/mysql/etc \

-DMYSQL_DATADIR=/usr/local/mysql/data \

-DMYSQL_TCP_PORT=3306 \

-DMYSQL_UNIX_ADDR=/tmp/mysql.sock \

-DMYSQL_USER=mysql \

-DDEFAULT_CHARSET=utf8 \

-DDEFAULT_COLLATION=utf8_general_ci \

-DWITH_EXTRA_CHARSETS=all \

-DWITH_READLINE=1 \

-DWITH_SSL=system \

-DWITH_EMBEDDED_SERVER=1 \

-DENABLED_LOCAL_INFILE=1 \

-DWITH_MYISAM_STORAGE_ENGINE=1 \

-DWITH_MEMORY_STORAGE_ENGINE=1 \

-DWITH_INNOBASE_STORAGE_ENGINE=1

 

# make 

# make install

 

注意事项:

又一次编译时,须要清除旧的对象文件和缓存信息。

# make clean

# rm -f CMakeCache.txt

 

4.加入mysql用户及用户组并改动文件夹全部权限

[root@ttt mysql]# groupadd mysql

[root@ttt mysql]# useradd -r -g mysql mysql

[root@ttt mysql]# chown -R mysql /usr/local/mysql

[root@ttt mysql]# chgrp -R mysql /usr/local/mysql

 

 

5.安装基础数据库并复制演示样例配置文件

# cd /usr/local/mysql

# chmod +x scripts/*

[root@ttt mysql]#  ./scripts/mysql_install_db --basedir=/usr/local/mysql \

--datadir=/usr/local/mysql/data --user=mysql

 

# cp /usr/local/mysql/support-files/my-medium.cnf /etc/my.cnf

 

[root@ttt ~]# export PATH=$PATH:/usr/local/mysql/bin    //全局宣告mysql命令的路径

[root@ttt ~]# echo "PATH=$PATH:/usr/local/mysql/bin" >> /etc/profile   //写入开机启动文件

 

6.注冊mysql系统服务并启动mysql

 

[root@ttt mysql]# chmod 755 support-files/mysql.server

[root@ttt mysql]# ls -l support-files/mysql.server

-rwxr-xr-x 1 mysql mysql 10650 6月  22 19:21 support-files/mysql.server

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

[root@ttt mysql]# chown root.root /etc/init.d/mysql

[root@ttt mysql]# chkconfig --add mysql

[root@ttt mysql]# chkconfig --level 35 mysql on

[root@ttt mysql]# chkconfig --list mysql

mysql           0:关闭  1:关闭  2:启用  3:启用  4:启用  5:启用  6:关闭

[root@ttt mysql]# service mysql start

Starting MySQL...                                          [确定]

[root@ttt mysql]# netstat -ltu |grep mysql

tcp        0      0 *:mysql               *:*                   LISTEN

[root@ttt mysql]# ps -ef | grep mysql

root     15492     1  0 21:00 pts/0    00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe 

--datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/ttt.pid

mysql    15744 15492  0 21:00 pts/0    00:00:00 /usr/local/mysql/bin/mysqld --

basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-

dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/data/ttt.err 

--pid-file=/usr/local/mysql/data/ttt.pid --socket=/tmp/mysql.sock --port=3306

root     15896  1098  0 21:10 pts/0    00:00:00 grep mysql

 

7.安装完毕。启动mysql数据库。进入測试

 

[root@ttt ~]# mysql -u root

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

Your MySQL connection id is 3

Server version: 5.5.27-log Source distribution

 

Copyright (c) 2000, 2011, 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> show databases;

+--------------------+

| Database           |

+--------------------+

| information_schema |

| mysql              |

| performance_schema |

| test               |

+--------------------+

4 rows in set (0.00 sec)

 

mysql> use mysql

Database changed

mysql> show tables;

+---------------------------+

| Tables_in_mysql           |

+---------------------------+

| columns_priv              |

| db                        |

| event                     |

| func                      |

| general_log               |

| help_category             |

| help_keyword              |

| help_relation             |

| help_topic                |

| host                      |

| ndb_binlog_index          |

| plugin                    |

| proc                      |

| procs_priv                |

| proxies_priv              |

| servers                   |

| slow_log                  |

| tables_priv               |

| time_zone                 |

| time_zone_leap_second     |

| time_zone_name            |

| time_zone_transition      |

| time_zone_transition_type |

| user                      |

+---------------------------+

24 rows in set (0.00 sec)

 

mysql>

 

8.改动mysql数据库root用户密码并登录验证

 

[root@ttt ~]# mysqladmin -u root password 'mysqlpass'  --给“root”用户设置一个密码

[root@ttt ~]# mysql -u root -p

Enter password:

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

Your MySQL connection id is 5

Server version: 5.5.27-log Source distribution

 

Copyright (c) 2000, 2011, 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> show databases;

+--------------------+

| Database           |

+--------------------+

| information_schema |

| mysql              |

| performance_schema |

| test               |

+--------------------+

4 rows in set (0.00 sec)

 

mysql> 

 

 

 

 

mysql-5.5 for linux源代码安装的更多相关文章

  1. linux 源代码安装mysql5.5

    linux下源代码安装mysql过程例如以下: yum update yum upgrade yum install -y vim man wget yum install -y gcc gcc-c+ ...

  2. linux源代码安装程序

    下载源代码之后 tar zxvf file.tar.gz      解压源代码压缩包 ./configure --prefix=/opt/haha/  安装到这个路径 make  编译 sudo ma ...

  3. Linux 通过源代码安装和编译程序

    Linux源代码安装在平常工作学习中经常用到,总结下步骤↓↓↓ 第一步:#mount /dev/cdrom/mnt (挂载一个软盘) 第二步:手动安装httpd-2.4.25.tar.gz 依赖关系包 ...

  4. 阿里云服务器Linux CentOS安装配置(零)目录

    阿里云服务器Linux CentOS安装配置(零)目录 阿里云服务器Linux CentOS安装配置(一)购买阿里云服务器 阿里云服务器Linux CentOS安装配置(二)yum安装svn 阿里云服 ...

  5. SUSE Linux源代码编译安装MySQL 5.6

    这篇文章主要介绍了SUSE Linux下源代码编译方式安装MySQL 5.6过程分享,本文使用SUSE Linux Enterprise Server 10 SP3 (x86_64)系统,须要的朋友能 ...

  6. 源代码安装 MySQL 5.6.28

    本文内容 创建 MySQL 用户和组 解压 MySQL 源代码包 生成配置安装文件 编译和安装 MySQL 配置文件 创建 MySQL 授权表 MySQL 目录授权 启动 MySQL 验证 MySQL ...

  7. linux下安装Mysql 以及导入数据库

    1.下载mysql的rpm包,创建一个文件夹例如software来放置下面文件 可以通过wget下载具体的地址 (1)MySQL-server-5.6.10-1.rhel5.x86_64.rpm:My ...

  8. 源代码安装软件-MySQL

    一.源码安装 1.经典的源代码安装三步曲: 1.编译前的配置 ./configure 2.编译 make 3.安装 make install 2.源代码软件安装步骤: 1.下载软件包 2.校验软件包 ...

  9. mysql数据库在Linux下安装与配置

      mysql是一种开放源代码的关系型数据库系统(RDBMS),使用最常用的数据库管理语言--结构化查询语句(SQL)进行数据库管理. 由于mysql的开源,因此任何人都可以在General Publ ...

随机推荐

  1. SSRS 报表中的Chart在IE中不显示

    解决办法: 重启SSRS服务...

  2. vs2015中的数据库架构对比工具(New Schema Comparison)

    大家都知道VS里的功能多到你根本没用过,今天来说说这个New Schema Comparison,他能做的事情就是在vs中对比我们两个数据库的架构.结构,并且能够更新过去或者生成脚本. Step.1( ...

  3. 配置内核源码make menuconfig时出现 #include CURSES_LOC错误

    配置内核时出现如下错误: liuxin@sunshine-virtual-machine:~/work/nfs_root/system/linux-2.6.22.6$ make menuconfig ...

  4. ASP.NET中让图片以二进制的形式存储在数据库中

    今早有个网友问到我这问题,以前我都是直接在数据库中存文件名的,还没有试过存储整张图片到数据库中,上网搜索了一下,自己又测试了一番,代码如下:建立保存图片的表的SQL语句: USE [niunantes ...

  5. 五、curator recipes之选举主节点Leader Latch

    简介 在分布式计算中,主节点选举是为了把某个进程作为主节点来控制其它节点的过程.在选举结束之前,我们不知道哪个节点会成为主节点.curator对于主节点选举有两种实现方式,本文示例演示Latch的实现 ...

  6. sql server web管理软件

    Sql server目前虽然没有mysql用户量大,但是微软的产品在易用性方面还是很不错的,有些政务类的项目还是用 Sql server数据库的, 目前有一款Sql server的web管理工具Tre ...

  7. python学习之老男孩python全栈第九期_day018知识点总结——正则表达式、re模块

    一. 正则表达式 正则表达式本身和python没有什么关系,就是匹配字符串内容的一种规则. 官方定义:正则表达式是对字符串操作的一种逻辑公式,就是用事先定义好的一些特定字符.及这些特定字符的组合,组成 ...

  8. UOJ#400. 【CTSC2018】暴力写挂

    传送门 看到要求两棵树的 \(lca\) 深度不太好操作 考虑枚举第二棵树的 \(lca\),这样剩下的都是只和第一棵树有关的 而注意到 \(dis(x,y)=d(x)+d(y)-2d(lca(x,y ...

  9. easy canvas shape with react antdesign 简单的canvas图形in antd & react

    //show: //code: import React from "react" import {findDOMNode} from 'react-dom' import { B ...

  10. Python 批量修改文件名并移动文件到指定目录

    # -*- coding: utf-8 -*- import os, sys,re,shutil from nt import chdir #读取中文路径 u'' path=u"D:\\zh ...