mysql 5.5.35安装_linux mysql5.5.35安装

Linux下Mysql 5.5.8安装手记

Mysql 5.5.8使用了新的cmake编译方式

Setup 1:检查是否安装好了cmake——cmake -i

安装cmake

wget -c

http://www.cmake.org/files/v2.8/cmake-2.8.3.tar.gz

tar -zxvf cmake-2.8.3.tar.gz

cd cmake-2.8.3

./bootstrap

./configure

make && make install

cmake version 2.8.3

//

今天安装cmake 完成之后, 使用时遇到一个问题:command not found

很奇怪,cmake已经安装了,为什么会有这个提示,查找internet发现:

1.9.3 has a dependency on cmake. If you aren't root on the box you

can download cmake fromhttp://www.cmake.org/,

configure and install it using --prefix=~/cmake/ then export

PATH=~/cmake/bin/:$PATH to install cmake in your home directory and

use it to configure Anope.

我把cmake

安装在了/opt/下也就是/opt/cmake

按照提示需要在终端执行 命令:export

PATH=/opt/cmake/bin:$PATH

OK,再执行cmake软件编译就没有错误提示了。

//

Setup 2:

安装MYSQL 5.5.8

wget -c http://.mirrors.pair.com/Downloads/MySQL-5.5/mysql-5.5.8.tar.gz

tar -zxvf mysql-5.5.8.tar.gz

cd mysql-5.5.8/

cmake .

-DCMAKE_BUILD_TYPE:STRING=Release

-DCMAKE_INSTALL_PREFIX:PATH=/usr/local/mysql

-DCOMMUNITY_BUILD:BOOL=ON -DENABLED_PROFILING:BOOL=ON

-DENABLE_DEBUG_SYNC:BOOL=OFF -DINSTALL_LAYOUT:STRING=STANDALONE

-DMYSQL_DATADIR:PATH=/var/run/mysql

-DMYSQL_MAINTAINER_MODE:BOOL=OFF -DWITH_EMBEDDED_SERVER:BOOL=ON

-DWITH_EXTRA_CHARSETS:STRING=all -DWITH_SSL:STRING=bundled

-DWITH_UNIT_TESTS:BOOL=OFF -DWITH_ZLIB:STRING=bundled

-DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci

-DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_READLINE=1

-DENABLED_LOCAL_INFILE=1 -DMYSQL_USER=mysql -DMYSQL_TCP_PORT=3306

-LH

/

报错:

-- Could NOT find Curses

(missing: CURSES_LIBRARY

CURSES_INCLUDE_PATH)

CMake Error at cmake/readline.cmake:82 (MESSAGE):

Curses library not found. Please install

appropriate package,

remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is

libncurses5-dev ,

onRedHatand derivates it

is ncurses-devel.

Call Stack (most recent call first):

cmake/readline.cmake:126 (FIND_CURSES)

cmake/readline.cmake:216 (MYSQL_USE_BUNDLED_LIBEDIT)

CMakeLists.txt:256 (MYSQL_CHECK_READLINE)

-- Configuring incomplete, errors occurred!

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

没有安装 ncurses-devel

/

make

make install

慢长的等待过后终于完成了

groupadd mysql

useradd -g mysql mysql

cp /usr/local/mysql/support-files/my-medium.cnf

/etc/my.cnf

vim /etc/my.cnf #需要加入basedir,和datadir否则会出问题

[mysqld]

basedir =/usr/local/mysql

datadir =/usr/local/mysql/data

/usr/local/mysql/scripts/mysql_install_db

–user=mysql

chown -R mysql /usr/local/mysql/data

chgrp -R mysql /usr/local/mysql/.

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

chmod 755 /etc/init.d/mysql

chkconfig –level 345 mysql on

echo “/usr/local/mysql/lib/mysql” >>

/etc/ld.so.conf

echo “/usr/local/lib” >>/etc/ld.so.conf

ldconfig

/etc/init.d/mysql start

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

你的MYSQL密码

/etc/init.d/mysql restart

/etc/init.d/mysql stop

OK终于完成~

常见问题:

1. /etc/init.d/mysql: line 256: my_print_defaults: command not

found

解决方法: 检查/etc/my.cnf是否存在datadir和basedir如果没有请增加

datadir和basedir目录路径.

如下

[mysqld]

port = 3306

basedir =/usr/local/mysql

datadir =/usr/local/mysql/data

This entry was posted in Mysql. Bookmark the permalink.

///

[root@host102 mysql-5.5.35]# cd /usr/local/mysql/

[root@host102 mysql]# groupadd mysql

[root@host102 mysql]# useradd -g mysql mysql

[root@host102 mysql]# cp

/usr/local/mysql/support-files/my-medium.cnf /etc/my.cnf

[root@host102 mysql]# vi /etc/my.cnf

[root@host102 mysql]# chgrp -R mysql /usr/local/mysql/data

[root@host102 mysql]# chown -R mysql

/usr/local/mysql/data

[root@host102 mysql]# /usr/local/mysql/scripts/mysql_install_db

--user=mysql

[root@host102 mysql]# cp

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

[root@host102 mysql]# chmod 755 /etc/init.d/mysql

[root@host102 mysql]# chkconfig --level 345 mysql on

[root@host102 mysql]# echo "/usr/local/mysql/lib/mysql" >>

/etc/ld.so.conf

[root@host102 mysql]# echo "/usr/local/lib" >>

/etc/ld.so.conf

[root@host102 mysql]# ldconfig

[root@host102 mysql]# /etc/init.d/mysql start

Starting MySQL.... SUCCESS!

[root@host102 mysql]# /usr/local/mysql/bin/mysqladmin -u root

password root

[root@host102 mysql]# /etc/init.d/mysql restart

Shutting down MySQL. SUCCESS!

Starting MySQL.. SUCCESS!

[root@host102 mysql]#

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值