mysql5.5.20安装_mysql5.5.20源码安装

rpm -qa|grep  bison

rpm -qa|grep ncurses-devel

yum install bison

yum install ncurses-devel.x86_64

从http://www.cmake.org/cmake/resources/software.html

下载cmake-2.8.7.tar.gz

从mysql.com

下载Source Code package : mysql-5.5.20.tar.gz

安装cmake

# tar zxvf cmake-2.8.7.tar.gz

# cd cmake-2.8.7

# ./bootstrap

# gmake

# gamke install

安装mysql

tar zxvf mysql-5.5.20.tar.gz

cd mysql-5.5.20

cmake -DCMAKE_INSTALL_PREFIX=/data/mysql \

-DMYSQL_UNIX_ADDR=/data/mysql/data/mysql.sock \

-DDEFAULT_CHARSET=utf8 \

-DDEFAULT_COLLATION=utf8_general_ci \

-DWITH_EXTRA_CHARSETS=gbk \

-DWITH_PERFSCHEMA_STORAGE_ENGINE=1 \

-DWITH_FEDERATED_STORAGE_ENGINE=1 \

-DWITH_PARTITION_STORAGE_ENGINE=1 \

-DWITH_ARCHIVE_STORAGE_ENGINE=1 \

-DWITH_READLINE=1 \

-DMYSQL_DATADIR=/data/mysql/data \

-DSYSCONFDIR=/data/mysql \

-DMYSQL_TCP_PORT=3306

# make

# make install

# groupadd mysql

# useradd -r -g mysql mysql

# chown -R mysql:mysql /home/mysqldata/

cp /mysqlfile/mysql-5.5.20/support-files/my-large.cnf /data/mysql/my.cnf

cp /mysqlfile/mysql-5.5.20/support-files/mysql.server /etc/init.d/mysqld

chown mysql:mysql /data/mysql/my.cnf

chown mysql:mysql /etc/init.d/mysqld

chmod 744 /etc/init.d/mysqld

chmod +x scripts/mysql_install_db

scripts/mysql_install_db \

--defaults-file=/data/mysql/my.cnf \

--basedir=/data/mysql/ \

--datadir=/data/mysql/data/ \

--user=mysql \

--skip-name-resolve

#增加PATH设置

PATH=$PATH:/data/mysql/bin

# . ~/.bash_profile

# chkconfig --add mysqld

###### chkconfig --level 345 mysqld on

# /etc/init.d/mysqld start OR mysqld_safe & OR service mysqld start

###### mysqld_multi

#修改密码

# mysqladmin -uroot password "xxxxxx"

参数配置:

[mysqld]

server_id=1

federated

datadir=/data/mysql/data

tmpdir=/data/mysql/tmp

skip-external-locking

key_buffer_size = 256M

myisam_sort_buffer_size = 64M

# Try number of CPU's*2 for thread_concurrency

thread_concurrency = 24

back_log = 1024

max_connections = 1200

table_definition_cache=120000

table_open_cache =120000

max_connect_errors = 300

max_allowed_packet = 24M

read_rnd_buffer_size = 4M

read_buffer_size = 4M

join_buffer_size = 4M

sort_buffer_size = 2M

query_cache_limit = 2M

query_cache_size = 1024M

query_cache_min_res_unit=2k

thread_cache_size = 1200

thread_stack = 128K

tmp_table_size = 256M

max_tmp_tables = 256

bulk_insert_buffer_size = 4M

binlog_cache_size = 2M

max_binlog_size = 128M

max_binlog_cache_size= 512M

# log

log-error=/data/mysql/log/log

log-bin=/data/mysql/log/mysql-bin

slow-query-log

slow-query-log-file=/data/mysql/log/slow.log

long_query_time=1

log-queries-not-using-indexes

# innodb

innodb_buffer_pool_size = 20480M

innodb_data_home_dir = /data/mysql/data

innodb_data_file_path = ibdata1:10M:autoextend

innodb_file_per_table= 1

innodb_log_group_home_dir = /data/mysql/log

innodb_log_files_in_group=3

innodb_log_file_size = 512M

innodb_log_buffer_size = 16M

#innodb_file_io_threads = 4

innodb_thread_concurrency = 24

innodb_lock_wait_timeout = 100

innodb_flush_method = 'O_DIRECT'

innodb_max_dirty_pages_pct = 75

# innodb_flush_log_at_trx_commit=2

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
回答: 在升级MySQL版本时,有一些注意事项需要注意。首先,你需要下载对应版本的MySQL安装包,并解压缩。\[1\]然后,你需要进行逻辑备份,使用mysqldump命令将数据库备份到指定的文件中。接下来,停止MySQL服务,可以使用service mysqld stop或systemctl stop mysqld命令来停止服务。同时,你还需要备份MySQL的配置文件和数据文件。\[1\]在升级过程中,还需要注意字符集的设置。如果数据库字符集为UTF8,需要在参数文件中指定字符集。\[2\]最后,如果你已经卸载了MySQL,但在系统服务中仍然残留MySQL服务,你可以以管理员方式运行cmd命令行,使用sc delete命令来删除残留的服务。\[3\]这些是在升级MySQL版本时需要注意的一些事项。 #### 引用[.reference_title] - *1* *2* [mysql版本升级](https://blog.csdn.net/m0_38004228/article/details/127901630)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [[超详细]MySQL本地版本升级(从5.5.20到8.0.21)](https://blog.csdn.net/jack__love/article/details/127514405)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值