mysql compile options

本文详细介绍了一种MySQL从源码进行静态编译的具体配置方法,包括了CFLAGS及CXXFLAGS等编译选项的设置,以及通过configure脚本指定各种路径、特性与编译参数。适用于希望深入了解MySQL定制化编译流程的技术人员。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

CFLAGS="-O3" CXX=gcc CXXFLAGS="-O3 -felide-constructors -fno-exceptions -fno-rtti -fomit-frame-pointer -ffixed-ebp" 

 

./configure  --prefix=/usr/local/mysql --enable-assembler --with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock --without-debug --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static --with-charset=gbk --with-collation=gbk_chinese_ci --with-extra-charsets=all

### MySQL on ARM64 Installation and Configuration #### Uninstalling Existing Database Packages Before installing a new version of MySQL, it is important to remove any existing conflicting packages such as MariaDB or previous versions of MySQL. For instance, the command `rpm -qa mariadb*` lists all installed MariaDB-related packages while `rpm -e --nodeps mariadb-libs-5.5.44-2.el7.centos.x86_64` uninstalls specific ones without checking dependencies[^2]. #### System Environment Verification Verifying system environment details ensures compatibility with the target architecture. Commands like `cat /etc/redhat-release` provide information about the operating system distribution whereas `uname -r` reveals kernel version along with architecture type which should be noted when preparing for an ARM64-specific installation. #### Installing MySQL 5.7 on ARM64 Architecture For installations specifically targeting ARM64 architectures under Ubuntu, preparation includes ensuring that necessary repositories are added correctly since not all official sources may support this platform directly at first glance. After setting up appropriate repository configurations: ```bash sudo apt-get update && sudo apt-get install mysql-server ``` This approach leverages pre-built binaries optimized for ARM processors whenever available through community-maintained channels[^1]. If opting for source compilation due to lack of suitable binary distributions, ```bash cmake . \ -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \ -DMYSQL_DATADIR=/var/lib/mysql \ -DSYSCONFDIR=/etc \ -DWITH_MYISAM_STORAGE_ENGINE=1 \ -DWITH_INNOBASE_STORAGE_ENGINE=1 \ -DWITH_PARTITION_STORAGE_ENGINE=1 \ -DEXTRA_CHARSETS=all \ -DDEFAULT_CHARSET=utf8mb4 \ -DDEFAULT_COLLATION=utf8mb4_general_ci \ -DDOWNLOAD_BOOST=1 \ -DWITH_BOOST=/path/to/boost_source_directory make && make install ``` Such steps outline compiling from source tailored towards ARM-based systems where customization might offer better performance tuning options over generic builds. #### Post-installation Configuration Adjustments After successful installation via either method mentioned above, further adjustments can enhance security settings by running scripts provided within MySQL package directories aimed at securing initial setup parameters. --related questions-- 1. What considerations must one take into account before uninstalling current database software? 2. How does verifying the system's OS and hardware specifics impact choosing between different methods of MySQL installation? 3. In what scenarios would someone prefer building MySQL from source rather than using precompiled binaries? 4. Can you explain how configuring storage engines during compile-time affects MySQL server functionality post-deployment?
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值