MySQL 5.7.17 tutorial for compiling and installing source code in Mac system, mysql5.7.17

Source: Internet
Author: User

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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.