亚洲综合社区欧美综合色-欧美逼逼一区二区三区-国产老熟女高潮精品网站-国产日韩最新视频在线看

始創(chuàng)于2000年 股票代碼:831685
咨詢熱線:0371-60135900 注冊有禮 登錄
  • 掛牌上市企業(yè)
  • 60秒人工響應(yīng)
  • 99.99%連通率
  • 7*24h人工
  • 故障100倍補(bǔ)償
全部產(chǎn)品
您的位置: 網(wǎng)站首頁 > 幫助中心>文章內(nèi)容

MySQL 5.5.12安裝和升級

發(fā)布時(shí)間:  2012/8/26 16:01:06

mysql 5.5中InnoDB作為默認(rèn)的數(shù)據(jù)庫存儲(chǔ)引擎,mysql-5.1升級mysql到mysql-5.5以后,以下程序需要重新編譯安裝升級:
PHP 5.3.6
cacti spine
pureftp

安裝
wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.12-linux2.6-x86_64.tar.gz/from/http://mysql.ntu.edu.tw/
-
 

tar -C /usr/local -xzf  mysql-5.5.12-linux2.6-x86_64.tar.gz
cd /usr/local
ln -s mysql-5.5.12-linux2.6-x86_64/ mysql

cd /usr/local/mysql
mkdir -p /usr/local/mysql/etc/
cp support-files/my-huge.cnf etc/my.cnf

sed -i 's/skip-locking/skip-external-locking/' my.cnf
sed -i 's/default-character-set/character-set-server/' my.cnf
sed -i 's/log_slow_queries/slow_query_log/' my.cnf

修改server-id = 1為服務(wù)器ip地址最后幾位,或者其它數(shù)值:
cd /usr/local/mysql/etc/
vim  my.cnf
#max_allowed_packet = 1M
server-id = 8108

max_allowed_packet = 64M
max_connections=800
character-set-server=utf8
expire_logs_days = 60
binlog_format=mixed
log-bin=mysql-bin
#read_only=1
#slave-skip-errors=1062,1032,1053

innodb_log_files_in_group=2
#default_table_type = INNODB //unknown variable
innodb_data_home_dir = /opt/data/mysql/
innodb_data_file_path = ibdata1:2000M;ibdata2:2000M;ibdata3:20M:autoextend
innodb_log_group_home_dir = /opt/data/mysql/

# 4G RAM
innodb_buffer_pool_size = 1G
innodb_log_file_size = 256M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit=0
innodb_thread_concurrency=8
innodb_flush_method=O_DIRECT

# perform
tmp_table_size = 512M
max_heap_table_size=128M

slow_query_log
#log-queries-not-using-indexes
#log-slow-admin-statements
#slow_query_log_file=mysql-slow.log
long_query_time=1
log-error=mysqld.log

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

添加數(shù)據(jù)庫用戶
/usr/sbin/groupadd -g 502 mysql
/usr/sbin/useradd -u 502 -g mysql mysql

mkdir -p /opt/data/mysql/
chown mysql.mysql /opt/data/mysql/

cd /usr/local/mysql/
scripts/mysql_install_db –user=mysql
chown -R root .
chown -R mysql data
chgrp -R mysql .
#chmod -R u+rw data
cd /opt/data/mysql/
chown mysql.mysql /opt/data/mysql/

cd /usr/local/mysql/
cp support-files/mysql.server /etc/rc.d/init.d/mysqld
chmod +x /etc/rc.d/init.d/mysqld

/etc/rc.d/init.d/mysqld restart

#/sbin/chkconfig –level 345 mysqld on
#/sbin/chkconfig –del mysqld
/sbin/chkconfig –add mysqld
/sbin/chkconfig –list mysqld

echo "/usr/local/mysql/lib" >> /etc/ld.so.conf
cat /etc/ld.so.conf
ldconfig

mkdir -p /var/lib/mysql/
ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock

#/usr/local/mysql/bin/mysqld_safe &
mkdir -p /var/run/mysqld/
chown mysql /var/run/mysqld/

#加入mysql到路徑
echo pathmunge /usr/local/mysql/bin after > /etc/profile.d/mysql.sh

#執(zhí)行一下,保證mysql在路徑環(huán)境變量中
. /etc/profile

mysql5.1升級到mysql5.5
mysql_upgrade包含一下三個(gè)命令:
# mysqlcheck –check-upgrade –all-databases –auto-repair
# mysql_fix_privilege_tables
# mysqlcheck –all-databases –check-upgrade –fix-db-names –fix-table-names
在每一次的升級過程中,建議執(zhí)行mysql_upgrade這個(gè)命令,通過mysqlcheck命令幫我們?nèi)z查表是否兼容新版本的數(shù)據(jù)庫同時(shí)作出修復(fù),使用mysql_fix_privilege_tables命令去升級權(quán)限表。
/usr/local/mysql/bin/mysql_upgrade -uroot -p

[ERROR] /usr/local/mysql/bin/mysqld: unknown variable 'default_table_type=INNODB'
注釋my.cnf中的default_table_type=INNODB

把所有INNODB表轉(zhuǎn)換成MYISAM表的腳本
sed -i 's/$opt_type/$opt_engine/' /usr/local/mysql/bin/mysql_convert_table_format
/usr/local/mysql/bin/mysql_convert_table_format –user='root' –password='veryi.com' –socket='/tmp/mysql.sock' –type='INNODB'


本文出自:億恩科技【1tcdy.com】

服務(wù)器租用/服務(wù)器托管中國五強(qiáng)!虛擬主機(jī)域名注冊頂級提供商!15年品質(zhì)保障!--億恩科技[ENKJ.COM]

  • 您可能在找
  • 億恩北京公司:
  • 經(jīng)營性ICP/ISP證:京B2-20150015
  • 億恩鄭州公司:
  • 經(jīng)營性ICP/ISP/IDC證:豫B1.B2-20060070
  • 億恩南昌公司:
  • 經(jīng)營性ICP/ISP證:贛B2-20080012
  • 服務(wù)器/云主機(jī) 24小時(shí)售后服務(wù)電話:0371-60135900
  • 虛擬主機(jī)/智能建站 24小時(shí)售后服務(wù)電話:0371-60135900
  • 專注服務(wù)器托管17年
    掃掃關(guān)注-微信公眾號(hào)
    0371-60135900
    Copyright© 1999-2019 ENKJ All Rights Reserved 億恩科技 版權(quán)所有  地址:鄭州市高新區(qū)翠竹街1號(hào)總部企業(yè)基地億恩大廈  法律顧問:河南亞太人律師事務(wù)所郝建鋒、杜慧月律師   京公網(wǎng)安備41019702002023號(hào)
      0
     
     
     
     

    0371-60135900
    7*24小時(shí)客服服務(wù)熱線