gpt4 book ai didi

mysql - 启动 ror 应用程序时无法连接到 mysql

转载 作者:行者123 更新时间:2023-11-29 12:19:47 25 4
gpt4 key购买 nike

我通过这个链接安装了mysql-“https://www3.ntu.edu.sg/home/ehchua/programming/sql/MySQL_HowTo.html”。当我尝试通过命令启动mysql时,出现以下错误

E:\mysql folder\mysql\bin>mysqld --console
2015-03-23 00:54:03 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-03-23 00:54:03 4040 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-03-23 00:54:03 4040 [Note] InnoDB: The InnoDB memory heap is disabled
2015-03-23 00:54:03 4040 [Note] InnoDB: Mutexes and rw_locks use Windows nterlocked functions
2015-03-23 00:54:03 4040 [Note] InnoDB: Memory barrier is not used
2015-03-23 00:54:03 4040 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-03-23 00:54:03 4040 [Note] InnoDB: Not using CPU crc32 instructions
2015-03-23 00:54:03 4040 [Note] InnoDB: Initializing buffer pool, size =128.0M
2015-03-23 00:54:03 4040 [Note] InnoDB: Completed initialization of buffer pool
2015-03-23 00:54:03 4040 [ERROR] InnoDB: .\ibdata1 can't be opened in read-write mode
2015-03-23 00:54:03 4040 [ERROR] InnoDB: The system tablespace must be writable!

2015-03-23 00:54:03 4040 [ERROR] Plugin 'InnoDB' init function returned error.
2015-03-23 00:54:03 4040 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2015-03-23 00:54:03 4040 [ERROR] Unknown/unsupported storage engine: InnoDB
2015-03-23 00:54:03 4040 [ERROR] Aborting
2015-03-23 00:54:03 4040 [Note] Binlog end
2015-03-23 00:54:03 4040 [Note] Shutting down plugin 'partition'
2015-03-23 00:54:03 4040 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2015-03-23 00:54:03 4040 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2015-03-23 00:54:03 4040 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2015-03-23 00:54:03 4040 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2015-03-23 00:54:03 4040 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2015-03-23 00:54:03 4040 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2015-03-23 00:54:03 4040 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2015-03-23 00:54:03 4040 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2015-03-23 00:54:03 4040 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2015-03-23 00:54:03 4040 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2015-03-23 00:54:03 4040 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2015-03-23 00:54:03 4040 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2015-03-23 00:54:03 4040 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2015-03-23 00:54:03 4040 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2015-03-23 00:54:03 4040 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2015-03-23 00:54:03 4040 [Note] Shutting down plugin'INNODB_FT_DEFAULT_STOPWORD'
2015-03-23 00:54:03 4040 [Note] Shutting down plugin 'INNODB_METRICS'
2015-03-23 00:54:03 4040 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2015-03-23 00:54:03 4040 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2015-03-23 00:54:03 4040 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2015-03-23 00:54:03 4040 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2015-03-23 00:54:03 4040 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2015-03-23 00:54:03 4040 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2015-03-23 00:54:03 4040 [Note] Shutting down plugin 'INNODB_CMPMEM'
2015-03-23 00:54:03 4040 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2015-03-23 00:54:03 4040 [Note] Shutting down plugin 'INNODB_CMP'
2015-03-23 00:54:03 4040 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2015-03-23 00:54:03 4040 [Note] Shutting down plugin 'INNODB_LOCKS'
2015-03-23 00:54:03 4040 [Note] Shutting down plugin 'INNODB_TRX'
2015-03-23 00:54:03 4040 [Note] Shutting down plugin 'FEDERATED'
2015-03-23 00:54:03 4040 [Note] Shutting down plugin 'BLACKHOLE'
2015-03-23 00:54:03 4040 [Note] Shutting down plugin 'ARCHIVE'
2015-03-23 00:54:03 4040 [Note] Shutting down plugin 'MRG_MYISAM'
2015-03-23 00:54:03 4040 [Note] Shutting down plugin 'MyISAM'
2015-03-23 00:54:03 4040 [Note] Shutting down plugin 'MEMORY'
2015-03-23 00:54:03 4040 [Note] Shutting down plugin 'CSV'
2015-03-23 00:54:03 4040 [Note] Shutting down plugin 'sha256_password'
2015-03-23 00:54:03 4040 [Note] Shutting down plugin 'mysql_old_password'
2015-03-23 00:54:03 4040 [Note] Shutting down plugin 'mysql_native_password'
2015-03-23 00:54:03 4040 [Note] Shutting down plugin 'binlog'
2015-03-23 00:54:03 4040 [Note] mysqld: Shutdown complete

此外,当我启动 Rails 服务器时,它向我显示此错误 -“无法连接到'localhost'(10061)上的 MySQL 服务器”,我猜这是因为服务器未运行。如何启动 mysql 服务器?

最佳答案

看来您需要enable the explicit_defaults_for_timestamp system variable摆脱该警告。

来自 MySQL 5.6 的官方文档:

[Warning] TIMESTAMP with implicit DEFAULT value is deprecated.
Please use --explicit_defaults_for_timestamp server option (see
documentation for more details).
As indicated by the warning, to turn off the nonstandard behaviors,
enable the new explicit_defaults_for_timestamp system variable at
server startup. With this variable enabled, the server handles
TIMESTAMP as follows instead:

TIMESTAMP columns not explicitly declared as NOT NULL permit NULL values. Setting such a column to NULL sets it to NULL, not the current timestamp.

No TIMESTAMP column is assigned the DEFAULT CURRENT_TIMESTAMP or ON UPDATE CURRENT_TIMESTAMP attributes automatically. Those attributes must be explicitly specified.

TIMESTAMP columns declared as NOT NULL and without an explicit DEFAULT clause are treated as having no default value. For inserted rows that specify no explicit value for such a column, the result depends on the SQL mode. If strict SQL mode is enabled, an error occurs. If strict SQL mode is not enabled, the column is assigned the implicit default of '0000-00-00 00:00:00' and a warning occurs. This is similar to how MySQL treats other temporal types such as DATETIME.

关于mysql - 启动 ror 应用程序时无法连接到 mysql,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29198951/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com