设为首页 收藏本站
查看: 1280|回复: 0

[经验分享] Cent OS 6.5 Mysql-5.6.19 编译安装

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2014-7-31 09:16:10 | 显示全部楼层 |阅读模式
今天来写写MySQL 5.6.19的编译安装,现在5.6版本的安装比较发杂一点了,不扯了开始吧!安装环境
   OS:Cent OS 6.5
   软件:Mysql 5.6.19
下载软件
   http://mirrors.sohu.com/mysql/MySQL-5.6/Mysql-5.6.19.tar.gz

安装前环境配置

1
2
3
4
5
6
7
8
9
10
11
   #yum install -y lrzsz (这个软件可以上传文件)
   #rz                  (找到你刚才下载的mysql)
   #yum groupinstall development tools server platform development desktop platform developkment             (安装编译环境)
   #yum install -y cmake
   #yum install -y ncurses-devel
   #useradd -r mysql
   #mkdir -p /usr/local/mysql
   #mkdir -p /mysql/data
   #tar xf mysql-5.6.19.tar.gz
   #cd mysql-5.6.19
   #cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/mysql/data



   Check size of pthread_t
-- Check size of pthread_t - done
-- Using cmake version 2.6.4
-- Not building NDB
-- Performing Test HAVE_PEERCRED
-- Performing Test HAVE_PEERCRED - Success
-- Library mysqlclient depends on OSLIBS -lpthread;m;rt;dl
-- Googlemock was not found. gtest-based unit tests will be disabled. You can run cmake . -DENABLE_DOWNLOADS=1 to automatically download and build required components from source.
-- If you are inside a firewall, you may need to use an http proxy: export http_proxy=http://example.com:80
-- Library mysqlserver depends on OSLIBS -lpthread;m;rt;crypt;dl
-- Configuring done
-- Generating done
-- Build files have been written to: /mydata/software/mysql-5.6.19
   (看到以上信息说明编译前的配置成功)


1
  #make && make install



-- Installing: /usr/local/mysql/man/man1/mysql_fix_extensions.1
-- Installing: /usr/local/mysql/man/man1/mysqlaccess.1
-- Installing: /usr/local/mysql/man/man1/my_print_defaults.1
-- Installing: /usr/local/mysql/man/man1/mysqltest.1
-- Installing: /usr/local/mysql/man/man1/myisam_ftdump.1
-- Installing: /usr/local/mysql/man/man1/comp_err.1
-- Installing: /usr/local/mysql/man/man1/mysql_upgrade.1
-- Installing: /usr/local/mysql/man/man1/mysql_setpermission.1
-- Installing: /usr/local/mysql/man/man1/mysql_config_editor.1
-- Installing: /usr/local/mysql/man/man1/mysqlshow.1
-- Installing: /usr/local/mysql/man/man1/mysql_find_rows.1
-- Installing: /usr/local/mysql/man/man1/mysql_convert_table_format.1
-- Installing: /usr/local/mysql/man/man1/resolveip.1
-- Installing: /usr/local/mysql/man/man1/mysqladmin.1
-- Installing: /usr/local/mysql/man/man1/resolve_stack_dump.1
-- Installing: /usr/local/mysql/man/man1/replace.1
-- Installing: /usr/local/mysql/man/man1/mysqldump.1
-- Installing: /usr/local/mysql/man/man1/perror.1
-- Installing: /usr/local/mysql/man/man1/mysql.server.1
-- Installing: /usr/local/mysql/man/man1/mysql_install_db.1
-- Installing: /usr/local/mysql/man/man1/myisamlog.1
-- Installing: /usr/local/mysql/man/man1/mysql_config.1
-- Installing: /usr/local/mysql/man/man1/mysqlslap.1
-- Installing: /usr/local/mysql/man/man1/mysqlhotcopy.1
-- Installing: /usr/local/mysql/man/man8/mysqld.8
   (看到上面信息说明编译安装成功)
配置MySQL配置文件
1
2
   #cd /usr/local/mysql
   #ll



total 156
drwxr-xr-x  2 root root  4096 May 14 14:36 bin
-rw-r--r--  1 root root 17987 May  6 18:45 COPYING
drwxr-xr-x  3 root root  4096 May 14 14:29 data
drwxr-xr-x  2 root root  4096 May 14 14:29 docs
drwxr-xr-x  3 root root  4096 May 14 14:29 include
-rw-r--r--  1 root root 89163 May  6 18:46 INSTALL-BINARY
drwxr-xr-x  3 root root  4096 May 14 14:29 lib
drwxr-xr-x  4 root root  4096 May 14 14:36 man
drwxr-xr-x 10 root root  4096 May 14 14:36 mysql-test
-rw-r--r--  1 root root  2496 May  6 18:45 README
drwxr-xr-x  2 root root  4096 May 14 14:36 scripts
drwxr-xr-x 28 root root  4096 May 14 14:36 share
drwxr-xr-x  4 root root  4096 May 14 14:36 sql-bench
drwxr-xr-x  2 root root  4096 May 14 14:36 support-files

1
2
3
    #vim /etc/profile    (添加如下内容到最后一行)
    export PATH=/usr/local/mysql/bin:/usr/local/mysql/lib:$PATH
    #. /etc/profile       (重读配置文件)




1
2
    #chown -R root:mysql /usr/local/mysql/*
    #chown -R mysql:msyql /mysql/data        (修改文件的属主和属主)




1
2
3
4
5
6
7
     #cd /usr/local/mysql/support-files
     #mv /etc/my.cnf /etc/my.cnf.bak
     #cp my-default.cnf /etc/my.cnf
     #cp mysql.server /etc/rc.d/init.d/msyqld
     #chkconfig --add mysqld
     #chkconfig msyql on
     #./usr/local/mysql/scripts/msyql_install_db --user=mysql --datadir=/mysql/data --basedir=/usql/local/mysql



     To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

  /usr/local/mysql/bin/mysqladmin -u root password 'new-password'
  /usr/local/mysql/bin/mysqladmin -u root -h localhost.localdomain password 'new-password'

Alternatively you can run:

  /usr/local/mysql/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:

  cd . ; /usr/local/mysql/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl

  cd mysql-test ; perl mysql-test-run.pl

Please report any problems at http://bugs.mysql.com/

The latest information about MySQL is available on the web at

  http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

New default config file was created as /usr/local/mysql/my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings

WARNING: Default config file /etc/my.cnf exists on the system
This file will be read by default by the MySQL server
If you do not want to use this, either remove it, or use the
--defaults-file argument to mysqld_safe when starting the server
     (看到上面内容说明初始化msyql成功)


1
   #service msyqld start



Starting MySQL.................................            [  OK  ]

到此编译完成!

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-22974-1-1.html 上篇帖子: mysql压力测试工具 下篇帖子: Redhat下Mysql安装配置
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表