[
root@mysqldb15 mysql]#
./scripts/mysql_install_db --defaults-file=/data/mysql/mysql3376/my3376.cnf
WARNING: The host ‘mysqldb15‘ could not be looked up with /usr/local/mysql/bin/resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MySQL version. The MySQL daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MySQL privileges !
这个错误应该是在/etc/hosts里面没有解析,解决方法:
Installing MySQL system tables...2016-03-31 14:50:18 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-03-31 14:50:18 0 [Note] ./bin/mysqld (mysqld 5.6.29-log) starting as process 6160 ...
缺少explicit_defaults_for_timestamp参数,加上即可
[root@localhost]# tail -f error3376.log
2016-03-31 15:00:16 6265 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-03-31 15:00:16 6265 [Note] InnoDB: The InnoDB memory heap is disabled
2016-03-31 15:00:16 6265 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-03-31 15:00:16 6265 [Note] InnoDB: Memory barrier is not used
2016-03-31 15:00:16 6265 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-03-31 15:00:16 6265 [Note] InnoDB: Using Linux native AIO
2016-03-31 15:00:16 6265 [Note] InnoDB: Not using CPU crc32 instructions
2016-03-31 15:00:16 6265 [Note] InnoDB: Initializing buffer pool, size = 1.0G
2016-03-31 15:00:16 6265 [Note] InnoDB: Completed initialization of buffer pool
2016-03-31 15:00:16 6265 [Note] InnoDB: Restoring page 0 of tablespace 0
2016-03-31 15:00:16 6265 [Warning] InnoDB: Doublewrite does not have page_no=0 of space: 0
2016-03-31 15:00:16 6265 [ERROR] InnoDB: space header page consists of zero bytes in data file ./ibdata1
2016-03-31 15:00:16 6265 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!
2016-03-31 15:00:16 6265 [ERROR] Plugin ‘InnoDB‘ init function returned error.
2016-03-31 15:00:16 6265 [ERROR] Plugin ‘InnoDB‘ registration as a STORAGE ENGINE failed.
2016-03-31 15:00:16 6265 [ERROR] Unknown/unsupported storage engine: InnoDB
2016-03-31 15:00:16 6265 [ERROR] Aborting
2016-03-31 15:00:16 6265 [Note] Binlog end
2016-03-31 15:00:16 6265 [Note] ./bin/mysqld: Shutdown complete
/usr/local/mysql/bin/mysqld --defaults-file=/data/mysql/mysql3306/my3306.cnf &
mysql -uroot -p -S /tmp/mysql3306.sock
mysqladmin -u root password ‘123‘
或者
mysql>set password for ‘root‘@‘localhost‘=password(‘123‘);
mysql>flush privileges;
grant shutdown on *.* to admin@‘localhost‘ identified by ‘1234‘;
mysqladmin -S /tmp/mysql3306.sock shutdown --user=amin --password=1234
或者
mysqladmin -S /tmp/mysql3306.sock shutdown --user=amin -p1234
设置开机启动,根据自己的需求:echo "/usr/local/mysql/bin/mysqld --defaults-file=/data/mysql/mysql3306/my3306.cnf &" >>/etc/rc.local
每次敲这些命令都太繁琐,我们可以将启动关闭写成相关脚本:
设置启动脚本:/usr/local/mysql/bin/mysqld --defaults-file=/data/mysql/mysql3306/my3306.cnf &
设置关机脚本:mysqladmin -S /tmp/mysql3306.sock shutdown --user=root--password=123
设置重启脚本:mysqladmin -S /tmp/mysql3306.sock shutdown --user=root --password=123
/usr/local/mysql/bin/mysqld --defaults-file=/data/mysql/mysql3306/my3306.cnf &
导入数据:mysql -uroot -p -S /tmp/mysql3306.sock < backup.sql