Login
网站首页 > 文章中心 > 其它

centos_7.0_编译_安装mysql_5.6.22_过程_已完成~_成功~_撒花~

作者:小编 更新时间:2023-08-06 11:26:30 浏览量:485人看过

GitHub https://github.com/mysql/mysql-server

http://www.cmake.org/


[root@localhost src]# wget http://www.cmake.org/files/v③1/cmake-③1.1.tar.gz
--2015-01-28 10:40:27-- http://www.cmake.org/files/v③1/cmake-③1.1.tar.gz
正在解析主机 www.cmake.org (www.cmake.org)... 6⑥19④25③19
正在连接 www.cmake.org (www.cmake.org)|6⑥19④25③19|:80... 已连接.
已发出 HTTP 请求,正在等待回应... 200 OK
长度:5959421 (⑤7M) [application/x-gzip]
正在保存至: "cmake-③1.1.tar.gz"

100%[======================================>] 5,959,421 494KB/s 用时 11s

2015-01-28 10:40:39 (524 KB/s) - 已保存 "cmake-③1.1.tar.gz" [5959421/5959421])

[root@localhost src]# wget http://ftp.gnu.org/gnu/make/make-④1.tar.gz
--2015-01-28 11:22:09-- http://ftp.gnu.org/gnu/make/make-④1.tar.gz
正在解析主机 ftp.gnu.org (ftp.gnu.org)... 20⑧11⑧23⑤20, 2001:4830:134:3::b
正在连接 ftp.gnu.org (ftp.gnu.org)|20⑧11⑧23⑤20|:80... 已连接.
已发出 HTTP 请求,正在等待回应... 200 OK
长度:1878787 (1.8M) [application/x-gzip]
正在保存至: "make-④1.tar.gz"

100%[======================================>] 1,878,787 3③1KB/s 用时 65s

2015-01-28 11:23:16 (2⑧0 KB/s) - 已保存 "make-④1.tar.gz" [1878787/1878787])

解压

[root@localhost src]tar zxvf make-④1.tar.gz -C /usr/local/bin
[root@localhost src]# cd /usr/local/bin/make-④1
[root@localhost make-④1]# ls
ABOUT-NLS dep.h load.c README.VMS
acinclude.m4 dir.c main.c README.W32
aclocal.m4 doc make.1 remake.c
alloca.c dosbuild.bat Makefile.am remote-cstms.c
amiga.c expand.c Makefile.ami remote-stub.c
amiga.h file.c makefile.com rule.c
ar.c filedef.h Makefile.DOS rule.h
arscan.c function.c Makefile.in SCOPTIONS
AUTHORS getloadavg.c makefile.vms signame.c
build.sh.in getopt1.c makeint.h SMakefile
build_w32.bat getopt.c make.lnk strcache.c
commands.c getopt.h make_msvc_net200③sln subproc.bat
commands.h gettext.h make_msvc_net200③vcproj tests
config glob misc.c variable.c
config.ami gmk-default.h NEWS variable.h
configh.dos gmk-default.scm NMakefile version.c
config.h.in gnumake.h output.c vmsdir.h
config.h-vms guile.c output.h vmsfunctions.c
config.h.W32 hash.c po vmsify.c
configure hash.h read.c vmsjobs.c
configure.ac implicit.c README vpath.c
configure.bat INSTALL README.Amiga w32
COPYING job.c README.customs
debug.h job.h README.DOS
default.c loadapi.c README.OS2

[root@localhost ~]./configure[root@localhost ~]make[root@localhost ~]make install

http://www.gnu.org/software/bison/

http://ftp.gnu.org/gnu/bison/

[root@localhost src]# wget http://ftp.gnu.org/gnu/bison/bison-③0.④tar.gz
--2015-01-28 11:03:56-- http://ftp.gnu.org/gnu/bison/bison-③0.④tar.gz
正在解析主机 ftp.gnu.org (ftp.gnu.org)... 20⑧11⑧23⑤20, 2001:4830:134:3::b
正在连接 ftp.gnu.org (ftp.gnu.org)|20⑧11⑧23⑤20|:80... 已连接.
已发出 HTTP 请求,正在等待回应... 200 OK
长度:3354179 (③2M) [application/x-gzip]
正在保存至: "bison-③0.④tar.gz"

100%[======================================>] 3,354,179 41.0KB/s 用时 71s

2015-01-28 11:05:08 (4⑤8 KB/s) - 已保存 "bison-③0.④tar.gz" [3354179/3354179])
[root@localhost src]# wget ftp://rpmfind.net/linux/centos/⑦0.1406/os/x86_64/Packages/ncurses-devel-⑤9- 
1③20130511.el⑦x86_6④rpm
--2015-01-28 14:28:29-- ftp://rpmfind.net/linux/centos/⑦0.1406/os/x86_64/Packages/ncurses-devel-⑤9- 
1③20130511.el⑦x86_6④rpm
=> "ncurses-devel-⑤9-1③20130511.el⑦x86_6④rpm"
正在解析主机 rpmfind.net (rpmfind.net)... 19⑤220.10⑧108
正在连接 rpmfind.net (rpmfind.net)|19⑤220.10⑧108|:21... 已连接.
正在以 anonymous 登录 ... 登录成功!
==> SYST ... 完成. ==> PWD ... 完成.
==> TYPE I ... 完成. ==> CWD (1) /linux/centos/⑦0.1406/os/x86_64/Packages ... 完成.
==> SIZE ncurses-devel-⑤9-1③20130511.el⑦x86_6④rpm ... 729820
==> PASV ... 完成. ==> RETR ncurses-devel-⑤9-1③20130511.el⑦x86_6④rpm ... 完成.
长度:729820 (713K) (非正式数据)

100%[======================================>] 729,820 275KB/s 用时 2.6s

2015-01-28 14:28:36 (275 KB/s) - "ncurses-devel-⑤9-1③20130511.el⑦x86_6④rpm" 已保存 [729820]

安装或者升级一个rpm包rpm -ivh rpm文件【安装】 rpm -Uvh rpm文件【更新】

[root@localhost src]# rpm -ivh ncurses-devel-⑤9-1③20130511.el⑦x86_6④rpm
准备中... ################################# [100%]
正在升级/安装...
1:ncurses-devel-⑤9-1③20130511.el7################################# [100%]

遇到了不少问题 感觉最好的办法就是重新装一遍 记得cmake以前删除CMakeCache.txt

?

这个图是后来从新编译的 就看下编译选项就好了

执行的命令

cmake \ 
-DCMAKE_INSTALL_PREFIX=/usr/etc/mysql 
-DMYSQL_DATADIR=/usr/etc/mysql/data 
-DSYSCONFDIR=/etc/mysql/ 
-DWITH_MYISAM_STORAGE_ENGINE=1 
-DWITH_INNOBASE_STORAGE_ENGINE=1 
-DWITH_HEAP_STORAGE_ENGINE=1 
-DWITH_PARTITION_STORAGE_ENGINE=1 
-DMYSQL_UNIX_ADDR=/tmp/mysqld.sock 
-DMYSQL_TCP_PORT=3306 
-DENABLED_LOCAL_INFILE=1 
-DWITH_EXTRA_CHARSETS:STRING=utf8,gbk 
-DDEFAULT_CHARSET=utf8 
-DDEFAULT_COLLATION=utf8_general_ci

再次编译 改了下配置文件的位置 红色字体

进入安装目录

初始化数据库

资料引用

./mysql_install_db --user=mysql --basedir=/usr/etc/mysql --datadir=/usr/etc/mysql/data

最主要要定义

--basedir 安装目录

--datadir 数据存放目录

To start mysqld at boot time you have to copysupport-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !To do so, start the server, then issue the following commands:

Alternatively you can run:

/usr/etc/mysql/bin/mysql_secure_installation

which will also give you the option of removing the testdatabases and anonymous user created by default. This isstrongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:

cd . ; /usr/etc/mysql/bin/mysqld_safe

You can test the MySQL daemon with mysql-test-run.pl

cd mysql-test ; perl mysql-test-run.pl

Please report any problems at http://bugs.mysql.com/

The latest information about MySQL is available on the web at

http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

New default config file was created as /usr/etc/mysql/my.cnf andwill be used by default by the server when you start it.You may edit this file to change server settings

[root@localhost scripts]#

上面的警告 应该都能读懂 如果在/etc下有my.cnf文件 就是优先加载这个配置 所以就删除吧

rm -f my.cnf

删除默认/etc/my.cnfcd /etc/rm -f my.cnf

添加用户mysql

[root@localhost data]# useradd mysql

[root@localhost data]# groupadd mysqlgroupadd:"mysql"组已存在

给安装目录权限

先给权限 要不然mysql 无法正常启动

[root@localhost data]# chown -R mysql:mysql /usr/etc/mysql

复制mysql.server到启动目录init.d [root@localhost mysql]# cp support-files/mysql.server /etc/init.d/mysql[root@localhost mysql]# chkconfig mysql on

启动mysql

[root@localhost data]# service mysql startStarting MySQL. SUCCESS!

启动成功

登录成功

退出mysql 直接ctrl + z

***************************************************************************************

有错误 看看错误日志里记录啥了

查看错误日志

vi /usr/etc/mysql/data/localhost.localdomain.err

*************************************************************************************

可能出现的问题:

我出现下面这个问题就是没有mysql这个用户 还没有给安装目录权限的问题?

[root@localhost mysql]# service mysql startStarting MySQL. ERROR! The server quit without updating PID file (/usr/etc/mysql/localhost.localdomain.pid).

具体如下解决的

以下是参考记录而已~

查看user表里的记录 /usr/etc/mysql/bin

最后我还安装了

进入解压目录

[root@localhost mysql]# perl -v

[root@localhost scripts]# yum install -y perl-Module-Install.noarch

*****************************************************************

给自己补充用的知识点?

运行mysql_secure_installation会执行几个设置:? a)为root用户设置密码? b)删除匿名账号? c)取消root用户远程登录? d)删除test库和对test库的访问权限? e)刷新授权表使修改生效

进入安装目录cd /usr/etc/mysql/bin

执行?mysql_secure_installation 回车 一般都是直接Y

以上就是土嘎嘎小编大虾米为大家整理的相关主题介绍,如果您觉得小编更新的文章只要能对粉丝们有用,就是我们最大的鼓励和动力,不要忘记讲本站分享给您身边的朋友哦!!

版权声明:倡导尊重与保护知识产权。未经许可,任何人不得复制、转载、或以其他方式使用本站《原创》内容,违者将追究其法律责任。本站文章内容,部分图片来源于网络,如有侵权,请联系我们修改或者删除处理。

编辑推荐

热门文章