由于新的mysql-5.5和以前版本相比,有了很多更新和改进,今天抽时间安装了一下新版的mysql。一下是安装笔记。
下载相关软件:
新版mysql:http://mirrors.sohu.com/mysql/MySQL-5.5/mysql-5.5.14.tar.gz
cmake:http://www.cmake.org/cmake/resources/software.html
安装环境RHEL5.4
1、安装cmake
- #tar zxf cmake-2.8.5.tar.gz
- #cd cmake-2.8.5
- #./bootstrap
- #make
- #make install
2、编译安装mysql-5.5.14
- useradd mysql
- tar zxf mysql-5.5.14.tar.g
- cd mysql-5.5.14
- CFLAGS="-O3" CXX=gcc
- CXXFLAGS="-O3 -felide-constructors -fno-exceptions -fno-rtti"
- cmake . -LH|more //CMake下查看MySQL的编译配置
- cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DEXTRA_CHARSETS=all
- make
- make install
- chown -R mysql:mysql /usr/local/mysql
- cp support-files/my-medium.cnf /etc/my.cnf
- cd /usr/local/mysql/
- ./scripts/mysql_install_db --user=mysql
- /usr/local/mysql/bin/mysqld_safe --user=mysql &
- /usr/local/mysql/bin/mysql
- Welcome to the MySQL monitor. Commands end with ; or \g.
- Your MySQL connection id is 2
- Server version: 5.5.14-log Source distribution
- Copyright (c) 2000, 2010, 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.01 sec
本文转自 fenghao.cn 51CTO博客,原文链接:http://blog.51cto.com/linuxguest/610093,如需转载请自行联系原作者