扫二维码与项目经理沟通
我们在微信上24小时期待你的声音
解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流
安装依赖包
成都创新互联公司是专业的栾川网站建设公司,栾川接单;提供成都网站设计、网站建设,网页设计,网站设计,建网站,PHP网站建设等专业做网站服务;采用PHP框架,可快速的进行栾川网站开发网页制作和功能扩展;专业做搜索引擎喜爱的网站,专业的做网站团队,希望更多企业前来合作!
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 #重新登录
我们在微信上24小时期待你的声音
解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流