詳細(xì)說明Mac系統(tǒng)下源碼編譯安裝MySQL 5.7.17的圖文說明教程
發(fā)表時(shí)間:2023-09-10 來源:明輝站整理相關(guān)軟件相關(guān)文章人氣:
[摘要]這篇文章主要介紹了Mac系統(tǒng)下源碼編譯安裝MySQL 5.7.17的教程詳解,非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友可以參考下1、下載并解壓到:/Users/xiechunping/Softwares/mysql-5.7.172、進(jìn)入mysql-5.7.17,執(zhí)行cmakecd ../mysql-...
這篇文章主要介紹了Mac系統(tǒng)下源碼編譯
安裝MySQL 5.7.17的教程詳解,非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友可以參考下
1、下載并解壓到:/Users/xiechunping/Softwares/mysql-5.7.17
2、進(jìn)入mysql-5.7.17,執(zhí)行cmake
cd ../mysql-5.7.17
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql
-DMYSQL_UNIX_ADDR=/tmp/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
-DWITH_PARTITION_STORAGE_ENGINE=1
-DENABLED_LOCAL_INFILE=1
-DMYSQL_USER=_mysql
-DMYSQL_TCP_PORT=3306
-DMYSQL_DATADIR=/usr/local/mysql/db_data
-DDOWNLOAD_BOOST=1
-DWITH_BOOST=/Users/xiechunping/Softwares/mysql-5.7.17/boost
3、配置數(shù)據(jù)目錄權(quán)限
chown -R _mysql:_mysql /usr/local/mysql/db_data
4、編譯并安裝
make&&make install
5、安裝數(shù)據(jù)庫(kù)并啟動(dòng)
cd /usr/local/mysql
bin/mysql_install_db --user=mysql --datadir=/usr/local/mysql/db_data
support-files/mysql.server start
6、修改數(shù)據(jù)庫(kù)root用戶密碼(首次進(jìn)入密碼為空)
修改:/usr/local/mysql/support-files/mysql.server第280行
為mysql的啟動(dòng)選項(xiàng)增加:--user=mysql --skip-grant-tables --skip-networking
執(zhí)行:
support-files/mysql.server stop && support-files/mysql.server stop
bin/mysql -u root mysql
mysql>UPDATE user SET authentication_string=PASSWORD('mysql54321') where USER='root';
mysql>FLUSH PRIVILEGES;
mysql>quit;
support-files/mysql.server stop
還原/usr/local/mysql/support-files/mysql.server文件
support-files/mysql.server start
bin/mysql -uroot -p
Enter password: <輸入新設(shè)的密碼mysql54321>
mysql>SET PASSWORD = PASSWORD('mysql54321');
mysql>ALTER USER 'root'@'localhost' PASSWORD EXPIRE NEVER;
mysql>flush privileges;
mysql>quit;
以上就是詳解Mac系統(tǒng)下源碼編譯安裝MySQL 5.7.17的教程的詳細(xì)內(nèi)容,更多請(qǐng)關(guān)注php中文網(wǎng)其它相關(guān)文章!
學(xué)習(xí)教程快速掌握從入門到精通的SQL知識(shí)。