MySQL数据库-boost-5.7.17安装
小标 2018-10-15 来源 : 阅读 1462 评论 0

摘要:本文主要向大家介绍了MySQL数据库-boost-5.7.17安装 ,通过具体的内容向大家展现,希望对大家学习MySQL数据库有所帮助。

本文主要向大家介绍了MySQL数据库-boost-5.7.17安装 ,通过具体的内容向大家展现,希望对大家学习MySQL数据库有所帮助。

<

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 id is 3
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 id is 5
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>?    

本文由职坐标整理并发布,希望对同学们学习MySQL有所帮助,更多内容请关注职坐标数据库MySQL数据库频道!

本文由 @小标 发布于职坐标。未经许可,禁止转载。
喜欢 | 0 不喜欢 | 0
看完这篇文章有何感觉?已经有0人表态,0%的人喜欢 快给朋友分享吧~
评论(0)
后参与评论

您输入的评论内容中包含违禁敏感词

我知道了

助您圆梦职场 匹配合适岗位
验证码手机号,获得海同独家IT培训资料
选择就业方向:
人工智能物联网
大数据开发/分析
人工智能Python
Java全栈开发
WEB前端+H5

请输入正确的手机号码

请输入正确的验证码

获取验证码

您今天的短信下发次数太多了,明天再试试吧!

提交

我们会在第一时间安排职业规划师联系您!

您也可以联系我们的职业规划师咨询:

小职老师的微信号:z_zhizuobiao
小职老师的微信号:z_zhizuobiao

版权所有 职坐标-一站式IT培训就业服务领导者 沪ICP备13042190号-4
上海海同信息科技有限公司 Copyright ©2015 www.zhizuobiao.com,All Rights Reserved.
 沪公网安备 31011502005948号    

©2015 www.zhizuobiao.com All Rights Reserved

208小时内训课程