安裝mysql5.5
1.準備工作
作業系統 : CentOS release 6.5
mysql軟體 : mysql-5.5.42.tar.gz
cmake軟體 : cmake-2.8.5.tar.gz
安裝必要的作業系統軟體包 :yum install tree nmap sysstat lrzsz dos2unix ncurses-devel gcc* -y
建立mysql資料庫的系統賬號 :useradd -M mysql
建立mysql的安裝目錄和資料目錄 :mkdir /mysql /data
chown mysql.mysql /data
建立臨時目錄和日誌目錄 :mkdir /mysql/tmps /mysql/logs
chown mysql.mysql /mysql/logs /mysql/tmps
chmod -R 775 /mysql
配置環境變數 :
echo "export PATH=/mysql/bin:$PATH">>/root/.bash_profile
tail -1 /root/.bash_profile
source /root/.bash_profile
echo $PATH;
2.安裝
1) 先安裝cmake
tar xf cmake-2.8.5.tar.gz && cd cmake-2.8.5
./configure && make && make install
2)安裝mysql資料庫
cd
tar xf mysql-5.5.42.tar.gz
cd mysql-5.5.42
cmake . \
-DCMAKE_INSTALL_PREFIX=/mysql \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_PERFSCHEMA_STORAGE_ENGINE=1 \
-DWITH_MEMORY_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DENABLED_LOCAL_INFILE=1 \
-DMYSQL_DATADIR=/data
make && make install
3.配置
初始化資料庫:
cd /mysql/scripts/
./mysql_install_db --user=mysql --basedir=/mysql --datadir=/data
將啟動指令碼放置在系統的啟動目錄:
cd /mysql/support-files/
cp -a mysql.server /etc/init.d/mysqld
配置引數檔案
vim /etc/my.cnf #檔案中的內容如下
[client]
socket=/mysql/tmps/mysql.sock
user=root
[mysqld]
datadir=/data
socket=/mysql/tmps/mysql.sock
user=mysql
log-error=/mysql/logs/mysqld.err
pid-file=/mysql/tmps/mysqld.pid
4.簡單操作
啟動mysql: /etc/init.d/mysqld start
進入mysql: mysql100. 記憶體72G的my.cnf配置
[client]
port = 3306
socket =/mysql/tmps/mysql.sock
[mysqld]
server-id=1
port=3306
user=mysql
basedir=/mysql
datadir=/data
tmpdir=/mysql/tmps
socket =/mysql/tmps/mysql.sock
pid-file=/mysql/tmps/mysqld.pid
skip-external-locking
skip-name-resolve
default-storage-engine=innodb
character-set-server=utf8
wait_timeout=100
connect_timeout=20
interactive_timeout=100
back_log=500
event_scheduler=on
####binlog
log-bin=/mysql/logs/mysql-bin
binlog_format=row
max_binlog_size=128M
binlog_cache_size=2M
expire-logs-days=5
####replication
slave-net-timeout=10
#rpl_semi_sync_master_enabled=1
#rpl_semi_sync_master_wait_no_slave=1
#rpl_semi_sync_master_timeout=1000
#rpl_semi_sync_slave_enabled=1
skip-slave-start
log_slave_updates=1
relay_log_recovery=1
####slow_log
slow_query_log=1
slow_query_log_file=/mysql/logs/mysql.slow
long_query_time=2
####error log
log-error=/mysql/logs/log.err
#####per_thread_buffer
max_connections=1024
max_user_connections=1000
max_connect_errors=10000
#key_buffer_size=64M
#max_allowed_packet=128M
table_open_cache=4096
table_definition_cache=4096
sort_buffer_size=512K
read_buffer_size=512K
read_rnd_buffer_size=512K
join_buffer_size=512K
#tmp_table_size=64M
#max_heap_table_size=64M
query_cache_type=0
query_cache_size=0
bulk_insert_buffer_size=32M
thread_cache_size=64
thread_stack=256K
####innodb
innodb_data_home_dir=/data
#innodb_log_group_home_dir=/mysql/logs
#innodb_data_file_path=ibdata1:2G:autoextend
#innodb_buffer_pool_size=50G
innodb_buffer_pool_instances=8
innodb_additional_mem_pool_size=16M
#innodb_log_file_size=1024M
innodb_log_buffer_size=64M
###innodb_log_file_in_group=3
innodb_flush_log_at_trx_commit=2
innodb_lock_wait_timeout=10
innodb_sync_spin_loops=40
innodb_max_dirty_pages_pct=90
innodb_support_xa=1
innodb_thread_concurrency=0
innodb_thread_sleep_delay=500
innodb_file_io_threads=4
innodb_concurrency_tickets=1000
log_bin_trust_function_creators=1
innodb_flush_method=O_DIRECT
innodb_file_per_table
innodb_read_io_threads=16
innodb_write_io_threads=16
innodb_io_capacity=2000
innodb_file_format=Barracuda
innodb_purge_threads=1
innodb_purge_batch_size=32
innodb_old_blocks_pct=75
innodb_change_buffering=all
transaction-isolation = READ-COMMITTED
[mysqldump]
quick
[mysql]
no-auto-rehash
[myisamchk]
key_buffer_size=64M
sort_buffer_size=256K
read_buffer=2M
write_buffer=2M
[mysqlhotcopy]
interactive-timeout
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29620572/viewspace-1763687/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- mysql5.5安裝MySql
- CMAKE安裝mysql5.5MySql
- mysql5.5的原始碼安裝MySql原始碼
- RedHat 6.4原始碼方式安裝mysql5.5Redhat原始碼MySql
- CentOS安裝MySQL5.5的完整步驟DSITCentOSMySql
- linux64bit下安裝mysql5.5LinuxMySql
- Linux 安裝 mysql 5.5.8(cmake原始碼安裝mysql5.5以上版本)[轉]LinuxMySql原始碼
- Centos5.5中安裝Mysql5.5過程分享CentOSMySql
- linux下編譯安裝mysql5.5以上版本Linux編譯MySql
- Win10安裝Mysql5.5卡住假死怎麼回事 win10系統安裝Mysql5.5卡死未響應如何解決Win10MySql
- mysql5.5資料庫cmake原始碼編譯安裝MySql資料庫原始碼編譯
- MySQL入門學習之——原始碼安裝mysql5.5MySql原始碼
- Linux下原始碼編譯方式安裝MySQL5.5Linux原始碼編譯MySql
- 寶塔皮膚安裝的mysql5.5用命令列kill -9後啟動不了MySql命令列
- LINUX環境下MYSQL5.5原始碼安裝(2012年3月26日更新)LinuxMySql原始碼
- codis安裝 (java 安裝 + zookeeper 安裝 + go 安裝 + codis 安裝JavaGo
- mysql5.5 performance_schema 初探MySqlORM
- centos7 RPM MySQL5.5CentOSMySql
- mysql5.5半同步複製探究MySql
- 安裝npm 解除安裝npm 安裝apidocNPMAPI
- mysql安裝 (yum 安裝)MySql
- MMM安裝、MHA安裝
- mysql5.5的bin資料型別MySql資料型別
- mysql5.5中的半同步複製MySql
- mysql安裝------RPM包安裝及解除安裝MySql
- oracle安裝:OUI安裝Oracle(圖形介面安裝)OracleUI
- ffmpeg安裝之mac安裝Mac
- docker安裝及解除安裝Docker
- 02 安裝git、安裝TortoiseGitGit
- Ubuntu解除安裝和安裝Ubuntu
- Orace RAC安裝-DNS安裝DNS
- caffe安裝系列——安裝OpenCVOpenCV
- SPARK 安裝之scala 安裝Spark
- mac 安裝opencv homebrew安裝MacOpenCV
- Oracle 安裝與解除安裝Oracle
- solaris mysql 安裝 解除安裝MySql
- BiocManager安裝,devtools安裝dev
- JDK安裝和解除安裝JDK