Mac系统下源码编写翻译安装MySQL

作者:计算机知识

一、下载并解压到:/Users/xiechunping/Softwares/mysql-5.七.17
Mac系统下源码编写翻译安装MySQL。下载地址:

1、下载并解压到:/Users/xiechunping/Softwares/mysql-5.7.一七

Mac系统下源码编写翻译安装MySQL 五.⑦.17,mysql伍.七.一七

一、下载并解压到:/Users/xiechunping/Softwares/mysql-5.7.17
下载地址:

2、进入mysql-5.7.17,执行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、配置数据目录权限
chown -R _mysql:_mysql /usr/local/mysql/db_data

4、编写翻译并设置
make&&make install

5、安装数据库并运营
cd /usr/local/mysql
bin/mysql_install_db --user=mysql --datadir=/usr/local/mysql/db_data
support-files/mysql.server start

6、修改数据库root用户密码(第贰次进入密码为空)
修改:/usr/local/mysql/support-files/mysql.server第280行
为mysql的启航选项扩展:--user=mysql --skip-grant-tables --skip-networking
执行:
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: <输入新设的密码mysql543二壹>
mysql>SET PASSWORD = PASSWORD('mysql54321');
mysql>ALTER USER 'root'@'localhost' PASSWORD EXPIRE NEVER;
mysql>flush privileges;
mysql>quit; 

伍.七.17,mysql五.柒.17 一、下载并解压到:/Users/xiechunping/Softwares/mysql-伍.7.1柒下载地址:...

2、进入mysql-5.7.17,执行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

下载地址:

三、配置数据目录权限
chown -R _mysql:_mysql /usr/local/mysql/db_data

2、进入mysql-5.7.17,执行cmake

4、编写翻译并设置
make&&make install

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

五、安装数据库并运转
cd /usr/local/mysql
bin/mysql_install_db --user=mysql --datadir=/usr/local/mysql/db_data
support-files/mysql.server start

三、配置数据目录权限

6、修改数据库root用户密码(第三遍跻身密码为空)
修改:/usr/local/mysql/support-files/mysql.server第280行
为mysql的开发银行选项增添:--user=mysql --skip-grant-tables --skip-networking
执行:
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;

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

support-files/mysql.server stop
还原/usr/local/mysql/support-files/mysql.server文件
support-files/mysql.server start

四、编写翻译并设置

本文由bwin必赢发布,转载请注明来源

关键词: