編譯mysql5 6 編譯安裝mysql5 6

2021-10-17 11:53:48 字數 1482 閱讀 3584

mysqlwget

tar -zxvf mysql-5.6.33.tar.gz

tar -zxvf cmake-2.8.5.tar.gz

cd cmake-2.8.5

安裝編譯工具./bootstrap --prefix=/usr/local/cmake

sudo gmake && sudo gmake install

作乙個軟鏈作為全域性變數ln -s /usr/local/cmake/bin/cmake /usr/bin

tar -zxvf boost_1_59_0.tar.gz

mkdir /usr/local/boost

mv boost_1_59_0/* /usr/local/boost

sudo groupadd mysql

sudo useradd -g mysql mysql

cd mysql-5.6.33

安裝必要工具yum -y install ncurses-devel

編譯安裝mysqlcmake -dcmake_install_prefix=/usr/local/mysql -dmysql_datadir=/usr/local/mysql/data -dextra_charsets=all -ddefault_charset=utf8 -ddefault_collation=utf8_general_ci -ddefault_collation=utf8_general_ci -dmysql_tcp_port=3306 -dmysql_user=mysql -dwith_myisam_storage_engine=1 -dwith_innobase_storage_engine=1 -dwith_archive_storage_engine=1 -dwith_blackhole_storage_engine=1 -dwith_memory_storage_engine=1 -dwith_boost=/usr/local/boost

編譯錯誤需要刪除 rm cmakecache.txt 重新編譯

sudo make && sudo make installmysql安裝完成了cd /usr/local/mysql/scripts/

sudo ./mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data

修改配置 sudo vi /usr/local/mysql/my.conf

basedir = /usr/local/mysql

datadir = /usr/local/mysql/data

socket = /tmp/mysql.sock

cd /usr/local/mysql/support-files

sudo cp mysql.server /etc/rc.d/init.d/mysqld

新增隨系統啟動chkconfig --add mysqld

啟動完成sudo service mysqld start

mysql5 6編譯安裝

安裝mysql5.6 安裝cmake及依賴 yum install cmake wget gcc c gcc ncurses devel git perl perl devel y centos7安裝mysql 檢查 mysql 是否已安裝 yum list installed grep mysql...

mysql5 6編譯安裝

1.新增使用者 root web01 tools useradd s sbin nologin m mysql root lb01 id mysql uid 27 mysql gid 27 mysql groups 27 mysql 2.安裝相關依賴 yum install ncurses deve...

mysql5 6編譯安裝

工具 yum y install gcc yum y install gcc c yum y install make yum y install cmake 注 mysql 5.5後不再使用 configure 改用 cmake 編譯工具 wget tar zxf cmake 3.1.1.tar....