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

时间:2015-03-22 19:37:46

标签: mysql ruby-on-rails

我通过以下链接安装了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服务器时,它向我显示此错误 - "无法连接到本地主机上的MySQL服务器' (10061)",我猜它是因为服务器没有运行。如何启动mysql服务器?

2 个答案:

答案 0 :(得分:1)

好像你需要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:
  

未显式声明为NOT NULL的TIMESTAMP列允许NULL   值。将此列设置为NULL会将其设置为NULL,而不是当前   时间戳。

     

没有为TIMERMAMP列分配DEFAULT CURRENT_TIMESTAMP或ON   自动更新CURRENT_TIMESTAMP属性。那些属性   必须明确指定。

     

TIMESTAMP列声明为NOT NULL且没有显式DEFAULT   子句被视为没有默认值。对于插入的行   为这样的列指定没有显式值,结果取决于   SQL模式。如果启用了严格的SQL模式,则会发生错误。如果严格   未启用SQL模式,将为该列分配隐式默认值   '0000-00-00 00:00:00'并发出警告。这与如何相似   MySQL处理其他时间类型,例如DATETIME。

答案 1 :(得分:0)

重新启动后,mysql服务器开始运行,然后错误仍然存​​在"无法连接到本地主机上的MySQL服务器' (10061)&#34 ;.它通过在database.yml文件中添加端口8888来解决。