Tutorial on compiling and installing MySQL 5.7.17 from source code on Mac

Tutorial on compiling and installing MySQL 5.7.17 from source code on Mac

1. Download and unzip to: /Users/xiechunping/Softwares/mysql-5.7.17

Download address: http://ftp.ntu.edu.tw/pub/MySQL/Downloads/MySQL-5.7/mysql-boost-5.7.17.tar.gz

2. Enter mysql-5.7.17 and execute 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. Configure data directory permissions

chown -R _mysql:_mysql /usr/local/mysql/db_data

4. Compile and install

make&&make install

5. Install the database and start it

cd /usr/local/mysql
bin/mysql_install_db --user=mysql --datadir=/usr/local/mysql/db_data
support-files/mysql.server start

6. Change the database root user password (the password is blank for the first entry)

Modify: /usr/local/mysql/support-files/mysql.server line 280

Add the following startup options to mysql: --user=mysql --skip-grant-tables --skip-networking

implement:

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

Restore the /usr/local/mysql/support-files/mysql.server file

support-files/mysql.server start
bin/mysql -uroot -p
Enter 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 is the tutorial for compiling and installing MySQL 5.7.17 from source code on Mac system. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

You may also be interested in:
  • Solution to forgetting the MYSQL database password under MAC
  • Download MySQL 5.7 and detailed installation diagram for MySql on Mac
  • Detailed graphic and text instructions for installing MySQL 5.7.20 on Mac OS
  • Solution to forget password when installing MySQL on Linux/Mac
  • Detailed steps to configure Apache + PHP + MySQL operating environment in Mac OS X
  • What to do if you forget the initial password when installing MySQL on Mac
  • How to modify the forgotten password when installing MySQL on Mac
  • Detailed steps to install mysql5.7.18 on Mac
  • MySQL installation and configuration tutorial for Mac
  • Detailed installation and configuration of MySql on Mac
  • Solution to forgetting mysql password in MAC
  • Configuring MySQL and Squel Pro on Mac

<<:  11 Linux KDE applications you didn't know about

>>:  Summary of js execution context and scope

Recommend

Four practical tips for JavaScript string operations

Table of contents Preface 1. Split a string 2. JS...

JS version of the picture magnifying glass effect

This article shares the specific code of JS to ac...

Detailed explanation of common usage of MySQL query conditions

This article uses examples to illustrate the comm...

Detailed explanation of the knowledge points of using TEXT/BLOB types in MySQL

1. The difference between TEXT and BLOB The only ...

CSS3 uses transform to create a moving 2D clock

Now that we have finished the transform course, l...

The perfect solution for highlighting keywords in HTML

I recently encountered a feature while working on...

Summary of some tips on MySQL index knowledge

Table of contents 1. Basic knowledge of indexing ...

Tutorial on using the hyperlink tag in HTML

The various HTML documents of the website are con...

Summary of how to add root permissions to users in Linux

1. Add a user . First, use the adduser command to...

Implementation idea of ​​left alignment of the last row of flex box layout

Using flex layout, if it is a nine-square grid, i...

mysql5.7 create user authorization delete user revoke authorization

1. Create a user: Order: CREATE USER 'usernam...

The best explanation of HTTPS

Good morning everyone, I haven’t updated my artic...

How to operate Linux file and folder permissions

Linux file permissions First, let's check the...

Solution to CSS flex-basis text overflow problem

The insignificant flex-basis has caused a lot of ...