centos7下的mysql 5.7.17,执行命令启动数据库的时候报错:
systemctl start mysqld.service
- 2017-11-03T19:08:28.363912+08:00 0 [Note] /usr/sbin/mysqld (mysqld 5.7.17-log) starting as process 21010 ...
- 2017-11-03T19:08:28.367804+08:00 0 [Note] InnoDB: PUNCH HOLE support available
- 2017-11-03T19:08:28.367836+08:00 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
- 2017-11-03T19:08:28.367844+08:00 0 [Note] InnoDB: Uses event mutexes
- 2017-11-03T19:08:28.367849+08:00 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
- 2017-11-03T19:08:28.367853+08:00 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
- 2017-11-03T19:08:28.367859+08:00 0 [Note] InnoDB: Using Linux native AIO
- 2017-11-03T19:08:28.367878+08:00 0 [Note] InnoDB: Adjusting innodb_buffer_pool_instances from 8 to 1 since innodb_buffer_pool_size is less than 1024 MiB
- 2017-11-03T19:08:28.368450+08:00 0 [Note] InnoDB: Number of pools: 1
- 2017-11-03T19:08:28.368574+08:00 0 [Note] InnoDB: Using CPU crc32 instructions
- 2017-11-03T19:08:28.370795+08:00 0 [Note] InnoDB: Initializing buffer pool, total size = 256M, instances = 1, chunk size = 128M
- 2017-11-03T19:08:28.386993+08:00 0 [Note] InnoDB: Completed initialization of buffer pool
- 2017-11-03T19:08:28.390005+08:00 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
- 2017-11-03T19:08:28.423716+08:00 0 [Note] InnoDB: Highest supported file format is Barracuda.
- 2017-11-03T19:08:28.532555+08:00 0 [Note] InnoDB: Creating shared tablespace for temporary tables
- 2017-11-03T19:08:28.532627+08:00 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
- 2017-11-03T19:08:28.630549+08:00 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
- 2017-11-03T19:08:28.631466+08:00 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
- 2017-11-03T19:08:28.631483+08:00 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
- 2017-11-03T19:08:28.632485+08:00 0 [Note] InnoDB: Waiting for purge to start
- 2017-11-03T19:08:28.683674+08:00 0 [Note] InnoDB: 5.7.17 started; log sequence number 1210395
- 2017-11-03T19:08:28.684392+08:00 0 [Note] InnoDB: Loading buffer pool(s) from /alidata1/mysql/data/ib_buffer_pool
- 2017-11-03T19:08:28.684694+08:00 0 [Note] Plugin 'FEDERATED' is disabled.
- mysqld: Table 'mysql.plugin' doesn't exist
- 2017-11-03T19:08:28.684846+08:00 0 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
- 2017-11-03T19:08:28.688758+08:00 0 [Note] InnoDB: Buffer pool(s) load completed at 171103 19:08:28
- 2017-11-03T19:08:28.692784+08:00 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
- 2017-11-03T19:08:28.696746+08:00 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
- 2017-11-03T19:08:28.696945+08:00 0 [Warning] CA certificate ca.pem is self signed.
- 2017-11-03T19:08:28.698203+08:00 0 [Note] Server hostname (bind-address): '192.168.2.71'; port: 3306
- 2017-11-03T19:08:28.698235+08:00 0 [Note] - '192.168.2.71' resolves to '192.168.2.71';
- 2017-11-03T19:08:28.698270+08:00 0 [Note] Server socket created on IP: '192.168.2.71'.
- 2017-11-03T19:08:28.701031+08:00 0 [Warning] Failed to open optimizer cost constant tables
-
- 2017-11-03T19:08:28.701146+08:00 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
- 2017-11-03T19:08:28.701186+08:00 0 [ERROR] Aborting
解决办法是:先初始化出来一个数据库,datadir和my.cnf里的一致
- mysqld --initialize --datadir=/alidata1/mysql/data
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/20893244/viewspace-2146811/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/20893244/viewspace-2146811/