Ubuntu 编译安装MySQL所需的软件包

企鹅博客
企鹅博客
企鹅博客
25193
文章
0
评论
2020年10月4日14:55:35 评论 8 views 2327字阅读7分45秒

1、Ubuntu安装MySQL所需软件包

sudo apt-get install binutils cpp fetchmail flex gcc libarchive-zip-perl libc6-dev libcompress-zlib-perl libdb4.3-dev libpcre3 libpopt-dev lynx m4 make ncftp nmap perl perl-modules unzip zip zlib1g-dev autoconf automake1.9 libtool bison autotools-dev g++ build-essential

2、安装libncurses5-dev
sudo apt-get install libncurses5-dev

通过源码编译安装软件时,出现错误信息:

checking for termcap functions library… configure: error: No curses/termcap library found

安装libncurses5-dev库方可解决。

3、安装MySQL

mysql使用utf-8作为默认编码:
groupadd mysql
useradd -g mysql mysql
tar -zxvf mysql-5.0.45.tar.gz
cd mysql-5.0.45
./configure –prefix=/usr/local/mysql –with-charset=utf8 –with-collation=utf8_general_ci –with-extra-charsets=latin1
make
make install
vi my.cnf
输入代码:

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

[mysql]
prompt="(\u:Molutran's MySQL Server:)[\d]> "
no-auto-rehash

[mysqld]
#default-character-set = utf8
user    = mysql
port    = 3306
socket  = /tmp/mysql.sock
basedir = /usr/local/mysql
datadir = /usr/local/mysql/data
open_files_limit    = 10240
back_log = 600
max_connections = 3000
max_connect_errors = 6000
table_cache = 614
external-locking = FALSE
max_allowed_packet = 32M
sort_buffer_size = 2M
join_buffer_size = 2M
thread_cache_size = 300
thread_concurrency = 8
query_cache_size = 32M
query_cache_limit = 2M
query_cache_min_res_unit = 2k
default-storage-engine = MyISAM
default_table_type = MyISAM
thread_stack = 192K
transaction_isolation = READ-COMMITTED
tmp_table_size = 246M
max_heap_table_size = 246M
long_query_time = 1
log_long_format
log-bin = /usr/local/mysql/binlog
binlog_cache_size = 4M
binlog_format = MIXED
max_binlog_cache_size = 8M
max_binlog_size = 512M
expire_logs_days = 7
key_buffer_size = 256M
read_buffer_size = 1M
read_rnd_buffer_size = 16M
bulk_insert_buffer_size = 64M
myisam_sort_buffer_size = 128M
myisam_max_sort_file_size = 10G
myisam_max_extra_sort_file_size = 10G
myisam_repair_threads = 1
myisam_recover

skip-name-resolve
master-connect-retry = 10
slave-skip-errors = 1032,1062,126,1114,1146,1048,1396

server-id = 1

innodb_additional_mem_pool_size = 16M
innodb_buffer_pool_size = 2048M
innodb_data_file_path = ibdata1:1024M:autoextend
innodb_file_io_threads = 4
innodb_thread_concurrency = 8
innodb_flush_log_at_trx_commit = 2
innodb_log_buffer_size = 16M
innodb_log_file_size = 128M
innodb_log_files_in_group = 3
innodb_max_dirty_pages_pct = 90
innodb_lock_wait_timeout = 120
innodb_file_per_table = 0
[mysqldump]
quick
max_allowed_packet = 32M

4、给MySQL安装目录加写权限并改变属组

chmod +w /usr/local/mysql
chown -R mysql:mysql /usr/local/mysql

继续阅读
NUMA导致的Oracle性能问题 Linux-数据库

NUMA导致的Oracle性能问题

背景简介: Oracle版本:11.2.0.4   OS 版本:OEL5.8 在一次Oracle的Dataguard正常switchover过程中,遇到了一个极其诡异的问题,一条主业务的SQL语句在新...
Oracle中IP地址和掩码转换成CIDR格式 Linux-数据库

Oracle中IP地址和掩码转换成CIDR格式

遇到的问题如下:数据库中存储了IP地址,以及IP地址掩码,需要将他们转化成CIDR格式的,并且不仅仅是将掩码转化成CIDR对应的数字的问题,需要将原有的IP地址转化成对应的网络地址,例如IP地址是58...
匿名

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: