[root@localhost ~]# yum -y install cmake
[root@localhost quail]# tar zxf mysql-5.5.20.tar.gz #源码包通过rz上传
[root@localhost mysql-5.5.20 ]# cmake . -dcmake_install_prefix=/usr/local/mysql55 \ -dmysql_unix_addr=/tmp/mysql.sock \
-dmysql_datadir=/data/mysql \ -dsysconfdir=/etc \
-dmysql_user=mysql \
-dmysql_tcp_port=3306 \ -dwith_xtradb_storage_engine=1 \ -dwith_innobase_storage_engine=1 \ -dwith_partition_storage_engine=1 \ -dwith_blackhole_storage_engine=1 \ -dwith_myisam_storage_engine=1 \
-dwith_readline=1 \ -denabled_local_infile=1 \
-dwith_extra_charsets=1 \ -ddefault_charset=utf8 \
-ddefault_collation=utf8_general_ci \ -dextra_charsets=all \
-dwith_big_tables=1 \
-dwith_debug=0
ps:第一次预编译可能会报错
cmake error at cmake/readline.cmake:83 (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.
解决方法:提示缺少mysql一个终端支持依赖包。mysql的终端不同linux命令终端,这个依赖主要是对于mysql命令界面的支持。
[root@localhost ~ ]# yum install ncurses-devel -y
安装完成后重新进行预编译 cmake ……。
[root@localhost mysql-5.5.20 ]# make -j4 && make install
这是一段漫长的等待……大佬们稳住……
[root@localhost ~]# cd /usr/local/mysql55 ##进入mysql的主配置目录 [root@localhost mysql55]# \cp -f support-files/my-large.cnf /etc/my.cnf ##cp mysql主配置文件,mysql 程序默认读取的配置 [root@localhost mysqql55]# \cp -f support-files/mysql.server /etc/init.d/mysqld ##cp mysql的启动脚本到/etc/init.d/ "\" 参数强制复制
[root@localhost mysql55]# chkconfig --add mysqld ##mysqld 程序加入service 管理程序,加入系统服务 [root@localhost mysql55]# chkconfig --level 35 mysqld ##执行mysqld 的开机自启
[root@localhost mysql55]# mkdir -p /data/mysql
[root@localhost mysql55]# useradd mysql
[root@localhaost mysql55]# /usr/local/mysql55/scripts/mysql_install_db --user=mysql --datadir=/data/mysql/ -basedir=/usr/local/mysql55/
[root@localhaost mysql55]# ln -s /usr/local/mysql55/bin/* /usr/bin/
[root@localhost ~]# service mysqld start starting mysql.. success!
如对本文有疑问, 点击进行留言回复!!
MySQL-关系代数-并、交、差、等值连接、自然连接、左连接。。。
网友评论