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

[经验分享] mysql-boost-5.7.17安装

[复制链接]

尚未签到

发表于 2018-10-2 14:47:47 | 显示全部楼层 |阅读模式
  1、下载源码包
  #wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-boost-5.7.17.tar.gz
  2、进入解压目录
cd mysql-5.7.17
  3、安装相关依赖
  [root@safehourse69 mysql-5.7.17]#  yum install -y cmake gcc-c++* make ncurses-devel
  2、4、创建mysql运行用户
  [root@safehourse69 mysql-5.7.18]# useradd -M -s /sbin/nologin mysql
  5、执行源码编译
  #cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_UNIX_ADDR=/tmp/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS=all -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_MEMORY_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DENABLED_LOCAL_INFILE=1 -DMYSQL_DATADIR=/usr/local/mysql/data -DMYSQL-USER=mysql -DDOWNLOAD_BOOST=1 -DWITH_BOOST=./boost
  3、编译之后,下面就是安装了,执行如下命令
  #make -j 4 && make install
  在编译的时候,如果虚拟机或是机器配置过低会报如下错误,建议配置为4核4G的配置来安装,我的安装是卡到75%这里,然后就不动了
  cc1plus: warning: unrecognized command line option "-Wno-unused-local-typedefs"
  调整完配置之后,再执行上面的安装命令
  #make -j 4 && make install
  7、更改文件夹属主和属组
chown -R mysql.mysql /usr/local/mysql/
  8、手动添加编辑配置文件
  [root@safehourse69 mysql-5.7.18]# cd /usr/local/mysql/support-files/
  [root@safehourse69 support-files]# vim my-default.cnf
  [mysqld]
  sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
  basedir = /usr/local/mysql
  datadir = /usr/local/mysql/data
  port = 3306
  socket = /tmp/mysql.sock
  character-set-server=utf8
  back_log = 300
  max_connections = 3000
  max_connect_errors = 50
  table_open_cache = 4096
  max_allowed_packet = 32M
  #binlog_cache_size = 4M
  max_heap_table_size = 128M
  read_rnd_buffer_size = 16M
  sort_buffer_size = 16M
  join_buffer_size = 16M
  thread_cache_size = 16
  query_cache_size = 128M
  query_cache_limit = 4M
  ft_min_word_len = 8
  thread_stack = 512K
  transaction_isolation = REPEATABLE-READ
  tmp_table_size = 128M
  #log-bin=mysql-bin
  long_query_time = 6
  server_id=1
  innodb_buffer_pool_size = 1G
  innodb_thread_concurrency = 16
  innodb_log_buffer_size = 16M
  innodb_log_file_size = 512M
  innodb_log_files_in_group = 3
  innodb_max_dirty_pages_pct = 90
  innodb_lock_wait_timeout = 120
  innodb_file_per_table = on
  [mysqldump]
  quick
  max_allowed_packet = 32M
  [mysql]
  no-auto-rehash
  default-character-set=utf8
  safe-updates
  [myisamchk]
  key_buffer = 16M
  sort_buffer_size = 16M
  read_buffer = 8M
  write_buffer = 8M
  [mysqlhotcopy]
  interactive-timeout
  [mysqld_safe]
  open-files-limit = 8192
  [client]
  9、初始化mysql服务
bin/mysqld --initialize-insecure --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/
  10、复制配置文件
cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf
  11、复制启动脚本
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
  12、修改启动脚本,在下面这个位置后面写上安装路径
vim /etc/init.d/mysqld
  basedir=/usr/local/mysql
  datadir=/usr/local/mysql/data
  13、启动mysql 服务
cd /usr/local/mysql/bin/
./mysqld_safe --user=mysql &
service mysqld restart
  Shutting down MySQL. SUCCESS! 
  Starting MySQL. SUCCESS! 
  14 做软连接,让系统直接调用
ln -s /usr/local/mysql/bin/* /bin/
  15、登录数据库报如下错误,卡到这里了
  ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
  系统没有找到mysql.sock文件
  这里查看配置文件里写的是mysqld.sock  把配置文件里的mysqld.sock改成mysql.sock重启mysql 服务,就可以登录了
  默认没有密码直接登录的
mysql
  Welcome to the MySQL monitor.  Commands end with ; or \g.

  Your MySQL connection>  Server version: 5.7.18 Source distribution
  Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  Oracle is a registered trademark of Oracle Corporation and/or its
  affiliates. Other names may be trademarks of their respective
  owners.
  Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  mysql>
  16、登录数据库修改密码
  mysql> SET PASSWORD = PASSWORD('Xinwangai7/');
  Query OK, 0 rows affected, 1 warning (0.00 sec)
  mysql> flush privileges;
  Query OK, 0 rows affected (0.00 sec)
  测试用新密码登录
mysql -u root -p
  Enter password: 
  Welcome to the MySQL monitor.  Commands end with ; or \g.

  Your MySQL connection>  Server version: 5.7.18 Source distribution
  Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  Oracle is a registered trademark of Oracle Corporation and/or its
  affiliates. Other names may be trademarks of their respective
  owners.
  Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  mysql> 


运维网声明 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.iyunv.com/thread-607669-1-1.html 上篇帖子: mysql+mycat实现读写分离 下篇帖子: DRBD+Heartbeat+Mysql 高可用实战
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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

扫描微信二维码查看详情

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


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


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


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



合作伙伴: 青云cloud

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