1. 下载:
mysql-5.7.10-osx10.10-x86_64.tar.gz
2. 步骤:
tar xvfz mysql-5.7.10-osx10.10-x86_64.tar.gz -C /Users/yccn/ice/apps_install/
ln -s /Users/yccn/ice/apps_install/mysql-5.7.10-osx10.10-x86_64/ /usr/local/mysql
sudo chown -R mysql:mysql /usr/local/mysql/*
sudo chown -R mysql:mysql /data/ice/conf/mysql/
sudo chown -R mysql:mysql /data/ice/data/mysql/
sudo chown -R mysql:mysql /data/ice/logs/mysql/
sudo cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf
sudo vi my.cnf
需注意的两个配置:
explicit_defaults_for_timestamp=true
lower_case_table_names=2
初始化Mysql数据库&密码: sudo /usr/local/mysql/bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/data/ice/data/mysql/
需要修改初始化密码: sudo /usr/local/mysql/bin/mysql_secure_installation
启动Mysql数据库: /usr/local/mysql/bin/mysqld_safe --datadir=/data/ice/data/mysql --pid-file=/data/ice/data/mysql/mysql.pid &
问题:
2015-12-18T08:14:46.309854Z 0 [Warning] InnoDB: New log files created, LSN=45790
2015-12-18T08:14:46.356069Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2015-12-18T08:14:46.439254Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server
has been started. Generating a new UUID: 6679a4e4-a55f-11e5-b8f4-ac97f1f3ebc2.
2015-12-18T08:14:46.444015Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2015-12-18T08:14:46.449800Z 1 [Note] A temporary password is generated for root@localhost: A:Cz0aM,GXdF