MySQL 5.7.17 tutorial for compiling and installing source code in Mac system, mysql5.7.17
1. Download and unzip to:/Users/xiechunping/Softwares/mysql-5.7.17
: Http://ftp.ntu.edu.tw/pub/MySQL/Downloads/MySQL-5.7/mysql-boost-5.7.17.tar.gz
2. Go to the mysql-5.7.17 and execute cmake
cd ../mysql-5.7.17cmake -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. configure data directory permissions
chown -R _mysql:_mysql /usr/local/mysql/db_data
4. Compile and install
make&&make install
5. Install and start the database
cd /usr/local/mysqlbin/mysql_install_db --user=mysql --datadir=/usr/local/mysql/db_datasupport-files/mysql.server start
6. Modify the password of the root user of the database (enter the password blank for the first time)
Modify:/usr/local/mysql/support-files/mysql. server line 280th
Add -- user = mysql -- skip-grant-tables -- skip-networking for mysql startup options.
Run:
support-files/mysql.server stop && support-files/mysql.server stopbin/mysql -u root mysqlmysql>UPDATE user SET authentication_string=PASSWORD('mysql54321') where USER='root';mysql>FLUSH PRIVILEGES;mysql>quit;
support-files/mysql.server stop
Restore the/usr/local/mysql/support-files/mysql. server File
support-files/mysql.server start
Bin/mysql-uroot-pEnter password: <enter the new PASSWORD mysql54321> mysql> set password = password ('mysql54321 '); mysql> alter user 'root' @ 'localhost' password expire never; mysql> flush privileges; mysql> quit;
The above section describes how to compile and install MySQL 5.7.17 In the Mac system. I hope it will help you. If you have any questions, please leave a message, the editor will reply to you in a timely manner. Thank you very much for your support for the help House website!