溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

alisql的安裝環(huán)境變量配置

發(fā)布時(shí)間:2020-05-22 14:04:13 來源:億速云 閱讀:291 作者:鴿子 欄目:系統(tǒng)運(yùn)維

安裝依賴包

yum install -y centos-release-scl devtoolset-4-gcc-c++ devtoolset-4-gcc cmake  openssl-devel bison git gmock ncurses ncurses-* autoconf 


創(chuàng)建賬號

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

初始化數(shù)據(jù):

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   #加入以下內(nèi)容

[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


拷貝啟動(dòng)項(xiàng):

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



環(huán)境變量配置:
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

啟動(dòng)并設(shè)置開機(jī)啟動(dòng):

chmod +x /etc/init.d/mysqld
service mysqld start
chkconfig --level 35 mysqld on


查看是否啟動(dòng):

netstat -tulnp | grep 3306
mysql -u root -p    #默認(rèn)root密碼為空


alisql的安裝環(huán)境變量配置

#授權(quán)新密碼

mysqladmin -uroot  -p  password 123456   

#運(yùn)行后按提示輸入一次確定密碼即可(這里是123456)

alisql的安裝環(huán)境變量配置

mysql -uroot -p           #重新登錄

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI