最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
问答文章1 问答文章501 问答文章1001 问答文章1501 问答文章2001 问答文章2501 问答文章3001 问答文章3501 问答文章4001 问答文章4501 问答文章5001 问答文章5501 问答文章6001 问答文章6501 问答文章7001 问答文章7501 问答文章8001 问答文章8501 问答文章9001 问答文章9501
当前位置: 首页 - 科技 - 知识百科 - 正文

Centos5.5安装Mysql5.5过程

来源:懂视网 责编:小采 时间:2020-11-09 08:28:21
文档

Centos5.5安装Mysql5.5过程

Centos5.5安装Mysql5.5过程:这几天在centos下装mysql,这里记录一下安装的过程,方便以后查阅 Mysql5.5.37安装需要cmake,5.6版本开始都需要cmake来编译,5.5以后的版本应该也要装这个。 安装cmake [root@local ~]# wget http://www.cmake.org/files/v2
推荐度:
导读Centos5.5安装Mysql5.5过程:这几天在centos下装mysql,这里记录一下安装的过程,方便以后查阅 Mysql5.5.37安装需要cmake,5.6版本开始都需要cmake来编译,5.5以后的版本应该也要装这个。 安装cmake [root@local ~]# wget http://www.cmake.org/files/v2

这几天在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@l

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

参考:

http://blog.csdn.net/mycwq/article/details/24488691

声明:本网页内容旨在传播知识,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

文档

Centos5.5安装Mysql5.5过程

Centos5.5安装Mysql5.5过程:这几天在centos下装mysql,这里记录一下安装的过程,方便以后查阅 Mysql5.5.37安装需要cmake,5.6版本开始都需要cmake来编译,5.5以后的版本应该也要装这个。 安装cmake [root@local ~]# wget http://www.cmake.org/files/v2
推荐度:
标签: 安装 过程 5.5
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top