mysql 5.5 cmake 安装

2016-07-12 10:23:50来源:oschina作者:小小人故事人点击

#mysql5.5开始必须使用cmake编译
[root@166087cmake-2.8.5]#wgetwgethttp://www.cmake.org/files/v2.8/cmake-2.8.5.tar.gz
[root@166087cmake-2.8.5]#tarxzvfcmake-2.8.5.tar.gz
[root@166087cmake-2.8.5]#cdcmake-2.8.5
[root@166087cmake-2.8.5]#./bootstrap
[root@166087cmake-2.8.5]#make&&makeinstall
#cmake需要安装gcc
[root@166087cmake-2.8.5]#yum-yinstallgcc*
[root@166087cmake-2.8.5]#./bootstrap
[root@166087cmake-2.8.5]#make&&makeinstall
#下载mysql
[root@166087mysql]#wgethttp://cdn.mysql.com/archives/mysql-5.5/mysql-5.5.32.tar.gz
[root@166087mysql]#tarxfmysql-5.5.32.tar.gz
#添加mysql用户
[root@166087mysql]#useradd-Mmysql-s/sbin/nologin
#字符集
[root@166087mysql]#yum-yinstallncurses-devel*
#cmake编译参数
/usr/local/bin/cmake-DCMAKE_INSTALL_PREFIX=/application/mysql5.5/
-DMYSQL_UNIX_ADDR=/tmp/mysql.sock/
-DMYSQL_USER=mysql/
-DEXTRA_CHARSETS=all/
-DDEFAULT_CHARSET=utf8/
-DDEFAULT_COLLATION=utf8_general_ci/
-DWITH_MYISAM_STORAGE_ENGINE=1/
-DWITH_INNOBASE_STORAGE_ENGINE=1/
-DWITH_DEBUG=0/
-DWITH_READLINE=1/
-DWITH_EMBEDDED_SERVER=1/
-DENABLED_LOCAL_INFILE=1
#cmake配置参数对比
http://www.blogjava.net/kelly859/archive/2012/09/04/387005.html
#如果cmake失败,重新cmake,必须清除一下
makeclean
rmCMakeCache.txt
#编译mysql
[root@166087mysql-5.5.32]#make&&makeinstall
#映射路径
[root@166087mysql-5.5.32]#ln-s/application/mysql5.5/application/mysql
#拷贝配置文件
[root@166087mysql]#mkdirconf
[root@166087mysql]#cpsupport-files/my-large.cnfconf/my.cnf
#初始化数据库
./scripts/mysql_install_db/
--defaults-file=/application/mysql/conf/my.cnf/
--basedir=/application/mysql/
--datadir=/application/mysql/data//
--user=mysql[root@166087mysql]#./scripts/mysql_install_db/
>--defaults-file=/application/mysql/conf/my.cnf/
>--basedir=/application/mysql/
>--datadir=/application/mysql/data//
>--user=mysql
InstallingMySQLsystemtables...
OK
Fillinghelptables...
OK
Tostartmysqldatboottimeyouhavetocopy
support-files/mysql.servertotherightplaceforyoursystem
PLEASEREMEMBERTOSETAPASSWORDFORTHEMySQLrootUSER!
Todoso,starttheserver,thenissuethefollowingcommands:
/application/mysql/bin/mysqladmin-urootpassword'new-password'
/application/mysql/bin/mysqladmin-uroot-h166087.sys.ipv4.iopassword'new-password'
Alternativelyyoucanrun:
/application/mysql/bin/mysql_secure_installation
whichwillalsogiveyoutheoptionofremovingthetest
databasesandanonymoususercreatedbydefault.Thisis
stronglyrecommendedforproductionservers.
Seethemanualformoreinstructions.
YoucanstarttheMySQLdaemonwith:
cd/application/mysql;/application/mysql/bin/mysqld_safe&
YoucantesttheMySQLdaemonwithmysql-test-run.pl
cd/application/mysql/mysql-test;perlmysql-test-run.pl
Pleasereportanyproblemswiththe/application/mysql/scripts/mysqlbugscript!
#拷贝启动脚本
[root@166087mysql]#cpsupport-files/mysql.server/etc/init.d/mysqld
[root@166087mysql]#chmod+x/etc/init.d/mysqld
#启动
[root@166087~]#/etc/init.d/mysqldstart
StartingMySQL..SUCCESS!
[root@166087~]#netstat-lntup|grepmysqld
tcp000.0.0.0:33060.0.0.0:*LISTEN15478/mysqld
[root@166087~]#netstat-lntup|grepmysqld
tcp000.0.0.0:33060.0.0.0:*LISTEN15478/mysqld
[root@166087~]#ps-ef|grepmysql
root153871003:43pts/000:00:00/bin/sh/application/mysql5.5/bin/mysqld_safe--datadir=/application/mysql5.5/data--pid-file=/application/mysql5.5/data/166087.sys.ipv4.io.pid
mysql1547815387003:43pts/000:00:00/application/mysql5.5/bin/mysqld--basedir=/application/mysql5.5--datadir=/application/mysql5.5/data--plugin-dir=/application/mysql5.5/lib/plugin--user=mysql--log-error=/application/mysql5.5/data/166087.sys.ipv4.io.err--pid-file=/application/mysql5.5/data/166087.sys.ipv4.io.pid#设置root密码
[root@166087~]#/application/mysql/bin/mysqladmin-uroot-ppassword123456
#登录
[root@166087~]#/application/mysql/bin/mysql-uroot-hlocalhost-p123456
WelcometotheMySQLmonitor.Commandsendwith;or/g.
YourMySQLconnectionidis2
Serverversion:5.5.32Sourcedistribution
Copyright(c)2000,2013,Oracleand/oritsaffiliates.Allrightsreserved.
OracleisaregisteredtrademarkofOracleCorporationand/orits
affiliates.Othernamesmaybetrademarksoftheirrespective
owners.
Type'help;'or'/h'forhelp.Type'/c'toclearthecurrentinputstatement.
mysql>showdatabases;
+--------------------+
|Database|
+--------------------+
|information_schema|
|mysql|
|performance_schema|
|test|
+--------------------+
4rowsinset(0.00sec)

最新文章

123

最新摄影

微信扫一扫

第七城市微信公众平台