mysql5.6.36 源码安装过程

时间:2021-07-22 15:33:22

参考:http://www.linuxidc.com/Linux/2015-06/119354.htm

mysql5.6.36 源码安装过程

mysql5.6.36 源码安装过程

cmake编译时,提示错误

CMake Error: The source directory "/tools/mysql-5.6.36-linux-glibc2.5-x86_64" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.

mysql-5.6.36-linux-glibc2.5-x86_64是安装过的二进制包,是编译好了的,里面本身就没有cmakelists.txt 简单一句话,就是下载的包不对,不是源码包。里面就没有相关的cmake等文件。

[root@vhost1 ~]# cp -r /tools/mysql-5.6.25-linux-glibc2.5-x86_64 /application/

[root@vhost1 ~]# ln -s /application/mysql-5.6.25-linux-glibc2.5-x86_64 /application/mysql5.6

进入安装路径,执行初始化配置脚本,创建系统自带的数据库和表

[root@vhost1 ~]# cd /application/mysql5.6/scripts/

[root@vhost1 ~]# mysql_install_db --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql

启动mysql

添加服务,拷贝服务脚本到init.d目录,并设置开机启动

[root@vhost1 mysql5.6]#cp support-files/mysql.server /etc/init.d/mysql
[root@vhost1 mysql5.6]# chkconfig mysql on

启动mysql
[root@vhost1 mysql5.6]# service mysql start

查看mysql是否启动成功

[root@localhost mysql]# netstat -lntp | grep 3306