除了使用 make 之外,还有其他使用自定义配置安装 MySQL 的方法吗?

除了使用 make 之外,还有其他使用自定义配置安装 MySQL 的方法吗?

我刚刚下载了完整的游戏源代码,打算在我的 CentOS 7 上构建一个网络服务器。但是,需要很多库,所需的步骤之一是使用自定义配置在自定义目录中安装 MySQL。

这是我需要安装的东西的列表:

  1. ncurses-5.9.tar.gz
  2. libedit-20141030-3.1.tar.gz
  3. cmake-2.8.10.2.tar.gz
  4. mysql-5.6.21.tar.gz

对于mysql本身,我需要sql-common/client.c在解压后的第1911行修改mysql-5.6.21.tar.gz,添加以下代码:

const char *cli_read_statistics(MYSQL *mysql);
int cli_unbuffered_fetch(MYSQL *mysql, char **row);
int cli_stmt_execute(MYSQL_STMT *stmt);
int cli_read_binary_rows(MYSQL_STMT *stmt);
my_bool cli_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt);
MYSQL_FIELD *cli_list_fields(MYSQL *mysql);

之后,我需要cmake像这样编译它:

cmake -DCMAKE_INSTALL_PREFIX=/data/local/tool/mysql-5.6.21 \
-DMYSQL_DATADIR=/data/local/tool/mysql-5.6.21/mysql_data \
-DSYSCONFDIR=/data/local/tool/mysql-5.6.21/mysql_etc -DEXTRA_CHARSETS=all \
-DDEFAULT_CHARSET=utf8mb4 \
-DDEFAULT_COLLATION=utf8mb4_unicode_ci \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DWITH_PERFSCHEMA_STORAGE_ENGINE=1 \
-DMYSQL_UNIX_ADDR=/tmp/mysqld.sock \
-DMYSQL_TCP_PORT=3360 -DWITH_DEBUG=0 \
-DENABLED_LOCAL_INFILE=1 \
-DEDITLINE_INCLUDE_DIR=/data/local/libs/libedit-20141029-3.1/include/editline  \
-DEDITLINE_LIBRARY=/data/local/libs/libedit-20141029-3.1/lib/libedit.so \
-DWITH_EDITLINE=system && make && make install

一切都很好,直到我运行./scripts/mysql_install_db --defaults-file=./my.cnf --user=mysql然后出现此错误:

nstalling MySQL system tables...2024-04-13 10:26:57 0 [Warning] Using unique option prefix character-set-client instead of character-set-client-handshake is deprecated and will be removed in a future release. Please use the full name instead. 
2024-04-13 10:26:57 0 [Warning] ./bin/mysqld: ignoring option '--character-set-client-handshake' due to invalid value 'utf8mb4' 
2024-04-13 10:26:57 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 
2024-04-13 10:26:57 12733 [Note] InnoDB: Using atomics to ref count buffer pool pages 
2024-04-13 10:26:57 12733 [Note] InnoDB: The InnoDB memory heap is disabled 
2024-04-13 10:26:57 12733 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 
2024-04-13 10:26:57 12733 [Note] InnoDB: Memory barrier is not used 
2024-04-13 10:26:57 12733 [Note] InnoDB: Compressed tables use zlib 1.2.3 
2024-04-13 10:26:57 12733 [Note] InnoDB: Using CPU crc32 instructions 
2024-04-13 10:26:57 12733 [Note] InnoDB: Initializing buffer pool, size = 128.0M 
2024-04-13 10:26:57 12733 [Note] InnoDB: Completed initialization of buffer pool 
2024-04-13 10:26:57 12733 [Note] InnoDB: Highest supported file format is Barracuda. 
2024-04-13 10:26:57 12733 [Note] InnoDB: 128 rollback segment(s) are active. 
2024-04-13 10:26:57 12733 [Note] InnoDB: Waiting for purge to start 
2024-04-13 10:26:57 12733 [Note] InnoDB: 5.6.21 started; log sequence number 1600637 
ERROR: 1  Can't create/write to file '/data/local/tool/mysql-5.6.21/mysql_data/mysql/db.MYI' (Errcode: 13 - Permission denied) 
2024-04-13 10:26:57 12733 [ERROR] Aborting 
2024-04-13 10:26:57 12733 [Note] Binlog end 
2024-04-13 10:26:57 12733 [Note] InnoDB: FTS optimize thread exiting. 
2024-04-13 10:26:57 12733 [Note] InnoDB: Starting shutdown... 
2024-04-13 10:26:58 12733 [Note] InnoDB: Shutdown completed; log sequence number 1600647 
2024-04-13 10:26:58 12733 [Note] ./bin/mysqld: Shutdown complete

尽管主人/data/local/tool/mysql-5.6.21/mysql_datamysql.

那么还有其他替代方法来使用上面的配置安装mysql吗?或者是否可以使用安装 mysqlyum并修改某些内容来复制上述配置?

相关内容