如何在Ubuntu上安装后初始化MySQL数据库?

时间:2016-03-28 12:17:28

标签: mysql ubuntu installation initialization

我从源代码下载并安装了MySQL。我的安装目录是computeAvg()

我在手册中读到,我需要初始化数据库。所以我跑

/opt/mysql57/

这将创建包含4个文件的数据目录:

/opt/mysql57/bin/mysqld --initialize //
--user=mysql //
--datadir=/opt/mysql57/data //
--basedir=/opt/mysql57

这是运行ib_buffer_pool ibdata1 ib_logfile0 ib_logfile1

后error.log的结果
mysqld_safe

2016-03-28T11:54:34.110086Z mysqld_safe Starting mysqld daemon with databases from /opt/mysql-5.7/data
2016-03-28T11:54:34.114740Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2016-03-28T11:54:34.114781Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
2016-03-28T11:54:34.324309Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-03-28T11:54:34.324356Z 0 [Warning] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.
2016-03-28T11:54:34.324453Z 0 [Note] /opt/mysql-5.7/bin/mysqld (mysqld 5.7.11) starting as process 9169 ...
2016-03-28T11:54:34.324904Z 0 [Warning] Using pre 5.5 semantics to load error messages from /opt/mysql-5.7/lc-messages/.
2016-03-28T11:54:34.324962Z 0 [Warning] If this is not intended, refer to the documentation for valid usage of --lc-messages-dir and --language parameters.
2016-03-28T11:54:34.328134Z 0 [Note] InnoDB: PUNCH HOLE support available
2016-03-28T11:54:34.328173Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-03-28T11:54:34.328186Z 0 [Note] InnoDB: Uses event mutexes
2016-03-28T11:54:34.328198Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2016-03-28T11:54:34.328210Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-03-28T11:54:34.328397Z 0 [Note] InnoDB: Number of pools: 1
2016-03-28T11:54:34.328489Z 0 [Note] InnoDB: Using CPU crc32 instructions
2016-03-28T11:54:34.333094Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2016-03-28T11:54:34.339257Z 0 [Note] InnoDB: Completed initialization of buffer pool
2016-03-28T11:54:34.341979Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2016-03-28T11:54:34.353295Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2016-03-28T11:54:34.363215Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2016-03-28T11:54:34.363466Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2016-03-28T11:54:34.506889Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2016-03-28T11:54:34.508144Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2016-03-28T11:54:34.508174Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2016-03-28T11:54:34.508812Z 0 [Note] InnoDB: Waiting for purge to start
2016-03-28T11:54:34.559007Z 0 [Note] InnoDB: 5.7.11 started; log sequence number 1209961
2016-03-28T11:54:34.559797Z 0 [Note] Plugin 'FEDERATED' is disabled.
mysqld: Table 'mysql.plugin' doesn't exist
2016-03-28T11:54:34.559923Z 0 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
2016-03-28T11:54:34.560028Z 0 [ERROR] unknown variable 'key_buffer=16M'
2016-03-28T11:54:34.560044Z 0 [ERROR] Aborting

2016-03-28T11:54:34.560061Z 0 [Note] Binlog end
2016-03-28T11:54:34.560102Z 0 [Note] Shutting down plugin 'ngram'
2016-03-28T11:54:34.560121Z 0 [Note] Shutting down plugin 'partition'
2016-03-28T11:54:34.560134Z 0 [Note] Shutting down plugin 'BLACKHOLE'
2016-03-28T11:54:34.560145Z 0 [Note] Shutting down plugin 'ARCHIVE'
2016-03-28T11:54:34.560153Z 0 [Note] Shutting down plugin 'MyISAM'
2016-03-28T11:54:34.560164Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
2016-03-28T11:54:34.560171Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2016-03-28T11:54:34.560201Z 0 [Note] Shutting down plugin 'MEMORY'
2016-03-28T11:54:34.560207Z 0 [Note] Shutting down plugin 'CSV'
2016-03-28T11:54:34.560212Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
2016-03-28T11:54:34.560217Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2016-03-28T11:54:34.560224Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2016-03-28T11:54:34.560228Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2016-03-28T11:54:34.560233Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2016-03-28T11:54:34.560239Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2016-03-28T11:54:34.560247Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2016-03-28T11:54:34.560255Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2016-03-28T11:54:34.560263Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2016-03-28T11:54:34.560271Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2016-03-28T11:54:34.560279Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2016-03-28T11:54:34.560286Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2016-03-28T11:54:34.560291Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2016-03-28T11:54:34.560310Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2016-03-28T11:54:34.560318Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2016-03-28T11:54:34.560328Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2016-03-28T11:54:34.560338Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
2016-03-28T11:54:34.560347Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
2016-03-28T11:54:34.560358Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2016-03-28T11:54:34.560368Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2016-03-28T11:54:34.560377Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2016-03-28T11:54:34.560385Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2016-03-28T11:54:34.560390Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2016-03-28T11:54:34.560396Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2016-03-28T11:54:34.560400Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
2016-03-28T11:54:34.560406Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2016-03-28T11:54:34.560411Z 0 [Note] Shutting down plugin 'INNODB_CMP'
2016-03-28T11:54:34.560417Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2016-03-28T11:54:34.560422Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
2016-03-28T11:54:34.560436Z 0 [Note] InnoDB: Loading buffer pool(s) from /opt/mysql-5.7/data/ib_buffer_pool
2016-03-28T11:54:34.560459Z 0 [Note] Shutting down plugin 'INNODB_TRX'
2016-03-28T11:54:34.560477Z 0 [Note] Shutting down plugin 'InnoDB'
2016-03-28T11:54:34.560510Z 0 [Note] InnoDB: FTS optimize thread exiting.
2016-03-28T11:54:34.560591Z 0 [Note] InnoDB: Starting shutdown...
2016-03-28T11:54:34.560650Z 0 [Note] InnoDB: Buffer pool(s) load completed at 160328 13:54:34 (/opt/mysql-5.7/data/ib_buffer_pool was empty)
2016-03-28T11:54:34.560682Z 0 [Note] InnoDB: Dumping buffer pool(s) to /opt/mysql-5.7/data/ib_buffer_pool
2016-03-28T11:54:34.560784Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 160328 13:54:34
2016-03-28T11:54:35.974942Z 0 [Note] InnoDB: Shutdown completed; log sequence number 1209980
2016-03-28T11:54:35.977389Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2016-03-28T11:54:35.977472Z 0 [Note] Shutting down plugin 'sha256_password'
2016-03-28T11:54:35.977547Z 0 [Note] Shutting down plugin 'mysql_native_password'
2016-03-28T11:54:35.977598Z 0 [Note] Shutting down plugin 'keyring_file'
2016-03-28T11:54:35.977870Z 0 [Note] Shutting down plugin 'binlog'
2016-03-28T11:54:35.978081Z 0 [Note] /opt/mysql-5.7/bin/mysqld: Shutdown complete

2016-03-28T11:54:35.987275Z mysqld_safe mysqld from pid file /var/run/mysqld/mysqld57.pid ended

但是如果没有运行mysql,我就无法运行[ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.

我做错了什么?我没想到什么,我是linux新手 - 昨天安装了ubuntu。

我没有使用apg-get安装mysql,因为我需要运行多个版本的mysql和mariadb。

感谢您的帮助。

0 个答案:

没有答案
相关问题