简单说一下,mysql5.1以上版本使用的都是cmake
安装方法如下:
Mysql源码安装方法
shell>groupadd mysql
shell>useradd -r -g mysql mysql
shell>tar zxvf mysql-VERSION.tar.gz
shell>cd mysql-VERSION
shell>cmake .
shell>make
shell>make install
shell>cd /usr/local/mysql
shell>chown -R mysql .
shell>chgrp -R mysql .
shell>scripts/mysql_install_db --user=mysql
shell>chown -R root .
shell>chown -R mysql data
shell>cp support-files/my-medium.cnf /etc/my.cnf
shell>bin/mysqld_safe --user=mysql &
shell>cp support-files/mysql.server /etc/init.d/mysql.server
安装问题描述:通过源码的方式安装mysql5.5.17版本通过cmake .编译过程中遇到到很多cmake error
解决方法:通过yum的方式下载gcc-c++,gcc,ncurses-devel的包
今天执行cmake报错如下:
报错:
CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
此错误是因为没有安装 make
yum install make 解决
1.2 my.cnf配置文件修改
[client]
添加default-character-set = utf8
[mysqld]
添加character-set-server = utf8
1.3 修改root密码
/home/mysql/bin/mysqladmin -u root password 'izptec'
1.4 创建数据库test
1>/home/mysql/bin/mysqladmin -u root --p
2>create database test
关闭mysql的服务
./mysqladmin -uroot -p shutdown
或者直接杀进程(上面的关闭方式更合理一些)