您好,登錄后才能下訂單哦!
安裝依賴包
yum install -y centos-release-scl devtoolset-4-gcc-c++ devtoolset-4-gcc cmake openssl-devel bison git gmock ncurses ncurses-* autoconf
創建賬號
groupadd mysql && useradd -r -g mysql mysql
wget http://mirror.cnop.net/alisql/AliSQL-5.6.32.zip && unzip AliSQL-5.6.32.zip && cd AliSQL-master
scl enable devtoolset-4 bash
mkdir source_downloads && cd source_downloads && wget http://mirror.cnop.net/gmock/gmock-1.6.0.zip && cd ..
編譯:
cmake \
-DCMAKE_INSTALL_PREFIX=/usr/local/alisql \
-DMYSQL_UNIX_ADDR=/usr/local/alisql/mysql.sock \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DMYSQL_DATADIR=/usr/local/alisql/data \
-DMYSQL_TCP_PORT=3306 \
-DENABLE_DOWNLOADS=1
安裝:
make
make install
chown -R mysql.mysql /usr/local/alisql/
echo never > /sys/kernel/mm/transparent_hugepage/enabled
初始化數據:
chmod +x ./scripts/mysql_install_db
./scripts/mysql_install_db --user=mysql --basedir=/usr/local/alisql --datadir=/usr/local/alisql/data
vi /etc/my.cnf #加入以下內容
[client]
port = 3306
socket = /tmp/mysql.sock
[mysqld]
port = 3306
socket = /tmp/mysql.sock
datadir = /usr/local/alisql/data
skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 10M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
thread_cache_size = 8
query_cache_size = 8M
tmp_table_size = 16M
max_connections = 500
max_connect_errors = 100
open_files_limit = 65535
log-bin=mysql-bin
binlog_format=mixed
server-id = 1
expire_logs_days = 10
default_storage_engine = InnoDB
innodb_file_per_table = 1
innodb_data_home_dir = /usr/local/alisql/data
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = /usr/local/alisql/data
innodb_buffer_pool_size = 16M
innodb_additional_mem_pool_size = 2M
innodb_log_file_size = 5M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50
拷貝啟動項:
cp support-files/mysql.server /etc/init.d/mysqld
環境變量配置:
vi /etc/profile #加入以下
PATH=/usr/local/alisql/bin:/usr/local/alisql/lib:$PATH
export PATH
source /etc/profile
軟鏈接:
ln -s /usr/local/alisql/bin/mysql /usr/bin
啟動并設置開機啟動:
chmod +x /etc/init.d/mysqld
service mysqld start
chkconfig --level 35 mysqld on
查看是否啟動:
netstat -tulnp | grep 3306
mysql -u root -p #默認root密碼為空
#授權新密碼
mysqladmin -uroot -p password 123456
#運行后按提示輸入一次確定密碼即可(這里是123456)
mysql -uroot -p #重新登錄
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。