源码安装Mysql 5.5

查看操作系统版本
  1. [root@MYSQL03 /]# uname -a
  2. Linux MYSQL03 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
  3. [root@MYSQL03 /]# cat /etc/redhat-release
  4. CentOS release 6.5 (Final)
所需软件:
    cmake-2.8.7.tar.gz
    mysql-5.5.23.tar.gz
    CentOS-6.5-x86_64-bin-DVD1.iso

1.配置yum源
    略

2 卸载系统自带的mysql
    [root@MYSQL03 /]# yum remove mysql-libs-5.1.71-1.el6.x86_64

2.编译安装cmake
  1. [root@MYSQL03 ~]# tar zxvf cmake-2.8.7.tar.gz -C /usr/local/src/
  2. [root@MYSQL03 ~]# cd /usr/local/src/cmake-2.8.7/
  3. [root@MYSQL03 ~]#./configure
  4. ---------------------------------------------
    CMake 2.8.7, Copyright 2000-2009 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: /usr/local/src/cmake-2.8.7/Bootstrap.cmk/cmake_bootstrap.log
    ---------------------------------------------
上面的错误是由于没有安装gcc编译器导致的,下面装gcc编译器
  1. [root@MYSQL03 cmake-2.8.7]# yum install gcc
再次安装
  1. [root@MYSQL03 cmake-2.8.7]# ./configure
  2. ---------------------------------------------
  3. CMake 2.8.7, Copyright 2000-2009 Kitware, Inc.
  4. C compiler on this system is: cc
  5. ---------------------------------------------
  6. Error when bootstrapping CMake:
  7. Cannot find appropriate C++ compiler on this system.
  8. Please specify one using environment variable CXX.
  9. See cmake_bootstrap.log for compilers attempted.
  10. ---------------------------------------------
  11. Log of errors: /usr/local/src/cmake-2.8.7/Bootstrap.cmk/cmake_bootstrap.log
  12. ---------------------------------------------
还缺少安装gcc-c++编译器, 下面安装gcc-c++编译器
  1. [root@MYSQL03 cmake-2.8.7]# yum install gcc-c++
再次安装
  1. [root@MYSQL03 cmake-2.8.7]# ./configure
  2. ......
  3. [root@MYSQL03 cmake-2.8.7]# gmake && make install
  4. .......
到这里,cmake 已经安装完成

3. 添加mysql 用户

  1. [root@MYSQL03 home]# useradd -u 27 -d /home/mysql/ -s /sbin/nologin mysql

4. 创建数据存储目录

  1. [root@MYSQL03 home]# mkdir -p /data/mysql
  2. [root@MYSQL03 home]# mkdir /data/mysql/mysql_log
  3. [root@MYSQL03 home]# chown -R mysql:mysql /data/mysql/
5. mysql编译安装
  1. [root@MYSQL03 MYSQL]# tar zxvf mysql-5.5.23.tar.gz -C /usr/local/src/
  2. [root@MYSQL03 MYSQL]# cd /usr/local/src/mysql-5.5.23/
  3. [root@MYSQL03 mysql-5.5.23]# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DDEFAULT_CHARSET=utf8 -DENABLED_LOCAL_INFILE=1 -DMYSQL_DATADIR=/data/mysql/ -DWITH_EXTRA_CHARSETS=all -DWITH_READLINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMYSQL_TCP_PORT=1333 -DDEFAULT_COLLATION=utf8_general_ci

  4. 报错
  5. .........
  6. CMake Error at cmake/readline.cmake:83 (MESSAGE):
  7.   Curses library not found. Please install appropriate package,

  8.       remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.
  9. Call Stack (most recent call first):
  10.   cmake/readline.cmake:118 (FIND_CURSES)
  11.   cmake/readline.cmake:214 (MYSQL_USE_BUNDLED_READLINE)
  12.   CMakeLists.txt:268 (MYSQL_CHECK_READLINE)
解决错误:
  1. [root@MYSQL03 mysql-5.5.23]# yum install ncurses-devel
  2. [root@MYSQL03 mysql-5.5.23]# rm -f CMakeCache.txt
再次执行编译:
  1. [root@MYSQL03 mysql-5.5.23]# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DDEFAULT_CHARSET=utf8 -DENABLED_LOCAL_INFILE=1 -DMYSQL_DATADIR=/data/mysql/ -DWITH_EXTRA_CHARSETS=all -DWITH_READLINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMYSQL_TCP_PORT=1333 -DDEFAULT_COLLATION=utf8_general_ci
  2. [root@MYSQL03 mysql-5.5.23]# make && make install
6. 生成mysql的配置文件
  1. [root@MYSQL03 mysql-5.5.23]# cd /usr/local/mysql/support-files/
  2. [root@MYSQL03 support-files]# cp my-medium.cnf /etc/my.cnf
在my.cnf 中添加下面几个选项

datadir = /data/mysql

skip-name-resolve

innodb_flush_log_at_trx_commit = 2

bind-address = 服务器内网网卡地址(重要:不要让他监听在0.0.0.0上)

lower_case_table_names=1

long_query_time=1

slow_query_log=1

并检查1333端口是否被占用

7. 开始安装mysql

  1. [root@MYSQL03 support-files]# cd /usr/local/mysql/scripts/
  2. [root@MYSQL03 scripts]# ./mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/data/mysql/

  3. WARNING: The host 'MYSQL03' could not be looked up with resolveip.
    This probably means that your libc libraries are not 100 % compatible
    with this binary MySQL version. The MySQL daemon, mysqld, should work
    normally with the exception that host name resolving will not work.
    This means that you should use IP addresses instead of hostnames
    when specifying MySQL privileges !
    Installing MySQL system tables...
    OK
    Filling help tables...
    OK


    To start mysqld at boot time you have to copy
    support-files/mysql.server to the right place for your system


    PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
    To do so, start the server, then issue the following commands:


    /usr/local/mysql//bin/mysqladmin -u root password 'new-password'
    /usr/local/mysql//bin/mysqladmin -u root -h 127.0.0.1
    127.0.0.1 password 'new-password'


    Alternatively you can run:
    /usr/local/mysql//bin/mysql_secure_installation


    which will also give you the option of removing the test
    databases and anonymous user created by default.  This is
    strongly recommended for production servers.


    See the manual for more instructions.


    You can start the MySQL daemon with:
    cd /usr/local/mysql/ ; /usr/local/mysql//bin/mysqld_safe &


    You can test the MySQL daemon with mysql-test-run.pl
    cd /usr/local/mysql//mysql-test ; perl mysql-test-run.pl


    Please report any problems with the /usr/local/mysql//scripts/mysqlbug script!

8. 启动mysql

  1. [root@MYSQL03 scripts]# cd /usr/local/mysql/support-files
  2. [root@MYSQL03 support-files]# cp mysql.server /etc/init.d/mysqld
  3. [root@MYSQL03 mysql]# vim /etc/profile
  4. 最后面加上
  5. export PATH=/usr/local/mysql/bin:$PATH

  6. [root@MYSQL03 mysql]# . /etc/profile
9. 登陆mysql 修改密码
  1. [root@MYSQL03 mysql]# mysql
  2. Welcome to the MySQL monitor. Commands end with ; or \g.
  3. Your MySQL connection id is 1
  4. Server version: 5.5.23-log Source distribution

  5. Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

  6. Oracle is a registered trademark of Oracle Corporation and/or its
  7. affiliates. Other names may be trademarks of their respective
  8. owners.

  9. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

  10. mysql> select user,host,password from mysql.user;
  11. +------+-----------+----------+
  12. | user | host | password |
  13. +------+-----------+----------+
  14. | root | localhost | |
  15. | root | MYSQL03 | |
  16. | root | 127.0.0.1 | |
  17. | root | ::1 | |
  18. | | localhost | |
  19. | | MYSQL03 | |
  20. +------+-----------+----------+
  21. 6 rows in set (0.00 sec)

  22. mysql> update mysql.user set password=password('123456') where user='root';
  23. Query OK, 4 rows affected (0.00 sec)
  24. Rows matched: 4 Changed: 4 Warnings: 0

  25. mysql> delete from mysql.user where user='';
  26. Query OK, 2 rows affected (0.00 sec)

  27. mysql> flush privileges;
  28. Query OK, 0 rows affected (0.00 sec)

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/30150152/viewspace-1755695/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/30150152/viewspace-1755695/

数据治理是确保数据准确性、可靠性、安全性、可用性和完整性的体系和框架。它定义了组织内部如何使用、存储、保护和共享数据的规则和流程。数据治理的重要性随着数字化转型的加速而日益凸显,它能够提高决策效率、增强业务竞争力、降低风险,并促进业务创新。有效的数据治理体系可以确保数据在采集、存储、处理、共享和保护等环节的合规性和有效性。 数据质量管理是数据治理中的关键环节,它涉及数据质量评估、数据清洗、标准化和监控。高质量的数据能够提升业务决策的准确性,优化业务流程,并挖掘潜在的商业价值。随着大数据和人工智能技术的发展,数据质量管理在确保数据准确性和可靠性方面的作用愈发重要。企业需要建立完善的数据质量管理和校验机制,并通过数据清洗和标准化提高数据质量。 数据安全与隐私保护是数据治理中的另一个重要领域。随着数据量的快速增长和互联网技术的迅速发展,数据安全与隐私保护面临前所未有的挑战。企业需要加强数据安全与隐私保护的法律法规和技术手段,采用数据加密、脱敏和备份恢复等技术手段,以及加强培训和教育,提高安全意识和技能水平。 数据流程管理与监控是确保数据质量、提高数据利用率、保护数据安全的重要环节。有效的数据流程管理可以确保数据流程的合规性和高效性,而实时监控则有助于及时发现并解决潜在问题。企业需要设计合理的数据流程架构,制定详细的数据管理流程规范,并运用数据审计和可视化技术手段进行监控。 数据资产管理是将数据视为组织的重要资产,通过有效的管理和利用,为组织带来经济价值。数据资产管理涵盖数据的整个生命周期,包括数据的创建、存储、处理、共享、使用和保护。它面临的挑战包括数据量的快速增长、数据类型的多样化和数据更新的迅速性。组织需要建立完善的数据管理体系,提高数据处理和分析能力,以应对这些挑战。同时,数据资产的分类与评估、共享与使用规范也是数据资产管理的重要组成部分,需要制定合理的标准和规范,确保数据共享的安全性和隐私保护,以及建立合理的利益分配和权益保障机制。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值