mysql5.5.34 安装_源码编译安装mysql-5.5.34|笔记

Hi 大家好,我是钟义林 我们来安装mysql,下面是笔记的原稿。下面我开始吧

首先下载cmakewget http://www.cmake.org/files/v2.8/cmake-2.8.12.1.tar.gz

#下载Curseswget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.9.tar.gz

yum install bison  yum install ncurses-devel    ncurses  openssl-devel

然后下载mysqlwget http://mirrors.sohu.com/mysql/MySQL-5.5/mysql-5.5.34.tar.gz   连接失效了,可能你需要去mysql的官网登入一下

tar  zxvf cmake-2.8.12.1 && tar zxvf mysql-5.5.34tar.gz

cd cmake-2.8.12.1 ./bootstrap && gmake && make && make install

tar zxvf mysql-5.5.34.tar.gz

cd msyql-5.5.34

cmake . \

-DCMAKE_INSTALL_PREFIX=/usr/local/mysql/ \

-DINSTALL_DATADIR=/usr/local/mysql/data/ \

-DSYSCONFDIR=/usr/local/mysql/etc  \

-DDEFAULT_CHARSET=utf8 \

-DDEFAULT_COLLATION=utf8_general_ci \

-DEXTRA_CHARSETS=all \

-DWITH_SSL=system \

-DWITH_EMBEDDED_SERVER=1  \

-DENABLED_LOCAL_INFILE=1 \

-DWITH_MYISAM_STORAGE_ENGINE=1 \

-DMYSQL_USER=mysql \

-DMYSQL_UNIX_ADDR=/usr/local/mysql/data/mysql.sock

================================================================================================

#cp support-files/my-default.cnf /usr/local/mysql/etc/my.cnf (版本问题 可能没有这些配置文件)

#[root@Nutcracker support-files]# pwd

/usr/local/mysql/support-files

[root@Nutcracker support-files]# ls

binary-configure   my-huge.cnf             mysqld_multi.server

config.huge.ini    my-innodb-heavy-4G.cnf  mysql-log-rotate

config.medium.ini  my-large.cnf            mysql.server

config.small.ini   my-medium.cnf           ndb-config-2-node.ini

magic              my-small.cnf            solaris

#这里说明一下,你可以吧你需要的.cnf文件cp到 /etc下 改名没my.conf

===================================================================================================

shell> groupadd mysql

shell> useradd -r -g mysql mysql

shell> cd /usr/local/mysql

shell> chown -R mysql .

shell> chgrp -R mysql .

shell> scripts/mysql_install_db --user=mysql

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

如果出现下列警告,请暂时忽略

ARNING: The host 'Nutcracker' could not be looked up with resolveip.

This probably means that your libc libraries are not 100 % compatible

with this binary MySQL version. The MySQL daemon, mysqld, should work

normally with the exception that host name resolving will not work.

This means that you should use IP addresses instead of hostnames

when specifying MySQL privileges !

Installing MySQL system tables...

OK

Filling help tables...

OK

To start mysqld at boot time you have to copy

support-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:

./bin/mysqladmin -u root password 'new-password'

./bin/mysqladmin -u root -h Nutcracker password 'new-password'

Alternatively you can run:

./bin/mysql_secure_installation

which will also give you the option of removing the test

databases and anonymous user created by default.  This is

strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:

cd . ; ./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 with the ./bin/mysqlbug script!

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

shell> chown -R root .

shell> chown -R mysql data

shell> bin/mysqld_safe --user=mysql &

cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld

/usr/local/mysql/scripts/mysql_install_db \

--defaults-extra-file=/etc/my.cnf \

--basedir=/usr/local/mysql \

--datadir=/usr/local/mysql \

--user=mysql

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

请忽略警告信息,成功

WARNING: The host 'Nutcracker' could not be looked up with resolveip.

This probably means that your libc libraries are not 100 % compatible

with this binary MySQL version. The MySQL daemon, mysqld, should work

normally with the exception that host name resolving will not work.

This means that you should use IP addresses instead of hostnames

when specifying MySQL privileges !

Installing MySQL system tables...

OK

Filling help tables...

OK

To start mysqld at boot time you have to copy

support-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:

/usr/local/mysql/bin/mysqladmin -u root password 'new-password'

/usr/local/mysql/bin/mysqladmin -u root -h Nutcracker password 'new-password'

Alternatively you can run:

/usr/local/mysql/bin/mysql_secure_installation

which will also give you the option of removing the test

databases and anonymous user created by default.  This is

strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:

cd /usr/local/mysql ; /usr/local/mysql/bin/mysqld_safe &

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

cd /usr/local/mysql/mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/local/mysql/scripts/mysqlbug script!

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

/usr/local/mysql/bin/mysqladmin -u root password 'newpassword' #mysqDB root的密码

cp support-files/mysql.server /etc/init.d/mysqld

chmod +x /etc/init.d/mysqld

/etc/init.d/mysqld start (启动mysql)

yum install mysql 安装连接mysql客户端

82bbe9529b56e8c0f698d8c46ce75d08.png

# Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA CMAKE_MINIMUM_REQUIRED(VERSION 2.6) # Avoid warnings in higher versions if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" GREATER 2.6) CMAKE_POLICY(VERSION 2.8) endif() # We use PROPERTIES LINK_INTERFACE_LIBRARIES. See cmake --help-policy CMP0022 IF(CMAKE_VERSION VERSION_EQUAL "2.8.12" OR CMAKE_VERSION VERSION_GREATER "2.8.12") CMAKE_POLICY(SET CMP0022 OLD) ENDIF() # We use the LOCATION target property (CMP0026) # and get_target_property() for non-existent targets (CMP0045) # and INSTALL_NAME_DIR (CMP0042) IF(CMAKE_VERSION VERSION_EQUAL "3.0.0" OR CMAKE_VERSION VERSION_GREATER "3.0.0") CMAKE_POLICY(SET CMP0026 OLD) CMAKE_POLICY(SET CMP0045 OLD) CMAKE_POLICY(SET CMP0042 OLD) ENDIF() MESSAGE(STATUS "Running cmake version ${CMAKE_VERSION}") # Will set GIT_EXECUTABLE and GIT_FOUND FIND_PACKAGE(Git) SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake) # First, decide about build type (debug or release) # If custom compiler flags are set or cmake is invoked with -DCMAKE_BUILD_TYPE, # respect user wishes and do not (re)define CMAKE_BUILD_TYPE. If WITH_DEBUG{_FULL} # is given, set CMAKE_BUILD_TYPE = Debug. Otherwise, use Relwithdebinfo. IF(DEFINED CMAKE_BUILD_TYPE) SET(HAVE_CMAKE_BUILD_TYPE TRUE) ENDIF() SET(CUSTOM_C_FLAGS $ENV{CFLAGS}) OPTION(WITH_DEBUG "Use dbug/safemutex" OFF) # Distinguish between community and non-community builds, with the # default being a community build. This does not impact the feature # set that will be compiled in; it's merely provided as a hint to # custom packaging steps. OPTION(COMMUNITY_BUILD "Set to true if this is a community build" ON) # Use a default manufacturer if no manufacturer was identified. SET(MANUFACTURER_DOCSTRING "Set the entity that appears as the manufacturer of packages that support a manufacturer field.") IF(NOT DEFINED MANUFACTURER) SET(MANUFACTURER "Built from Source" CACHE STRING ${MANUFACTURER_DOCSTRING}) MARK_AS_ADVANCED(MANUFACTURER) ENDIF() # We choose to provide WITH_DEBUG as alias to standard CMAKE_BUILD_TYPE=Debug # which turns out to be not trivial, as this involves synchronization # between CMAKE_BUILD_TYPE and WITH_DEBUG. Besides, we have to deal with cases # where WITH_DEBUG is reset from ON to OFF and here we need to reset # CMAKE_BUILD_TYPE to either none or default RelWithDebInfo SET(BUILDTYPE_DOCSTRING "Choos
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值