码迷,mamicode.com
首页 > 数据库 > 详细

MySQL

时间:2014-09-26 10:48:48      阅读:301      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   io   os   ar   for   数据   sp   

1:下载安装cmake (mysql5.5以后是通过cmake来编译的)

#http://download.csdn.net/detail/csxuedn/7976005
#wget http://www.cmake.org/files/v2.8/cmake-2.8.5.tar.gz

# tar -zxv -f /root/cmake-2.8.4.tar.gz
# cd cmake-2.8.4
#./configure

Error when bootstrapping CMake:
Cannot find appropriate C++ compiler on this system.
Please specify one using environment variable CXX.
See cmake_bootstrap.log for compilers attempted.

 

   #yum install gcc-c++

#./configure
# make && make install

2:创建mysql的安装目录及数据库存放目录

#mkdir -p /gechong/mysql                 //安装mysql 
#mkdir -p /gechong/mysql/data            //存放数据库

  

3:创建mysql用户及用户组

#groupadd mysql
#useradd -r -g mysql mysql

  

4:安装mysql

#wget http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.21.tar.gz

[root@10-4-5-9 gechong]# ls
mysql

[root@10-4-5-9 gechong]# pwd
/gechong


[root@10-4-5-9 gechong]# tar -zxv -f /root/mysql-5.6.21.tar.gz

[root@10-4-5-9 gechong]# cd mysql-5.6.21/

编译:

 cmake . -DCMAKE_INSTALL_PREFIX=/gechong/mysql -DMYSQL_DATADIR=/gechong/mysql/data -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DEXTRA_CHARSETS=all -DENABLED_LOCAL_INFILE=1 

 

报错了:

CMake Error at cmake/readline.cmake:85 (MESSAGE):
  Curses library not found.  Please install appropriate package,

      remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.
Call Stack (most recent call first):
  cmake/readline.cmake:128 (FIND_CURSES)
  cmake/readline.cmake:202 (MYSQL_USE_BUNDLED_EDITLINE)
  CMakeLists.txt:427 (MYSQL_CHECK_EDITLINE)


-- Configuring incomplete, errors occurred!

 

#yum -y install ncurses-devel

 

#rm -f CMakeCache.txt

  

重新编译:

# make clean

# rm -f CMakeCache.txt

# rm -rf /etc/my.cnf

 cmake . -DCMAKE_INSTALL_PREFIX=/gechong/mysql -DMYSQL_DATADIR=/gechong/mysql/data -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DEXTRA_CHARSETS=all -DENABLED_LOCAL_INFILE=1 

 

#make && make install

 很慢。。。等着吧

 

5:配置MySQL

# cd /gechong/mysql
# chown -R root:mysql .
# chown -R mysql:mysql data

  

6:

# cp support-files/my-default.cnf /etc/my.cnf

  

7:初始化权限表

#scripts/mysql_install_db --user=mysql

  

8:启动MySQL服务

#ln -s /gechong/mysql/bin/mysql /usr/bin

#service mysqld start 

 

10:之后空用户登陆MySQL,删除空用户,对用户赋权限。

 

MySQL

标签:style   blog   http   io   os   ar   for   数据   sp   

原文地址:http://www.cnblogs.com/xiaoit/p/3994092.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!