linux - 编译安装了mysql 5.6,为什么mysql安装目录下scripts木有呢?

浏览:34日期:2022-06-21

问题描述

编译安装了mysql 5.6,为什么mysql安装目录下scripts木有呢?

#!/bin/shwget http://www.cmake.org/files/v2.8/cmake-2.8.10.2.tar.gztar -xzvf cmake-2.8.10.2.tar.gz cd cmake-2.8.10.2./bootstrapmake && make installgroupadd mysqluseradd -s /sbin/nologin -M -g mysql mysqlMYSQL_DIR='/usr/local/mysql'MYSQL_DARA_DIR='/usr/local/mysql/data'mkdir -p ${MYSQL_DIR}tar -zxvf mysql-5.6.29.tar.gz && cd mysql-5.6.29cmake -DCMAKE_INSTALL_PREFIX=${MYSQL_DIR} -DSYSCONFDIR=/etc -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DWITH_FEDERATED_STORAGE_ENGINE=1 -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8mb4 -DDEFAULT_COLLATION=utf8mb4_general_ci -DWITH_EMBEDDED_SERVER=1 -DENABLED_LOCAL_INFILE=1make && make installcd ${MYSQL_DIR}chown -R mysql:mysql .cat > /etc/my.cnf <<EOF[client]#password = your_passwordport= 3306socket = /tmp/mysql.sock[mysqld]port= 3306socket = /tmp/mysql.sockdatadir = ${MYSQL_DIR}skip-external-lockingkey_buffer_size = 16Mmax_allowed_packet = 1Mtable_open_cache = 64sort_buffer_size = 512Knet_buffer_length = 8Kread_buffer_size = 256Kread_rnd_buffer_size = 512Kmyisam_sort_buffer_size = 8Mthread_cache_size = 8query_cache_size = 8Mtmp_table_size = 16Mexplicit_defaults_for_timestamp = true#skip-networkingmax_connections = 500max_connect_errors = 100open_files_limit = 65535log-bin=mysql-binbinlog_format=mixedserver-id = 1expire_logs_days = 10#loose-innodb-trx=0#loose-innodb-locks=0#loose-innodb-lock-waits=0#loose-innodb-cmp=0#loose-innodb-cmp-per-index=0#loose-innodb-cmp-per-index-reset=0#loose-innodb-cmp-reset=0#loose-innodb-cmpmem=0#loose-innodb-cmpmem-reset=0#loose-innodb-buffer-page=0#loose-innodb-buffer-page-lru=0#loose-innodb-buffer-pool-stats=0#loose-innodb-metrics=0#loose-innodb-ft-default-stopword=0#loose-innodb-ft-inserted=0#loose-innodb-ft-deleted=0#loose-innodb-ft-being-deleted=0#loose-innodb-ft-config=0#loose-innodb-ft-index-cache=0#loose-innodb-ft-index-table=0#loose-innodb-sys-tables=0#loose-innodb-sys-tablestats=0#loose-innodb-sys-indexes=0#loose-innodb-sys-columns=0#loose-innodb-sys-fields=0#loose-innodb-sys-foreign=0#loose-innodb-sys-foreign-cols=0default_storage_engine = InnoDB#innodb_data_home_dir = ${MYSQL_DARA_DIR}#innodb_data_file_path = ibdata1:10M:autoextend#innodb_log_group_home_dir = ${MYSQL_DARA_DIR}#innodb_buffer_pool_size = 16M#innodb_log_file_size = 5M#innodb_log_buffer_size = 8M#innodb_flush_log_at_trx_commit = 1#innodb_lock_wait_timeout = 50[mysqldump]quickmax_allowed_packet = 16M[mysql]no-auto-rehash[myisamchk]key_buffer_size = 20Msort_buffer_size = 20Mread_buffer = 2Mwrite_buffer = 2M[mysqlhotcopy]interactive-timeoutEOFcd ${MYSQL_DIR} scripts/mysql_install_db --user=mysql --datadir=${MYSQL_DARA_DIR} # add servicecp support-files/mysql.server /etc/init.d/mysql

到120行出错了,也就是 scripts/mysql_install_db --user=mysql --datadir=${MYSQL_DARA_DIR} 这里

问题解答

回答1:

把报错信息贴出来啊

回答2:

shell那里有小错误,粗心了,另外也得设置命令出错退出的,贴出修改后的shell:

#!/bin/shset -e # 'Exit immediately if a simple command exits with a non-zero status.'basepath=$(cd `dirname $0`; pwd)yum install -y gcc gcc-c++ ncurses-devel perl bison perlwget http://www.cmake.org/files/v2.8/cmake-2.8.10.2.tar.gztar -xzvf cmake-2.8.10.2.tar.gz cd cmake-2.8.10.2./bootstrapmake && make installgroupadd mysqluseradd -s /sbin/nologin -M -g mysql mysqlMYSQL_DIR='/usr/local/mysql'MYSQL_DARA_DIR='/usr/local/mysql/data'mkdir -p ${MYSQL_DIR}cd $basepathtar -zxvf mysql-5.6.29.tar.gz && cd mysql-5.6.29cmake -DCMAKE_INSTALL_PREFIX=${MYSQL_DIR} -DSYSCONFDIR=/etc -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DWITH_FEDERATED_STORAGE_ENGINE=1 -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8mb4 -DDEFAULT_COLLATION=utf8mb4_general_ci -DWITH_EMBEDDED_SERVER=1 -DENABLED_LOCAL_INFILE=1make && make installcd ${MYSQL_DIR}chown -R mysql:mysql .cat > /etc/my.cnf <<EOF[client]#password = your_passwordport= 3306socket = /tmp/mysql.sock[mysqld]port= 3306socket = /tmp/mysql.sockdatadir = ${MYSQL_DARA_DIR}skip-external-lockingkey_buffer_size = 16Mmax_allowed_packet = 1Mtable_open_cache = 64sort_buffer_size = 512Knet_buffer_length = 8Kread_buffer_size = 256Kread_rnd_buffer_size = 512Kmyisam_sort_buffer_size = 8Mthread_cache_size = 8query_cache_size = 8Mtmp_table_size = 16Mexplicit_defaults_for_timestamp = true#skip-networkingmax_connections = 500max_connect_errors = 100open_files_limit = 65535log-bin=mysql-binbinlog_format=mixedserver-id = 1expire_logs_days = 10#loose-innodb-trx=0#loose-innodb-locks=0#loose-innodb-lock-waits=0#loose-innodb-cmp=0#loose-innodb-cmp-per-index=0#loose-innodb-cmp-per-index-reset=0#loose-innodb-cmp-reset=0#loose-innodb-cmpmem=0#loose-innodb-cmpmem-reset=0#loose-innodb-buffer-page=0#loose-innodb-buffer-page-lru=0#loose-innodb-buffer-pool-stats=0#loose-innodb-metrics=0#loose-innodb-ft-default-stopword=0#loose-innodb-ft-inserted=0#loose-innodb-ft-deleted=0#loose-innodb-ft-being-deleted=0#loose-innodb-ft-config=0#loose-innodb-ft-index-cache=0#loose-innodb-ft-index-table=0#loose-innodb-sys-tables=0#loose-innodb-sys-tablestats=0#loose-innodb-sys-indexes=0#loose-innodb-sys-columns=0#loose-innodb-sys-fields=0#loose-innodb-sys-foreign=0#loose-innodb-sys-foreign-cols=0default_storage_engine = InnoDB#innodb_data_home_dir = ${MYSQL_DARA_DIR}#innodb_data_file_path = ibdata1:10M:autoextend#innodb_log_group_home_dir = ${MYSQL_DARA_DIR}#innodb_buffer_pool_size = 16M#innodb_log_file_size = 5M#innodb_log_buffer_size = 8M#innodb_flush_log_at_trx_commit = 1#innodb_lock_wait_timeout = 50[mysqldump]quickmax_allowed_packet = 16M[mysql]no-auto-rehash[myisamchk]key_buffer_size = 20Msort_buffer_size = 20Mread_buffer = 2Mwrite_buffer = 2M[mysqlhotcopy]interactive-timeoutEOFcd ${MYSQL_DIR} scripts/mysql_install_db --user=mysql --datadir=${MYSQL_DARA_DIR} # add servicecp support-files/mysql.server /etc/init.d/mysql

地址

相关文章: