首页 > 数据库 >Alibaba Cloud Linux 3.2104 LTS 安装mysql5.7.39

Alibaba Cloud Linux 3.2104 LTS 安装mysql5.7.39

时间:2024-04-18 15:33:05浏览次数:39  
标签:LTS 39 log buffer mysql5.7 innodb mysql size

1 上传mysql安装包到linux服务器
tar -zxvf mysql-5.7.39-linux-glibc2.12-x86_64.tar.gz
mv mysql-5.7.39-linux-glibc2.12-x86_64 mysql5.7
2  创建mysql用户
   groupadd mysql
   useradd -g mysql -s /sbin/nologin mysql
chown -R mysql:mysql mysql5.7

 

3  安装
  cd mysql5.7
  mkdir data
  cd bin
  ./mysqld --initialize --user=mysql --datadir=/usr/local/mysql5.7/data/ --basedir=/usr/local/mysql5.7/
 
4 设置my.cnf配置文件

[client]
default-character-set=utf8
port=3306
socket=/tmp/mysql.sock

[mysqld]
socket=/tmp/mysql.sock
port=3306
basedir=/usr/local/mysql5.7
datadir=/usr/local/mysql5.7/data
pid-file=/usr/local/mysql5.7/mysql.pid
user = mysql
bind-address = 0.0.0.0
server-id = 1
skip-name-resolve
back_log = 600
max_connections = 1000
max_connect_errors = 6000
open_files_limit = 65535
table_open_cache = 128
max_allowed_packet = 100M
binlog_cache_size = 1M
max_heap_table_size = 8M
tmp_table_size = 16M

read_buffer_size = 2M
read_rnd_buffer_size = 8M
sort_buffer_size = 8M
join_buffer_size = 8M
key_buffer_size = 4M

thread_cache_size = 8

query_cache_size = 8M
query_cache_limit = 2M

ft_min_word_len = 4

log_bin = mysql-bin
binlog_format = mixed
expire_logs_days = 30

log_error=/usr/local/mysql5.7/mysql/mysql-error.log
slow_query_log = 1
long_query_time = 1
slow_query_log_file=/usr/local/mysql5.7/mysql/mysql-slow.log

performance_schema = 0
explicit_defaults_for_timestamp

#lower_case_table_names = 1

skip-external-locking

default_storage_engine = InnoDB
#default-storage-engine = MyISAM
innodb_file_per_table = 1
innodb_open_files = 500
innodb_buffer_pool_size = 64M
innodb_write_io_threads = 4
innodb_read_io_threads = 4
innodb_thread_concurrency = 0
innodb_purge_threads = 1
innodb_flush_log_at_trx_commit = 2
innodb_log_buffer_size = 2M
innodb_log_file_size = 32M
innodb_log_files_in_group = 3
innodb_max_dirty_pages_pct = 90
innodb_lock_wait_timeout = 120

bulk_insert_buffer_size = 8M
myisam_sort_buffer_size = 8M
myisam_max_sort_file_size = 10G

interactive_timeout = 28800
wait_timeout = 28800
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
[mysqldump]
quick
max_allowed_packet = 16M

[myisamchk]
key_buffer_size = 8M
sort_buffer_size = 8M
read_buffer = 4M
write_buffer = 4M



##########################################################

 



 

5 设置环境变量

  vi /etc/profile
  设置PATH参数
  export PATH="$PATH:/usr/local/mysql5.7/bin/"

  source/ /etc/profile
6 测试 
 编辑 support-files/mysql.server
 设置以下配置参数
 basedir=/usr/local/mysql5.7
 datadir=/usr/local/mysql5.7/data
 
  //设置mysql 开机启动
  cp support-files/mysql.server /etc/init.d/mysqld
  chmod 755 /etc/init.d/mysqld
  chkconfig --add mysqld
  chkconfig mysqld on
  service mysqld restart

  mysql  -uoort -p

  FLUSH PRIVILEGES;
 //修改密码
  ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';
 

 

标签:LTS,39,log,buffer,mysql5.7,innodb,mysql,size
From: https://www.cnblogs.com/jackspider/p/18143620

相关文章

  • ubuntu解决/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.38' not found的问题
    运行进程时报错./main:/lib/x86_64-linux-gnu/libc.so.6:version`GLIBC_2.38'notfound(requiredby./main)./main:/lib/x86_64-linux-gnu/libc.so.6:version`GLIBC_2.33'notfound(requiredby./main)./main:/lib/x86_64-linux-gnu/libc.so.6:version`G......
  • c++ std::string能否存储二进制字符以及'\0'字符?
    c++的字符串类std::string能否存储二进制字符以及字符'\0'?要解决这个问题,我们首先要了解c++的std::string的存储结构。(注意不同的平台下C++规范对std::string的实现不完全一致,例如sizeof(std::string)在linuxx64gcc-4.4下的输出是8,而在macgcc4.2下的输出是24;这篇文章以Li......
  • CF1939C
    题意有一个会重复k次的数组,每个人都可以那不超过t种礼物,礼物必须是顺序发的,不能第一个发给第二个,求最少的人的个数。首先每一个人都必须要取尽可能多的礼物,然后按这个模拟即可。那么我们就要搞出每一个点往后跳到那里。这个最容易想到的应该是主席树加二分,根据两只\(\log\)跑得......
  • 1039 到底买不买
    只要有一个珠子缺少,那么就是缺少珠子,我们需要将缺少的珠子(mp[x]<0的)加起来。#include<bits/stdc++.h>usingnamespacestd;charcs[1100],cs2[1100];map<char,int>mp;intmain(){ cin>>cs>>cs2; for(inti=0;i<strlen(cs);i++){ mp[cs[i]]++; } intqs=0,dy=0,......
  • ReferenceError: Cannot access 'pageWrapper' before initialization
    jeecgboot-vue3的ReferenceError:Cannotaccess'pageWrapper'beforeinitialization错误问题问题描述基于jeecgboot-vue3框架进行开发时,不定期在浏览器控制台打印出ReferenceError:Cannotaccess'pageWrapper'beforeinitializationatindex.ts:7:40错误,且页面一......
  • P3978 [TJOI2015] 概率论 题解
    题意:求一棵\(n\)个节点的有根二叉树的叶子节点的期望个数。设\(f_n\)表示\(n\)个点的二叉树个数,\(g_n\)表示\(n\)个点的所有二叉树的叶子节点数之和。显然\(f_n\)为\(\text{Catalan}\)数,考虑如何求\(g_n\)。一个结论是:\(g_n=f_{n-1}\timesn\)。证明:对于每一......
  • Windows 11 LTSC版本的优缺点
    随着Windows11的发布,微软推出了多个版本,其中包括Windows11LTSC版。LTSC(长期服务分支)版本通常被视为适合特定企业环境或者对稳定性和长期支持有需求的用户。然而,对于普通用户来说,Windows11LTSC版可能并非最佳选择。首先,Windows11LTSC版被标榜为适用于老电脑,这意味着它可以......
  • TypeScript 中 Type 'typeof globalThis' has no index signature 错误解决
    TypeScript中Type'typeofglobalThis'hasnoindexsignature错误解决当我们尝试访问 global 对象上不存在的属性时,会出现错误“Elementimplicitlyhasan'any'typebecausetype'typeofglobalThis'hasnoindexsignature”。要解决此错误,需要扩展全局对象并为必......
  • 【问题解决】Fatal error "unsafe repository ('git目录名' is owned by someone else
    问题复现近期升级了Gitv2.37.0,发现在gitbash进入git目录执行git命令时出现错误:Fatalerror"unsaferepository('git目录名'isownedbysomeoneelse)",无法使用git做一些操作。问题解决两个方法:降级到v2.35.2之前,或者,gitconfig--global--addsafe.directory仓库目录......
  • mysql5.7配置文件
    datadir=/data/mysqlsocket=/var/lib/mysql/mysql.sockDisablingsymbolic-linksisrecommendedtopreventassortedsecurityriskssymbolic-links=0log-error=/data/mysql/mysqld.logpid-file=/data/mysql/mysqld/mysqld.piddefault-time-zone='+8:00'......