简单说一下,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报错如下:
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
或者直接杀进程(上面的关闭方式更合理一些)