• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • MsSql
  • Mysql
  • oracle
  • MariaDB
  • DB2
  • SQLite
  • PostgreSQL
  • MongoDB
  • Redis
  • Access
  • 数据库其它
  • sybase
  • HBase
您的位置:首页 > 数据库 >Mysql > Centos5.5中安装Mysql5.5过程分享

Centos5.5中安装Mysql5.5过程分享

作者: 字体:[增加 减小] 来源:互联网 时间:2017-05-11

通过本文主要向大家介绍了mysql5.5安装过程,centos5.5,centos5.5 iso下载,centos5.5安装教程,centos5.5 64位下载等相关知识,希望本文的分享对您有所帮助

这几天在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
</div>

安装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 ./
</div>

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

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".
</div>

说明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
</div>

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

[root@local mysql-5.5.37]# rm -f CMakeCache.txt
</div>

继续编译mysql

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

这样,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
</div>

启动mysql

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

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

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.
</div>

解决方法:

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

再启动mysql

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

注册mysql服务,开机自动启动

1.设置mysql配置文件到/etc目录

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

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
</div>

3.启动mysql服务

[root@local ~]# service mysql start 
</div>

测试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;&nbs

分享到:QQ空间新浪微博腾讯微博微信百度贴吧QQ好友复制网址打印

您可能想查找下面的文章:

  • Centos5.5中安装Mysql5.5过程分享

相关文章

  • 2018-12-05Oracle 10g各个帐号的访问权限、登录路径、监控状态命令查询等等
  • 2018-12-05MYSQL知识点总结分享
  • 2018-12-05急求关于mysql数据库自动停止的问题
  • 2017-10-09java实现将图片存储到mysql数据库
  • 2018-12-05Myeclipse连接mysql数据库心得体会_MySQL
  • 2017-05-11mysql字符集乱码问题解决方法介绍
  • 2018-12-05教你怎么使用sql游标实例分享
  • 2017-05-11MySQL数据库迁移data文件夹位置详细步骤
  • 2018-12-05更新text字段时出现Row size too large报错应付措施
  • 2017-05-11MYSQL数据库导入数据时出现乱码的解决办法

文章分类

  • MsSql
  • Mysql
  • oracle
  • MariaDB
  • DB2
  • SQLite
  • PostgreSQL
  • MongoDB
  • Redis
  • Access
  • 数据库其它
  • sybase
  • HBase

最近更新的内容

    • 在Mysql开发中经常会掉进的坑 - 无法启动Mysql
    • SQL Server SQL Agent服务使用教程小结
    • mysql 提示INNODB错误的解决方法
    • mysql_两台服务器实现双机互备配置并测试数据同步
    • 关于消除重复行的详细介绍
    • 在sql Server中添加供应用程序使用的帐号
    • 重装mysql出现无法start service的问题的解决方法
    • 关于格式解析的9篇文章推荐
    • Mysql5.7.17在windows下安装启动时提示不成功问题的解决办法
    • MySQL学习笔记5:修改表(alter table)

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有