当前位置: 首页 > 编程笔记 >

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

杜阳泽
2023-03-14
本文向大家介绍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.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)  

 类似资料:
  • 本文向大家介绍centos 7安装mysql5.5的方法,包括了centos 7安装mysql5.5的方法的使用技巧和注意事项,需要的朋友参考一下 首先centos7 已经不支持mysql,因为收费了你懂得,所以内部集成了mariadb,而安装mysql的话会和mariadb的文件冲突,所以需要先卸载掉mariadb,以下为卸载mariadb,安装mysql的步骤。 #列出所有被安装的rpm pa

  • 本文向大家介绍centos 7安装mysql5.5和安装 mariadb使用的命令,包括了centos 7安装mysql5.5和安装 mariadb使用的命令的使用技巧和注意事项,需要的朋友参考一下 以前的Linux系统中数据库大部分是mysql,不过自从被sun收购之后,就没用集成在centos这些开源Linux系统中了,那么如果想用的话就需要自己安装了,首先centos7 已经不支持mysql

  • 本文向大家介绍Linux环境下MySQL-python安装过程分享,包括了Linux环境下MySQL-python安装过程分享的使用技巧和注意事项,需要的朋友参考一下 1. 首先确认python的版本为2.3.4以上,如果不是需要升级python的版本   python -V   检查python版本 2. 安装mysql, 比如安装在/usr/local/mysql目录下 3. 下载 MySQL

  • 我下载了Visual Studio Ultimate CTP 6的完整ISO。安装程序达到了90%左右,通过进度条进行测量,然后就卡在那里了。Superfetch、反恶意软件保护和其他后台进程的活动频繁,但进度条仍然死气沉沉。最终,后台任务活动在20分钟后消退,但进度条仍不动。 便宜的技巧:打开一个记事本窗口,并将其左边缘定位,使其完美地标记进度条的当前位置。如果进度条在大约一个小时内没有移动过记

  • 本文向大家介绍64位CentOs7源码安装mysql-5.6.35过程分享,包括了64位CentOs7源码安装mysql-5.6.35过程分享的使用技巧和注意事项,需要的朋友参考一下  首先安装依赖包,避免在安装过程中出现问题 [root@bogon liuzhen]# yum -y install gcc gcc-c++ [root@bogon liuzhen]# yum -y install

  • 我是一名学生,我试图在eclipse中使用EMF创建一个元模型。现在,我试图在我的元模型中添加一些OCL约束,所以,我尝试使用OCLinEcore。不幸的是,当我点击我的(*。ecore/open with/ocline core editor)它显示如下错误: 加载程序约束冲突:在解析重写的方法“org.eclipse.cocl.xtext.essentialocl.ui.contentassi