当前位置 : 主页 > 网络编程 > 其它编程 >

Centos5.5安装Mysql5.5过程【MySQL】

来源:互联网 收集:自由互联 发布时间:2023-07-02
数据库|mysql教程mysql,记录数据库-mysql教程CentOSjdk源码,vscode转换编码格式,ubuntu查询显卡,tomcat怎么获取端口,爬虫箱湿度,phpgd 数据库|mysql教程 mysql,记录 数据库-mysql教程CentOS jdk 源码,vscode转
数据库|mysql教程mysql,记录数据库-mysql教程CentOSjdk源码,vscode转换编码格式,ubuntu查询显卡,tomcat怎么获取端口,爬虫箱湿度,phpgd 数据库|mysql教程Centos 5.5 安装Mysql5.5过程【MySQL】 mysql,记录 数据库-mysql教程CentOS jdk 源码,vscode转换编码格式,ubuntu 查询显卡,tomcat怎么获取端口,爬虫箱湿度,php gd 未安装,热门seo优化系统代理平台,网站源码记忆,destoon会员手机店铺模板lzw这几天在centos下装mysql,这里记录一下安装的过程,方便以后查阅java上传下载源码,ubuntu 32和64,tomcat下载文件功能,python 爬虫停顿,项目管理系统php,老河口市外包的seo怎么样lzwMysql5.5.37安装需要cmake,5.6版本开始都需要cmake来编译,5.5以后的版本应该也要装这个。ldd3 源码xiazai,vscode没有权限打开终端,sshfs ubuntu,tomcat下载官网8.5,sqlite 加法运算,网页设计 字体,服务器租用时间,jq中国地图插件,前端框架常用单词,爬虫人爱人,php引用传值,小谢seo,资源网站springboot,建设网站视频教程,圣诞祝福网页代码,海洋网站模板,修改后台编辑器,wordpress 新建一个页面,通用oa 权限管理系统源码,小程序源码二次开发lzw安装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 ~]# wgethttp://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_defaultsIf you compiled from source, you need torun 'make install' tocopy the software into the correct locationready for operation.If you are using a binary release, you musteither be at the toplevel of the extracted archive, or pass the --basedir optionpointing 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 -pEnter password: Welcome to the MySQL monitor.Commands end with ; or /g.Your MySQL connection id is 1Server 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 itsaffiliates. Other names may be trademarksof their respectiveowners. 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)

参考:

网友评论