mysql InnoDB: Error: "mysql"."innodb_table_stats

附上错误日志:

2015-06-23 22:39:06 1252 [Note] Giving 0 client threads a chance to die gracefully
2015-06-23 22:39:06 1252 [Note] Shutting down slave threads
2015-06-23 22:39:06 1252 [Note] Forcefully disconnecting 0 remaining clients
2015-06-23 22:39:06 1252 [Note] Binlog end
2015-06-23 22:39:09 1252 [Note] Shutting down plugin 'partition'
2015-06-23 22:39:09 1252 [Note] Shutting down plugin 'BLACKHOLE'
2015-06-23 22:39:09 1252 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2015-06-23 22:39:09 1252 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2015-06-23 22:39:09 1252 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2015-06-23 22:39:09 1252 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2015-06-23 22:39:09 1252 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2015-06-23 22:39:09 1252 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2015-06-23 22:39:09 1252 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2015-06-23 22:39:09 1252 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2015-06-23 22:39:09 1252 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2015-06-23 22:39:09 1252 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2015-06-23 22:39:09 1252 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2015-06-23 22:39:09 1252 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2015-06-23 22:39:09 1252 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2015-06-23 22:39:09 1252 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2015-06-23 22:39:09 1252 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2015-06-23 22:39:09 1252 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2015-06-23 22:39:09 1252 [Note] Shutting down plugin 'INNODB_METRICS'
2015-06-23 22:39:09 1252 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2015-06-23 22:39:09 1252 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2015-06-23 22:39:09 1252 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2015-06-23 22:39:09 1252 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2015-06-23 22:39:09 1252 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2015-06-23 22:39:09 1252 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2015-06-23 22:39:09 1252 [Note] Shutting down plugin 'INNODB_CMPMEM'
2015-06-23 22:39:09 1252 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2015-06-23 22:39:09 1252 [Note] Shutting down plugin 'INNODB_CMP'
2015-06-23 22:39:09 1252 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2015-06-23 22:39:09 1252 [Note] Shutting down plugin 'INNODB_LOCKS'
2015-06-23 22:39:09 1252 [Note] Shutting down plugin 'INNODB_TRX'
2015-06-23 22:39:09 1252 [Note] Shutting down plugin 'InnoDB'
2015-06-23 22:39:09 1252 [Note] InnoDB: FTS optimize thread exiting.
2015-06-23 22:39:09 1252 [Note] InnoDB: Starting shutdown...
2015-06-23 22:39:12 1252 [Note] InnoDB: Shutdown completed; log sequence number 44832642
2015-06-23 22:39:12 1252 [Note] Shutting down plugin 'ARCHIVE'
2015-06-23 22:39:12 1252 [Note] Shutting down plugin 'MyISAM'
2015-06-23 22:39:12 1252 [Note] Shutting down plugin 'CSV'
2015-06-23 22:39:12 1252 [Note] Shutting down plugin 'MRG_MYISAM'
2015-06-23 22:39:12 1252 [Note] Shutting down plugin 'MEMORY'
2015-06-23 22:39:12 1252 [Note] Shutting down plugin 'sha256_password'
2015-06-23 22:39:12 1252 [Note] Shutting down plugin 'mysql_old_password'
2015-06-23 22:39:12 1252 [Note] Shutting down plugin 'mysql_native_password'
2015-06-23 22:39:12 1252 [Note] Shutting down plugin 'binlog'
2015-06-23 22:39:12 1252 [Note] /usr/sbin/mysqld: Shutdown complete

150623 22:39:12 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
150623 22:39:39 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2015-06-23 22:39:39 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-06-23 22:39:39 1190 [Warning] Buffered warning: Changed limits: max_open_files: 1024 (requested 5000)

2015-06-23 22:39:39 1190 [Warning] Buffered warning: Changed limits: table_cache: 431 (requested 2000)

2015-06-23 22:39:39 1190 [Note] Plugin 'FEDERATED' is disabled.
2015-06-23 22:39:39 1190 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-06-23 22:39:39 1190 [Note] InnoDB: The InnoDB memory heap is disabled
2015-06-23 22:39:39 1190 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-06-23 22:39:39 1190 [Note] InnoDB: Memory barrier is not used
2015-06-23 22:39:39 1190 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-06-23 22:39:39 1190 [Note] InnoDB: Using Linux native AIO
2015-06-23 22:39:39 1190 [Note] InnoDB: Not using CPU crc32 instructions
2015-06-23 22:39:39 1190 [Note] InnoDB: Initializing buffer pool, size = 1.0G
2015-06-23 22:39:40 1190 [Note] InnoDB: Completed initialization of buffer pool
2015-06-23 22:39:40 1190 [Note] InnoDB: Highest supported file format is Barracuda.
2015-06-23 22:39:40 1190 [Note] InnoDB: 128 rollback segment(s) are active.
2015-06-23 22:39:40 1190 [Note] InnoDB: Waiting for purge to start
2015-06-23 22:39:40 1190 [Note] InnoDB: 5.6.22 started; log sequence number 44832642
2015-06-23 22:39:41 1190 [Note] Server hostname (bind-address): '*'; port: 3306
2015-06-23 22:39:41 1190 [Note] IPv6 is available.
2015-06-23 22:39:41 1190 [Note] - '::' resolves to '::';
2015-06-23 22:39:41 1190 [Note] Server socket created on IP: '::'.
2015-06-23 22:39:41 1190 [ERROR] Incorrect definition of table mysql.db: expected column 'User' at position 2 to have type char(16), found type char(80).
2015-06-23 22:39:41 1190 [ERROR] Incorrect definition of table mysql.event: expected column 'definer' at position 3 to have type char(77), found type char(141).
2015-06-23 22:39:41 1190 [ERROR] Incorrect definition of table mysql.event: expected column 'sql_mode' at position 14 to have type set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH'), found type set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_A
2015-06-23 22:39:41 1190 [ERROR] Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler.
2015-06-23 22:39:41 1190 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.6.22' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
2015-06-23 23:00:47 7f7038bc0700 InnoDB: Error: Column last_update in table "mysql"."innodb_table_stats" is INT UNSIGNED NOT NULL but should be BINARY(4) NOT NULL (type mismatch).
2015-06-23 23:00:47 7f7038bc0700 InnoDB: Error: Fetch of persistent statistics requested for table "moodle"."mdl_config" but the required system tables mysql.innodb_table_stats and mysql.innodb_index_stats are not present or have unexpected structure. Using transient stats instead.

1个回答

貌似是系统表出问题了。把数据导出来,再建个database导进去试试看。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
mysql服务启动报错1607 求助大神!
错误日志: InnoDB: The first specified data file .\ibdata1 did not exist: InnoDB: a new database to be created! 160817 17:41:01 InnoDB: Setting file .\ibdata1 size to 10 MB InnoDB: Database physically writes the file full: wait... 160817 17:41:02 InnoDB: Log file .\ib_logfile0 did not exist: new to be created InnoDB: Setting log file .\ib_logfile0 size to 10 MB InnoDB: Database physically writes the file full: wait... 160817 17:41:02 InnoDB: Log file .\ib_logfile1 did not exist: new to be created InnoDB: Setting log file .\ib_logfile1 size to 10 MB InnoDB: Database physically writes the file full: wait... InnoDB: Doublewrite buffer not found: creating new InnoDB: Doublewrite buffer created InnoDB: Creating foreign key constraint system tables InnoDB: Foreign key constraint system tables created 160817 17:41:03 InnoDB: Started; log sequence number 0 0 160817 17:41:03 [Note] E:\mysqlserver\bin\mysqld-nt: ready for connections. Version: '5.0.22-community-nt' socket: '' port: 3306 MySQL Community Edition (GPL) 160826 16:38:33 [Note] E:\mysqlserver\bin\mysqld-nt: Normal shutdown 160826 16:38:35 InnoDB: Starting shutdown... 160826 16:38:38 InnoDB: Shutdown completed; log sequence number 0 133556 160826 16:38:38 [Note] E:\mysqlserver\bin\mysqld-nt: Shutdown complete 160826 16:40:24 InnoDB: Started; log sequence number 0 133556 160826 16:40:25 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist 160827 17:28:58 InnoDB: Started; log sequence number 0 133556 160827 17:28:58 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist 160827 19:25:59 InnoDB: Started; log sequence number 0 133556 160827 19:25:59 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist 160827 19:26:03 InnoDB: Started; log sequence number 0 133556 160827 19:26:03 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist 160827 19:26:07 InnoDB: Started; log sequence number 0 133556 160827 19:26:07 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist 160827 19:32:24 InnoDB: Started; log sequence number 0 133556 160827 19:32:24 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist 160827 19:36:18 InnoDB: Started; log sequence number 0 133556 160827 19:36:18 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist 160827 19:37:25 InnoDB: Started; log sequence number 0 133556 160827 19:37:26 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist 160827 19:40:55 InnoDB: Started; log sequence number 0 133556 160827 19:40:55 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist InnoDB: The first specified data file .\ibdata1 did not exist: InnoDB: a new database to be created! 160827 19:50:49 InnoDB: Setting file .\ibdata1 size to 10 MB InnoDB: Database physically writes the file full: wait... 160827 19:50:49 InnoDB: Log file .\ib_logfile0 did not exist: new to be created InnoDB: Setting log file .\ib_logfile0 size to 10 MB InnoDB: Database physically writes the file full: wait... 160827 19:50:50 InnoDB: Log file .\ib_logfile1 did not exist: new to be created InnoDB: Setting log file .\ib_logfile1 size to 10 MB InnoDB: Database physically writes the file full: wait... InnoDB: Doublewrite buffer not found: creating new InnoDB: Doublewrite buffer created InnoDB: Creating foreign key constraint system tables InnoDB: Foreign key constraint system tables created 160827 19:50:50 InnoDB: Started; log sequence number 0 0 160827 19:50:50 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist 160827 19:50:55 InnoDB: Database was not shut down normally! InnoDB: Starting crash recovery. InnoDB: Reading tablespace information from the .ibd files... InnoDB: Restoring possible half-written data pages from the doublewrite InnoDB: buffer... 160827 19:50:55 InnoDB: Starting log scan based on checkpoint at InnoDB: log sequence number 0 36808. InnoDB: Doing recovery: scanned up to log sequence number 0 43655 160827 19:50:55 InnoDB: Starting an apply batch of log records to the database... InnoDB: Progress in percents: 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 InnoDB: Apply batch completed 160827 19:50:56 InnoDB: Started; log sequence number 0 43655 160827 19:50:56 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist 160827 19:58:23 InnoDB: Database was not shut down normally! InnoDB: Starting crash recovery. InnoDB: Reading tablespace information from the .ibd files... InnoDB: Restoring possible half-written data pages from the doublewrite InnoDB: buffer... 160827 19:58:23 InnoDB: Starting log scan based on checkpoint at InnoDB: log sequence number 0 36808. InnoDB: Doing recovery: scanned up to log sequence number 0 43655 160827 19:58:23 InnoDB: Starting an apply batch of log records to the database... InnoDB: Progress in percents: 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 InnoDB: Apply batch completed 160827 19:58:24 InnoDB: Started; log sequence number 0 43655 160827 19:58:24 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist InnoDB: The first specified data file .\ibdata1 did not exist: InnoDB: a new database to be created! 160827 20:00:24 InnoDB: Setting file .\ibdata1 size to 10 MB InnoDB: Database physically writes the file full: wait... 160827 20:00:24 InnoDB: Log file .\ib_logfile0 did not exist: new to be created InnoDB: Setting log file .\ib_logfile0 size to 10 MB InnoDB: Database physically writes the file full: wait... 160827 20:00:24 InnoDB: Log file .\ib_logfile1 did not exist: new to be created InnoDB: Setting log file .\ib_logfile1 size to 10 MB InnoDB: Database physically writes the file full: wait... InnoDB: Doublewrite buffer not found: creating new InnoDB: Doublewrite buffer created InnoDB: Creating foreign key constraint system tables InnoDB: Foreign key constraint system tables created 160827 20:00:25 InnoDB: Started; log sequence number 0 0 160827 20:00:25 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist 160827 20:01:54 InnoDB: Database was not shut down normally! InnoDB: Starting crash recovery. InnoDB: Reading tablespace information from the .ibd files... InnoDB: Restoring possible half-written data pages from the doublewrite InnoDB: buffer... 160827 20:01:54 InnoDB: Starting log scan based on checkpoint at InnoDB: log sequence number 0 36808. InnoDB: Doing recovery: scanned up to log sequence number 0 43655 160827 20:01:54 InnoDB: Starting an apply batch of log records to the database... InnoDB: Progress in percents: 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 InnoDB: Apply batch completed 160827 20:01:55 InnoDB: Started; log sequence number 0 43655 160827 20:01:55 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist 160827 20:02:09 InnoDB: Database was not shut down normally! InnoDB: Starting crash recovery. InnoDB: Reading tablespace information from the .ibd files... InnoDB: Restoring possible half-written data pages from the doublewrite InnoDB: buffer... 160827 20:02:09 InnoDB: Starting log scan based on checkpoint at InnoDB: log sequence number 0 36808. InnoDB: Doing recovery: scanned up to log sequence number 0 43655 160827 20:02:09 InnoDB: Starting an apply batch of log records to the database... InnoDB: Progress in percents: 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 InnoDB: Apply batch completed 160827 20:02:10 InnoDB: Started; log sequence number 0 43655 160827 20:02:10 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist 160827 21:37:52 InnoDB: Database was not shut down normally! InnoDB: Starting crash recovery. InnoDB: Reading tablespace information from the .ibd files... InnoDB: Restoring possible half-written data pages from the doublewrite InnoDB: buffer... 160827 21:37:52 InnoDB: Starting log scan based on checkpoint at InnoDB: log sequence number 0 36808. InnoDB: Doing recovery: scanned up to log sequence number 0 43655 160827 21:37:52 InnoDB: Starting an apply batch of log records to the database... InnoDB: Progress in percents: 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 InnoDB: Apply batch completed 160827 21:37:52 InnoDB: Started; log sequence number 0 43655 160827 21:37:52 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
MYSQL 在做查询表信息的时候数据库重启!!比较急,在线
如下是日志,麻烦哪位大神帮忙下,谢谢 150430 14:03:09 mysqld_safe Starting mysqld daemon with databases from /data/mongo_dev/mysqldb 150430 14:03:09 InnoDB: The InnoDB memory heap is disabled 150430 14:03:09 InnoDB: Mutexes and rw_locks use GCC atomic builtins 150430 14:03:09 InnoDB: Compressed tables use zlib 1.2.3 150430 14:03:09 InnoDB: CPU supports crc32 instructions 150430 14:03:09 InnoDB: Initializing buffer pool, size = 128.0M 150430 14:03:09 InnoDB: Completed initialization of buffer pool 150430 14:03:09 InnoDB: highest supported file format is Barracuda. InnoDB: The log sequence number in ibdata files does not match InnoDB: the log sequence number in the ib_logfiles! 150430 14:03:09 InnoDB: Database was not shut down normally! InnoDB: Starting crash recovery. InnoDB: Reading tablespace information from the .ibd files... 150430 14:03:09 InnoDB: Operating system error number 5 in a file operation. InnoDB: Error number 5 means 'Input/output error'. InnoDB: Some operating system error numbers are described at InnoDB: http://dev.mysql.com/doc/refman/5.6/en/operating-system-error-codes.html 150430 14:03:09 InnoDB: File name ./test/net_mac_log_bak#P#p0.MYI 150430 14:03:09 InnoDB: File operation call: 'stat'. InnoDB: Error: os_file_readdir_next_file() returned -1 in InnoDB: directory ./test InnoDB: Crash recovery may have failed for some .ibd files! 150430 14:03:09 InnoDB: Operating system error number 5 in a file operation. InnoDB: Error number 5 means 'Input/output error'. InnoDB: Some operating system error numbers are described at InnoDB: http://dev.mysql.com/doc/refman/5.6/en/operating-system-error-codes.html 150430 14:03:09 InnoDB: File name ./mysql.sock 150430 14:03:09 InnoDB: File operation call: 'stat'. InnoDB: Error: os_file_readdir_next_file() returned -1 in InnoDB: directory . InnoDB: Crash recovery may have failed for some .ibd files! InnoDB: Restoring possible half-written data pages from the doublewrite InnoDB: buffer... 150430 14:03:10 InnoDB: 128 rollback segment(s) are active. 150430 14:03:10 InnoDB: Waiting for the background threads to start 150430 14:03:11 InnoDB: 1.2.4 started; log sequence number 109555758 Warning: World-writable config file './auto.cnf' is ignored 150430 14:03:11 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 94d0a4e5-eefe-11e4-9ea2-40f2e9631adc. 150430 14:03:11 [Note] Event Scheduler: Loaded 0 events 150430 14:03:11 [Note] /usr/local/mysql/bin/mysqld: ready for connections. Version: '5.6.4-m7' socket: '/data/mongo_dev/mysql.sock' port: 3306 Source distribution 150430 14:04:05 [Note] /usr/local/mysql/bin/mysqld: Normal shutdown 150430 14:04:05 [Note] Giving client threads a chance to die gracefully 150430 14:04:05 [Note] Event Scheduler: Purging the queue. 0 events 150430 14:04:05 [Note] Shutting down slave threads 150430 14:04:05 [Note] Forcefully disconnecting remaining clients 150430 14:04:05 [Note] Binlog end 150430 14:04:05 [Note] Shutting down plugin 'partition' 150430 14:04:05 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA' 150430 14:04:05 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS' 150430 14:04:05 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN' 150430 14:04:05 [Note] Shutting down plugin 'INNODB_SYS_FIELDS' 150430 14:04:05 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS' 150430 14:04:05 [Note] Shutting down plugin 'INNODB_SYS_INDEXES' 150430 14:04:05 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS' 150430 14:04:05 [Note] Shutting down plugin 'INNODB_SYS_TABLES' 150430 14:04:05 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE' 150430 14:04:05 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE' 150430 14:04:05 [Note] Shutting down plugin 'INNODB_FT_CONFIG' 150430 14:04:05 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED' 150430 14:04:05 [Note] Shutting down plugin 'INNODB_FT_DELETED' 150430 14:04:05 [Note] Shutting down plugin 'INNODB_FT_INSERTED' 150430 14:04:05 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD' 150430 14:04:05 [Note] Shutting down plugin 'INNODB_METRICS' 150430 14:04:05 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS' 150430 14:04:05 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU' 150430 14:04:05 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE' 150430 14:04:05 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET' 150430 14:04:05 [Note] Shutting down plugin 'INNODB_CMPMEM' 150430 14:04:05 [Note] Shutting down plugin 'INNODB_CMP_RESET' 150430 14:04:05 [Note] Shutting down plugin 'INNODB_CMP' 150430 14:04:05 [Note] Shutting down plugin 'INNODB_LOCK_WAITS' 150430 14:04:05 [Note] Shutting down plugin 'INNODB_LOCKS' 150430 14:04:05 [Note] Shutting down plugin 'INNODB_TRX' 150430 14:04:05 [Note] Shutting down plugin 'InnoDB' 150430 14:04:05 InnoDB: FTS optimize thread exiting. 150430 14:04:05 InnoDB: Starting shutdown... 150430 14:04:05 InnoDB: Shutdown completed; log sequence number 109555768 150430 14:04:05 [Note] Shutting down plugin 'MEMORY' 150430 14:04:05 [Note] Shutting down plugin 'CSV' 150430 14:04:05 [Note] Shutting down plugin 'MyISAM' 150430 14:04:05 [Note] Shutting down plugin 'MRG_MYISAM' 150430 14:04:05 [Note] Shutting down plugin 'mysql_old_password' 150430 14:04:05 [Note] Shutting down plugin 'mysql_native_password' 150430 14:04:05 [Note] Shutting down plugin 'binlog' 150430 14:04:05 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete 150430 14:04:05 mysqld_safe mysqld from pid file /data/mongo_dev/mysqldb/log01.pid ended 150430 14:04:06 mysqld_safe Starting mysqld daemon with databases from /data/mongo_dev/mysqldb 150430 14:04:06 InnoDB: The InnoDB memory heap is disabled 150430 14:04:06 InnoDB: Mutexes and rw_locks use GCC atomic builtins 150430 14:04:06 InnoDB: Compressed tables use zlib 1.2.3 150430 14:04:06 InnoDB: CPU supports crc32 instructions 150430 14:04:06 InnoDB: Initializing buffer pool, size = 128.0M 150430 14:04:06 InnoDB: Completed initialization of buffer pool 150430 14:04:06 InnoDB: highest supported file format is Barracuda. 150430 14:04:06 InnoDB: 128 rollback segment(s) are active. 150430 14:04:06 InnoDB: 1.2.4 started; log sequence number 109555768 Warning: World-writable config file './auto.cnf' is ignored 150430 14:04:06 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: b5b184b2-eefe-11e4-9ea3-40f2e9631adc. 150430 14:04:06 [Note] Event Scheduler: Loaded 0 events 150430 14:04:06 [Note] /usr/local/mysql/bin/mysqld: ready for connections. Version: '5.6.4-m7' socket: '/data/mongo_dev/mysql.sock' port: 3306 Source distribution
spring&ibatis事务配置问题
xml配置 [code="xml"] <!-- 默认的数据源配置 --> <bean id="talent.defaultDataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName" value="${jdbc.default.driverClassName}" /> <property name="url" value="${jdbc.default.url}" /> <property name="username" value="${jdbc.default.username}" /> <property name="password" value="${jdbc.default.password}" /> </bean> <!-- 事务配置 --> <bean id="talent.defaultTransactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="talent.defaultDataSource" /> </bean> <!-- 配置事务特性 --> <tx:advice id="txAdvice" transaction-manager="talent.defaultTransactionManager"> <tx:attributes> <tx:method name="add*" propagation="REQUIRED" /> <tx:method name="save*" propagation="REQUIRED" /> <tx:method name="insert*" propagation="REQUIRED" /> <tx:method name="del*" propagation="REQUIRED" /> <tx:method name="update*" propagation="REQUIRED" /> <tx:method name="main*" propagation="REQUIRED" /> <tx:method name="*" read-only="true" /> </tx:attributes> </tx:advice> <!-- 配置哪些类的方法需要进行事务管理 --> <aop:config> <aop:pointcut id="allManagerMethod" expression="execution(* com.jstrd.talent.manager.MyTransactionTemplate.*(..))" /> <aop:advisor advice-ref="txAdvice" pointcut-ref="allManagerMethod" /> </aop:config> <!-- 默认的DaoFactory --> <bean id="talent.defaultDaoFactory" class="com.jstrd.talent.dao.DaoFactory"> <constructor-arg value="${jdbc.default.db.dialect}" /> </bean> <!-- 默认的SqlMapClient --> <bean id="talent.defaultSqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean"> <property name="dataSource" ref="talent.defaultDataSource" /> <property name="configLocation" value="classpath:talent/ibatis/sql-map-config.xml" /> <!-- 自动加载sql-mapping文件 --> <property name="mappingLocations"> <value>${ibatis.mappingLocations}</value> </property> <property name="useTransactionAwareDataSource" value="true"></property> </bean> <!-- 默认的SqlMapDao --> <bean id="talent.defaultSqlMapDao" class="com.jstrd.talent.dao.SqlMapDao"> <property name="sqlMapClient" ref="talent.defaultSqlMapClient" /> </bean> <!-- 默认的SqlMapClientTemplate --> <bean id="talent.defaultSqlMapClientTemplate" class="org.springframework.orm.ibatis.SqlMapClientTemplate"> <property name="sqlMapClient" ref="talent.defaultSqlMapClient" /> </bean> [/code] java代码 [code="java"] public class MyTransactionTemplate { public void addXX() throws Exception { SqlMapDao dao = DaoFactory.getSqlMapDao(); SqlMapClientTemplate sqlMap = dao.getSqlMapClientTemplate();//dao.getSqlMapClientTemplate();//(SqlMapClientTemplate)BeanFactory.getBean("talent.defaultSqlMapClientTemplate"); sqlMap.update("t_user.delete"); sqlMap.update("t_user.insert", new TUser(29, "tan29")); sqlMap.update("t_user.insert", new TUser(30, "tan30")); sqlMap.update("t_user.insert", new TUser(32, "tan32")); sqlMap.update("t_user.updateById", new TUser(29, "tan30"));//这里违反唯一约束,会抛异常的 sqlMap.update("t_user.updateById", new TUser(29, "tan28")); } } [/code] java代码中,连续几个insert,然后两上update,其中一个update是会抛异常的。但是发现前面的insert已经在数据库中生效了,并不回滚 [b]问题补充:[/b] 数据库是mysql5 "MyTransactionTemplate根本没有处于事务中啊"??已经配置在其中了的: execution(* com.jstrd.talent.manager.MyTransactionTemplate.*(..))" [b]问题补充:[/b] 谢谢kyo100900的回答!我改成InnoDb后,事务还是没控制住, 日志发现sqlMap.update()每次都会 Fetching JDBC Connection from DataSource 然后 Returning JDBC Connection to DataSource 这里可能也有问题?! [b]问题补充:[/b] 换了oracle环境还是一样,我怀疑是配错了 [b]问题补充:[/b] xml配置 <pre name="code" class="xml"> &lt;!-- 默认的数据源配置 --> &lt;bean id="talent.defaultDataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> &lt;property name="driverClassName" value="${jdbc.default.driverClassName}" /> &lt;property name="url" value="${jdbc.default.url}" /> &lt;property name="username" value="${jdbc.default.username}" /> &lt;property name="password" value="${jdbc.default.password}" /> &lt;/bean> &lt;!-- 事务配置 --> &lt;bean id="talent.defaultTransactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> &lt;property name="dataSource" ref="talent.defaultDataSource" /> &lt;/bean> &lt;!-- 配置事务特性 --> &lt;tx:advice id="txAdvice" transaction-manager="talent.defaultTransactionManager"> &lt;tx:attributes> &lt;tx:method name="add*" propagation="REQUIRED" /> &lt;tx:method name="save*" propagation="REQUIRED" /> &lt;tx:method name="insert*" propagation="REQUIRED" /> &lt;tx:method name="del*" propagation="REQUIRED" /> &lt;tx:method name="update*" propagation="REQUIRED" /> &lt;tx:method name="main*" propagation="REQUIRED" /> &lt;tx:method name="*" read-only="true" /> &lt;/tx:attributes> &lt;/tx:advice> &lt;!-- 配置哪些类的方法需要进行事务管理 --> &lt;aop:config> &lt;aop:pointcut id="allManagerMethod" expression="execution(* com.jstrd.talent.manager.MyTransactionTemplate.*(..))" /> &lt;aop:advisor advice-ref="txAdvice" pointcut-ref="allManagerMethod" /> &lt;/aop:config> &lt;!-- 默认的DaoFactory --> &lt;bean id="talent.defaultDaoFactory" class="com.jstrd.talent.dao.DaoFactory"> &lt;constructor-arg value="${jdbc.default.db.dialect}" /> &lt;/bean> &lt;!-- 默认的SqlMapClient --> &lt;bean id="talent.defaultSqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean"> &lt;property name="dataSource" ref="talent.defaultDataSource" /> &lt;property name="configLocation" value="classpath:talent/ibatis/sql-map-config.xml" /> &lt;!-- 自动加载sql-mapping文件 --> &lt;property name="mappingLocations"> &lt;value>${ibatis.mappingLocations}&lt;/value> &lt;/property> &lt;property name="useTransactionAwareDataSource" value="true">&lt;/property> &lt;/bean> &lt;!-- 默认的SqlMapDao --> &lt;bean id="talent.defaultSqlMapDao" class="com.jstrd.talent.dao.SqlMapDao"> &lt;property name="sqlMapClient" ref="talent.defaultSqlMapClient" /> &lt;/bean> &lt;!-- 默认的SqlMapClientTemplate --> &lt;bean id="talent.defaultSqlMapClientTemplate" class="org.springframework.orm.ibatis.SqlMapClientTemplate"> &lt;property name="sqlMapClient" ref="talent.defaultSqlMapClient" /> &lt;/bean> </pre> java代码 <pre name="code" class="java"> public class MyTransactionTemplate { public void addXX() throws Exception { SqlMapDao dao = DaoFactory.getSqlMapDao(); SqlMapClientTemplate sqlMap = dao.getSqlMapClientTemplate();//dao.getSqlMapClientTemplate();//(SqlMapClientTemplate)BeanFactory.getBean("talent.defaultSqlMapClientTemplate"); sqlMap.update("t_user.delete"); sqlMap.update("t_user.insert", new TUser(29, "tan29")); sqlMap.update("t_user.insert", new TUser(30, "tan30")); sqlMap.update("t_user.insert", new TUser(32, "tan32")); sqlMap.update("t_user.updateById", new TUser(29, "tan30"));//这里违反唯一约束,会抛异常的 sqlMap.update("t_user.updateById", new TUser(29, "tan28")); } } </pre> java代码中,连续几个insert,然后两上update,其中一个update是会抛异常的。但是发现前面的insert已经在数据库中生效了,并不回滚 <strong>问题补充:</strong> 数据库是mysql5 "MyTransactionTemplate根本没有处于事务中啊"??已经配置在其中了的: execution(* com.jstrd.talent.manager.MyTransactionTemplate.*(..))" <strong>问题补充:</strong> 谢谢kyo100900的回答!我改成InnoDb后,事务还是没控制住, 日志发现sqlMap.update()每次都会 Fetching JDBC Connection from DataSource 然后 Returning JDBC Connection to DataSource 这里可能也有问题?! <strong>问题补充:</strong> 换了oracle环境还是一样,我怀疑是配错了 调试发现SqlMapClientTemplate的事务管理器为com.ibatis.sqlmap.engine.transaction.TransactionManager@19f9c7a.跟配置的不一样啊 [b]问题补充:[/b] "MyTransactionTemplate根本没有处于事务中啊"??已经配置在其中了的: execution(* com.jstrd.talent.manager.MyTransactionTemplate.*(..))" &lt;strong>问题补充:&lt;/strong> 谢谢kyo100900的回答!我改成InnoDb后,事务还是没控制住, 日志发现sqlMap.update()每次都会 Fetching JDBC Connection from DataSource 然后 Returning JDBC Connection to DataSource 这里可能也有问题?! &lt;strong>问题补充:&lt;/strong> 换了oracle环境还是一样,我怀疑是配错了 调试发现SqlMapClientTemplate的事务管理器为com.ibatis.sqlmap.engine.transaction.TransactionManager@19f9c7a.跟配置的不一样啊
windows 以 zip 安装 mysql 5.7.9 innodb 一直无法启用
2015-12-08T04:29:25.523685Z 0 [Warning] Insecure configuration for --secure-file -priv: Current value does not restrict location of generated files. Consider set ting it to a valid, non-empty path. 2015-12-08T04:29:25.524685Z 0 [Note] mysqld (mysqld 5.7.10) starting as process 8524 ... 2015-12-08T04:29:25.536686Z 0 [Note] InnoDB: Mutexes and rw_locks use Windows in terlocked functions 2015-12-08T04:29:25.537686Z 0 [Note] InnoDB: Uses event mutexes 2015-12-08T04:29:25.538686Z 0 [Note] InnoDB: _mm_lfence() and _mm_sfence() are u sed for memory barrier 2015-12-08T04:29:25.539686Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3 2015-12-08T04:29:25.540686Z 0 [Note] InnoDB: Number of pools: 1 2015-12-08T04:29:25.541686Z 0 [Note] InnoDB: Not using CPU crc32 instructions 2015-12-08T04:29:25.589689Z 0 [Note] InnoDB: Initializing buffer pool, total siz e = 80M, instances = 1, chunk size = 80M 2015-12-08T04:29:25.606690Z 0 [Note] InnoDB: Completed initialization of buffer pool 2015-12-08T04:29:25.640692Z 0 [Note] InnoDB: Highest supported file format is Ba rracuda. 2015-12-08T04:29:25.692695Z 0 [Note] InnoDB: Creating shared tablespace for temp orary tables 2015-12-08T04:29:25.695695Z 0 [Note] InnoDB: Setting file '.\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ... 2015-12-08T04:29:25.728697Z 0 [Note] InnoDB: File '.\ibtmp1' size is now 12 MB. 下面是 my.ini # For advice on how to change settings please see # http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html # *** DO NOT EDIT THIS FILE. It's a template which will be copied to the # *** default location during install, and will be replaced if you # *** upgrade to a newer version of MySQL. [mysqld] # Remove leading # and set to the amount of RAM for the most important data # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%. # innodb_buffer_pool_size = 128M # Remove leading # to turn on a very important data integrity option: logging # changes to the binary log between backups. # log_bin # These are commonly set, remove the # and set as required. basedir ="E:\\data\\mysql-5.7.10-winx64" datadir ="E:\\data\\mysql-5.7.10-winx64\\data" tmpdir ="E:\\data\\mysql-5.7.10-winx64\\temp" port = 3306 # server_id = ..... # Remove leading # to set options mainly useful for reporting servers. # The server defaults are faster for transactions and fast SELECTs. # Adjust sizes as needed, experiment to find the optimal values. # join_buffer_size = 128M # sort_buffer_size = 2M # read_rnd_buffer_size = 2M socket="E:\\data\\mysql-5.7.10-winx64\\mysql.sock" #skip_innodb innodb_data_file_path=idbdata1:200M:autoextend innodb_buffer_pool_size=80M #innodb_additional_mem_pool_size=2M innodb_log_file_size=20M innodb_log_buffer_size=8M innodb_flush_log_at_trx_commit=1 sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES default_password_lifetime=0
spring mvc+mybatis 事务控制不起作用
用的是spring mvc和mybatis框架。数据库是mysql。然后发现事务配置了不起作用。。业务逻辑是新增用户,用户新增成功之后再在其他表插入一条对应的用户角色关联信息。现在问题是假如用户插入成功之后。。插入对应的用户角色关联信息出错后,用户那条新增记录不能自动删除。看了很多人说是因为@service提前扫描的问题。那个我改过了。还有说是表的引擎不是InnoDB。但是我们建的表是InnoDB。还有说要抛出RuntimeException。我也抛出了。。但是还是没用。没办法。请大家看下: -serlet.xml: [code="xml"] <mvc:resources mapping="/resources/**" location="/resources/" /> <context:annotation-config /> <mvc:annotation-driven /> <!-- ①:对web包中的所有类进行扫描,以完成Bean创建和自动依赖注入的功能 --> <context:component-scan base-package="com.xuanyan.uebuycar.*"> <context:include-filter type="annotation" expression="org.springframework.stereotype.Controller" /> <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Service" /> </context:component-scan> <bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"/> <!-- ②:启动Spring MVC的注解功能,完成请求和注解POJO的映射 --> <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"> <property name="cacheSeconds" value="0" /> <property name="webBindingInitializer"> <bean class="com.xuanyan.uebuycar.admin.util.WebDataBinder4DateAndTime"/> </property> </bean> <!-- ③:对模型视图名称的解析,即在模型视图名称添加前后缀 --> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver" p:prefix="/" p:suffix=".html"/> <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource" p:basename="i18n/messages"/> [/code] applicationContext.xml: [code="xml"] <!-- 用于持有ApplicationContext,可以使用SpringContextHolder.getBean('xxxx')的静态方法得到spring bean对象 --> <bean class="com.xuanyan.uebuycar.admin.util.SpringContextHolder" lazy-init="false" /> <!-- define the SqlSessionFactory --> <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="dataSource" ref="proxool" /> <property name="configLocation" value="classpath:mybatis-config.xml" /> </bean> <!-- 数据连接事务 --> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="proxool" /> </bean> <!-- 不扫描带有@Controller注解的类。因为这些类已经随容器启动时,在servlet-context中扫描过一遍了 --> <context:component-scan base-package="com.xuanyan.uebuycar"> <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/> </context:component-scan> <!-- 激活annotation功能 --> <context:annotation-config /> <!-- 激活annotation功能 --> <context:spring-configured/> <!-- mybatis接口 --> <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> <property name="basePackage" value="com.xuanyan.uebuycar.admin.dao" /> </bean> <!-- 连接事务的注解配置 --> <tx:annotation-driven transaction-manager="transactionManager" /> <aop:config proxy-target-class="true"> <aop:pointcut id="fooServiceOperation" expression="execution(* com.xuanyan.uebuycar.admin.service..*.*(..))" /> <aop:advisor advice-ref="txAdvice" pointcut-ref="fooServiceOperation" /> </aop:config> <tx:advice id="txAdvice" transaction-manager="transactionManager"> <!-- the transactional semantics... --> <tx:attributes> <tx:method name="add*" propagation="REQUIRED" rollback-for="java.lang.Exception" /> <tx:method name="delete*" propagation="REQUIRED" rollback-for="java.lang.Exception"/> <tx:method name="update*" propagation="REQUIRED" rollback-for="java.lang.Exception"/> </tx:attributes> </tx:advice> [/code] 方法: [code="java"] public String addOrUpdate(SysUser record,SysUser currUser,String actionType,String roleId){ String str=getDefJsonString(false, "操作失败,请稍后再试!"); try { if(record!=null){ Date now=new Date(); SysUserExample example=new SysUserExample(); example.createCriteria().andUserCodeEqualTo(record.getUserCode()); List<SysUser> list=sysUserMapper.selectByExample(example); if("add".equalsIgnoreCase(actionType)){ if(list!=null&&list.size()>0){ str=getDefJsonString(false, "操作失败,该账号已存在!"); return str; } String userId=CommonUtil.getUUIDString(); record.setUserId(userId); record.setUserPassword(CommonUtil.getMD5Str(SystemCommonParam.DEFAULT_USER_PWD)); record.setUpdateUser(currUser.getUserCode()); record.setUpdateTime(now); if(sysUserMapper.insertSelective(record)>0){ SysRoleUser ru=new SysRoleUser(); // ru.setRoleUserId(CommonUtil.getUUIDString()); ru.setRoleId(roleId); ru.setUserId(userId); ru.setUpdateUser(currUser.getUserCode()); ru.setUpdateTime(now); if(sysRoleUserMapper.insertSelective(ru)>0){ str=getDefJsonString(true, "新增成功!"); } } }else if("edit".equalsIgnoreCase(actionType)){ if(list!=null&&list.size()>0){ if(!list.get(0).getUserId().equals(record.getUserId())){ str=getDefJsonString(false, "操作失败,该账号已存在!"); return str; } } record.setUpdateUser(currUser.getUserCode()); record.setUpdateTime(now); if(sysUserMapper.updateByPrimaryKeySelective(record)>0){ SysRoleUser ru=new SysRoleUser(); ru.setRoleId(roleId); SysRoleUserExample ex=new SysRoleUserExample(); ex.createCriteria().andUserIdEqualTo(record.getUserId()); if(sysRoleUserMapper.updateByExampleSelective(ru, ex)>0){ str=getDefJsonString(true, "修改成功!"); } } } } } catch (Exception e) { str=getDefErrorString(); e.printStackTrace(); throw new RuntimeException(); } return str; } [/code] 类路径:com.xuanyan.uebuycar.admin.services.sys.SysUserService 希望各位有知道能够告知一下。。是不是我service方法写的不对?
求助spring事务异常,报错报了昨天一天了55555,在线等啊
# 就是一直都报这个错,昨天一天都没解决,感觉是确实一个方法,NoSuchMethodError:org.springframework.jdbc.datasource.DataSourceTransactionManager.determineTimeout,我导入源码看不到这个方法,只有一个调用它的参数,,,求大牛或者神牛帮帮忙,拜托了。。。。困扰了一天啊,,,,!!!整个人都不好了,在线等!! 报错信息: ``` Exception in thread "main" org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.lang.NoSuchMethodError: org.springframework.jdbc.datasource.DataSourceTransactionManager.determineTimeout(Lorg/springframework/transaction/TransactionDefinition;)I at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:242) at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:283) at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:225) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:89) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207) at sun.proxy.$Proxy12.buyOneBook(Unknown Source) at org.Tran.Service.Imp.BuySomeBookImp.buySomeBook(BuySomeBookImp.java:17) at org.Tran.Test.Main.main(Main.java:16) Caused by: java.lang.NoSuchMethodError: org.springframework.jdbc.datasource.DataSourceTransactionManager.determineTimeout(Lorg/springframework/transaction/TransactionDefinition;)I at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:229) ... 10 more ``` 我的springConf.xml配置如下 ``` <?xml version="1.0" encoding="UTF-8" ?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd"> <context:annotation-config/> <context:component-scan base-package="org.Tran.*"/> <context:property-placeholder location="classpath:org/Tran/db.properties"/> <bean id="dataSource" destroy-method="close" class="org.apache.commons.dbcp.BasicDataSource"> <property name="driverClassName" value="${jdbc.driver}"/> <property name="url" value="${jdbc.url}"/> <property name="username" value="${jdbc.username}"/> <property name="password" value="${jdbc.password}"/> </bean> <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="configLocation" value="classpath:org/Tran/xml/MybatisConf.xml"/> <property name="dataSource" ref="dataSource" /> </bean> <bean id="bookMapper" class="org.mybatis.spring.mapper.MapperFactoryBean"> <property name="mapperInterface" value="org.Tran.DAO.BookDAO"/> <property name="sqlSessionFactory" ref="sqlSessionFactory"/> </bean> <!--1. 事务配置 --> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="dataSource" /> <property name="nestedTransactionAllowed" value="true"/> </bean> <!-- 启用事务注解! --><!-- <tx:annotation-driven transaction-manager="transactionManager"/> --> <!--2.配置事务属性 --> <tx:advice id="txAdvice" transaction-manager="transactionManager"> <tx:attributes> <tx:method name="*"/> </tx:attributes> </tx:advice> <!-- 3.配置事务切入点 --> <aop:config> <aop:pointcut expression="execution(* org.Tran.Service.BuyBookInterface.*(..))" id="txPointCut"/> <aop:advisor advice-ref="txAdvice" pointcut-ref="txPointCut"/> </aop:config> </beans> ``` 测试代码: ``` ApplicationContext ctx = new ClassPathXmlApplicationContext("org/Tran/xml/SpringConf.xml"); // BookServiceInterface bookService=ctx.getBean(BookServiceInterface.class); BuySomeBookInterface buybook=ctx.getBean(BuySomeBookInterface.class); buybook.buySomeBook("Jack", Arrays.asList("0001","0002")); ``` 下面是我的jar包![图片说明](https://img-ask.csdn.net/upload/201603/22/1458612915_654266.png) 我的数据库是mysql,表类型也是正常默认的innodb .
wampserver安装好后mysql启动不了(内有mysql日志 ),求大神帮忙!
170319 12:23:55 [Note] Plugin 'FEDERATED' is disabled. 170319 12:23:55 InnoDB: The InnoDB memory heap is disabled 170319 12:23:55 InnoDB: Mutexes and rw_locks use Windows interlocked functions 170319 12:23:55 InnoDB: Compressed tables use zlib 1.2.3 170319 12:23:55 InnoDB: Initializing buffer pool, size = 128.0M 170319 12:23:55 InnoDB: Completed initialization of buffer pool 170319 12:23:55 InnoDB: highest supported file format is Barracuda. 170319 12:23:55 InnoDB: Operating system error number 87 in a file operation. InnoDB: Some operating system error numbers are described at InnoDB: http://dev.mysql.com/doc/refman/5.5/en/operating-system-error-codes.html InnoDB: File name .\ib_logfile0 InnoDB: File operation call: 'aio read'. InnoDB: Cannot continue operation.
服务器断电后mysql无法启动
因意外导致服务器断电,重启后发现mysql起不来了 ``` [root@cacti ~]# service mysqld restart 停止 mysqld: [确定] MySQL Daemon failed to start. 正在启动 mysqld: [失败] ``` 查看日志: ``` [root@cacti ~]# tail -100 /var/log/mysqld.log 150520 12:21:12 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql 150520 12:21:12 InnoDB: Initializing buffer pool, size = 8.0M 150520 12:21:12 InnoDB: Completed initialization of buffer pool InnoDB: Log scan progressed past the checkpoint lsn 2 1552263436 150520 12:21:12 InnoDB: Database was not shut down normally! InnoDB: Starting crash recovery. InnoDB: Reading tablespace information from the .ibd files... InnoDB: Restoring possible half-written data pages from the doublewrite InnoDB: buffer... 150520 12:21:12 InnoDB: Starting an apply batch of log records to the database... InnoDB: Progress in percents: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 InnoDB: Database page corruption on disk or a failed InnoDB: file read of page 206. InnoDB: You may have to recover from a backup. 150520 12:21:12 InnoDB: Page dump in ascii and hex (16384 bytes): len 16384; hex cc507667000000ce0000000000000000000000025cabb0bc000200000000000000000000000000021e751eb0ffffffff0000ffffffff000000021dbb0000000000000002123200000001000000ce002c000000ce002c000000000304a196000000000304a1970001011000000000000000000000014....... .... .... .... oDB: End of page dump 150520 12:21:12 InnoDB: Page checksum 3392922109, prior-to-4.0.14-form checksum 1831220034 InnoDB: stored checksum 3427825255, prior-to-4.0.14-form stored checksum 2455963898 InnoDB: Page lsn 2 1554755772, low 4 bytes of lsn at page end 1556408857 InnoDB: Page number (if stored to page already) 206, InnoDB: space id (if created with >= MySQL-4.1.1 and stored already) 0 InnoDB: Page may be an update undo log page InnoDB: Database page corruption on disk or a failed InnoDB: file read of page 206. InnoDB: You may have to recover from a backup. InnoDB: It is also possible that your operating InnoDB: system has corrupted its own file cache InnoDB: and rebooting your computer removes the InnoDB: error. InnoDB: If the corrupt page is an index page InnoDB: you can also try to fix the corruption InnoDB: by dumping, dropping, and reimporting InnoDB: the corrupt table. You can use CHECK InnoDB: TABLE to scan your table for corruption. InnoDB: See also http://dev.mysql.com/doc/refman/5.1/en/forcing-innodb-recovery.html InnoDB: about forcing recovery. InnoDB: Ending processing because of a corrupt database page. 150520 12:21:12 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended ``` mysql新手一个,希望大家能帮帮忙分析下,谢谢!
mysql还原后启动出问题
2018-04-15 15:18:11 24653 [Note] Plugin 'FEDERATED' is disabled. 2018-04-15 15:18:11 24653 [Note] InnoDB: Using atomics to ref count buffer pool pages 2018-04-15 15:18:11 24653 [Note] InnoDB: The InnoDB memory heap is disabled 2018-04-15 15:18:11 24653 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 2018-04-15 15:18:11 24653 [Note] InnoDB: Memory barrier is not used 2018-04-15 15:18:11 24653 [Note] InnoDB: Compressed tables use zlib 1.2.3 2018-04-15 15:18:11 24653 [Note] InnoDB: Using Linux native AIO 2018-04-15 15:18:11 24653 [Note] InnoDB: Using CPU crc32 instructions 2018-04-15 15:18:11 24653 [Note] InnoDB: Initializing buffer pool, size = 128.0M 2018-04-15 15:18:11 24653 [Note] InnoDB: Completed initialization of buffer pool 2018-04-15 15:18:11 24653 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB 2018-04-15 15:18:11 24653 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB 2018-04-15 15:18:12 24653 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0 2018-04-15 15:18:12 24653 [Warning] InnoDB: New log files created, LSN=48585617787 2018-04-15 15:18:12 24653 [Note] InnoDB: Highest supported file format is Barracuda. 2018-04-15 15:18:12 7ffa03794740 InnoDB: Error: page 7 log sequence number 254015752729 InnoDB: is in the future! Current system log sequence number 48585617932. InnoDB: Your database may be corrupt or you may have copied the InnoDB InnoDB: tablespace but not the InnoDB log files. See InnoDB: http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html InnoDB: for more information. 2018-04-15 15:18:12 7ffa03794740 InnoDB: Error: page 1 log sequence number 249801886007 InnoDB: is in the future! Current system log sequence number 48585617932. InnoDB: Your database may be corrupt or you may have copied the InnoDB InnoDB: tablespace but not the InnoDB log files. See InnoDB: http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html InnoDB: for more information. 2018-04-15 15:18:12 7ffa03794740 InnoDB: Error: page 3 log sequence number 73815057441 InnoDB: is in the future! Current system log sequence number 48585617932. InnoDB: Your database may be corrupt or you may have copied the InnoDB InnoDB: tablespace but not the InnoDB log files. See
【mysql不能登陆root】
mysql无法登陆root: ``` ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) ``` 查了一下,删掉data文件夹下和数据库无关的文件,在my-default.ini中加上'skip-grant-tables'选项,跳过密码登陆依然失败,加tmpdir路径也不可以; ``` PS C:\Program Files\MySQL\MySQL Server 5.6\bin> mysqld --skip-grant-tables 2019-10-21 14:48:07 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2019-10-21 14:48:07 4416 [Warning] Can't create test file C:\Program Files\MySQL\MySQL Server 5.6\data\DESKTOP-FVGQVE8.lower-test 2019-10-21 14:48:07 4416 [Warning] Can't create test file C:\Program Files\MySQL\MySQL Server 5.6\data\DESKTOP-FVGQVE8.lower-test 2019-10-21 14:48:07 4416 [Note] Plugin 'FEDERATED' is disabled. 2019-10-21 14:48:07 4416 [Note] InnoDB: The InnoDB memory heap is disabled 2019-10-21 14:48:07 4416 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions 2019-10-21 14:48:07 4416 [Note] InnoDB: Compressed tables use zlib 1.2.3 2019-10-21 14:48:07 4416 [Note] InnoDB: CPU does not support crc32 instructions 2019-10-21 14:48:07 4416 [Note] InnoDB: Initializing buffer pool, size = 128.0M 2019-10-21 14:48:07 4416 [Note] InnoDB: Completed initialization of buffer pool 2019-10-21 14:48:07 32d4 InnoDB: Operating system error number 5 in a file operation. InnoDB: The error means mysqld does not have the access rights to InnoDB: the directory. It may also be you have created a subdirectory InnoDB: of the same name as a data file. 2019-10-21 14:48:07 32d4 InnoDB: File name .\ibdata1 2019-10-21 14:48:07 32d4 InnoDB: File operation call: 'create' returned OS error 105. 2019-10-21 14:48:07 32d4 InnoDB: Cannot continue operation. ``` 这是配置文件: ``` [mysqld] explicit_defaults_for_timestamp=true tmpdir="C:/Program Files/MySQL Server 5.6/temp/" skip-grant-tables old_passwords=0 # 设置3306端口 port=3306 # 设置mysql的安装目录 basedir="C:/Program Files/MySQL/MySQL Server 5.6 "# 设置mysql数据库的数据的存放目录 datadir="C:/Program Files/MySQL/MySQL Server 5.6/data "# 允许最大连接数 max_connections=200 # 允许连接失败的次数 max_connect_errors=10 # 服务端使用的字符集默认为UTF8 character-set-server=utf8 # 创建新表时将使用的默认存储引擎 default-storage-engine=MYISAM # 默认使用“mysql_native_password”插件认证 #mysql_native_password default_authentication_plugin=mysql_native_password [mysql] # 设置mysql客户端默认字符集 default-character-set=utf8 # 设置mysql客户端连接服务端时默认使用的端口 port=3306 default-character-set=utf8 innodb_buffer_pool_size=32M innodb_force_recovery = 1 ``` 请大神解答这是什么问题?
mysql非安装版无法启动 报1067错误
在网上查说是配置文件的事。 my.ini复制自my_small.ini。 只增加了 mysql字段 basedir = D:/mysql-5.5.24-winx64 datadir = D:/mysql-5.5.24-winx64/data character-set-server=utf8 client字段 default-character-set = utf8 另外在安装时候cmd使用管理员身份启动的。是不是这个有影响??? 错误日志: 140217 9:59:30 [Note] Plugin 'FEDERATED' is disabled. 140217 9:59:30 InnoDB: The InnoDB memory heap is disabled 140217 9:59:30 InnoDB: Mutexes and rw_locks use Windows interlocked functions 140217 9:59:30 InnoDB: Compressed tables use zlib 1.2.3 140217 9:59:30 InnoDB: Initializing buffer pool, size = 128.0M 140217 9:59:30 InnoDB: Completed initialization of buffer pool InnoDB: The first specified data file .\ibdata1 did not exist: InnoDB: a new database to be created! 140217 9:59:30 InnoDB: Setting file .\ibdata1 size to 10 MB InnoDB: Database physically writes the file full: wait... 140217 9:59:30 InnoDB: Log file .\ib_logfile0 did not exist: new to be created InnoDB: Setting log file .\ib_logfile0 size to 5 MB InnoDB: Database physically writes the file full: wait... 140217 9:59:30 InnoDB: Log file .\ib_logfile1 did not exist: new to be created InnoDB: Setting log file .\ib_logfile1 size to 5 MB InnoDB: Database physically writes the file full: wait... InnoDB: Doublewrite buffer not found: creating new InnoDB: Doublewrite buffer created InnoDB: 127 rollback segment(s) active. InnoDB: Creating foreign key constraint system tables InnoDB: Foreign key constraint system tables created 140217 9:59:31 InnoDB: Waiting for the background threads to start 140217 9:59:32 InnoDB: 1.1.8 started; log sequence number 0 **140217 9:59:32 [ERROR] MySQL: unknown variable 'default-character-set=gbk'** 140217 9:59:32 [ERROR] Aborting 140217 9:59:32 InnoDB: Starting shutdown... 140217 9:59:33 InnoDB: Shutdown completed; log sequence number 1595675 140217 9:59:33 [Note] MySQL: Shutdown complete 各种查资料各种解决不了。求大神帮忙。 附加:很神奇的是为什么会有 unknown variable 'default-character-set=gbk' 我根本就没有设置default-character-set=gbk,设置了default-character-set=tutf8也还是这个错误。
mysql频繁重新启动,大神帮忙看看
160831 16:32:10 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql 160831 16:32:10 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead. 160831 16:32:10 InnoDB: Initializing buffer pool, size = 8.0M 160831 16:32:10 InnoDB: Completed initialization of buffer pool InnoDB: 1 transaction(s) which must be rolled back or cleaned up InnoDB: in total 35 row operations to undo InnoDB: Trx id counter is 0 112437760 160831 16:32:10 InnoDB: Started; log sequence number 1 255213035 InnoDB: Starting in background the rollback of uncommitted transactions InnoDB: Cleaning up trx with id 0 2496008 160831 16:32:10 InnoDB: Rollback of non-prepared transactions completed 160831 16:32:10 [Note] Event Scheduler: Loaded 0 events 160831 16:32:10 [Note] /usr/libexec/mysqld: ready for connections. Version: '5.1.73-log' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution InnoDB: error in sec index entry update in InnoDB: index `history_uint_1` of table `zabbix`.`history_uint` InnoDB: tuple DATA TUPLE: 3 fields; 0: len 8; hex 0000000000005fd2; asc _ ;; 1: len 4; hex d771e21f; asc q ;; 2: len 6; hex 000000219c60; asc ! `;; InnoDB: record PHYSICAL RECORD: n_fields 3; compact format; info bits 32 0: len 8; hex 0000000000005fd2; asc _ ;; 1: len 4; hex d771e1e3; asc q ;; 2: len 6; hex 000000219a50; asc ! P;; TRANSACTION 0 112437763, ACTIVE 0 sec, process no 17925, OS thread id 140519254370064 updating or deleting, thread declared inside InnoDB 497 mysql tables in use 1, locked 1 5 lock struct(s), heap size 1216, 5 row lock(s), undo log entries 2 MySQL thread id 4, query id 11 localhost zabbix updating delete from history_uint where itemid=24530 and clock<1467095587 InnoDB: Submit a detailed bug report to http://bugs.mysql.com InnoDB: error in sec index entry update in InnoDB: index `history_uint_1` of table `zabbix`.`history_uint` InnoDB: tuple DATA TUPLE: 3 fields; 0: len 8; hex 0000000000005fd2; asc _ ;; 1: len 4; hex d771e25c; asc q \;; 2: len 6; hex 000000219e3e; asc ! >;; InnoDB: record PHYSICAL RECORD: n_fields 3; compact format; info bits 32 0: len 8; hex 0000000000005fd2; asc _ ;; 1: len 4; hex d771e1e3; asc q ;; 2: len 6; hex 000000219a50; asc ! P;; TRANSACTION 0 112437763, ACTIVE 0 sec, process no 17925, OS thread id 140519254370064 updating or deleting, thread declared inside InnoDB 495 mysql tables in use 1, locked 1 6 lock struct(s), heap size 1216, 7 row lock(s), undo log entries 3 MySQL thread id 4, query id 11 localhost zabbix updating delete from history_uint where itemid=24530 and clock<1467095587 InnoDB: Submit a detailed bug report to http://bugs.mysql.com InnoDB: error in sec index entry update in InnoDB: index `history_uint_1` of table `zabbix`.`history_uint` InnoDB: tuple DATA TUPLE: 3 fields; 0: len 8; hex 0000000000005fd2; asc _ ;; 1: len 4; hex d771e297; asc q ;; 2: len 6; hex 000000219f65; asc ! e;; InnoDB: record PHYSICAL RECORD: n_fields 3; compact format; info bits 32 0: len 8; hex 0000000000005fd2; asc _ ;; 1: len 4; hex d771e1e3; asc q ;; 2: len 6; hex 000000219a50; asc ! P;; TRANSACTION 0 112437763, ACTIVE 0 sec, process no 17925, OS thread id 140519254370064 updating or deleting, thread declared inside InnoDB 493 mysql tables in use 1, locked 1 6 lock struct(s), heap size 1216, 9 row lock(s), undo log entries 4 MySQL thread id 4, query id 11 localhost zabbix updating delete from history_uint where itemid=24530 and clock<1467095587 InnoDB: Submit a detailed bug report to http://bugs.mysql.com InnoDB: error in sec index entry update in InnoDB: index `history_uint_1` of table `zabbix`.`history_uint` InnoDB: tuple DATA TUPLE: 3 fields; 0: len 8; hex 0000000000005fd2; asc _ ;; 1: len 4; hex d771e2d3; asc q ;; 2: len 6; hex 00000021a125; asc ! %;; InnoDB: record PHYSICAL RECORD: n_fields 3; compact format; info bits 32 0: len 8; hex 0000000000005fd2; asc _ ;; 1: len 4; hex d771e1e3; asc q ;; 2: len 6; hex 000000219a50; asc ! P;; TRANSACTION 0 112437763, ACTIVE 0 sec, process no 17925, OS thread id 140519254370064 updating or deleting, thread declared inside InnoDB 491 mysql tables in use 1, locked 1 7 lock struct(s), heap size 1216, 11 row lock(s), undo log entries 5 MySQL thread id 4, query id 11 localhost zabbix updating delete from history_uint where itemid=24530 and clock<1467095587 InnoDB: Submit a detailed bug report to http://bugs.mysql.com InnoDB: error in sec index entry update in InnoDB: index `history_uint_1` of table `zabbix`.`history_uint` InnoDB: tuple DATA TUPLE: 3 fields; 0: len 8; hex 0000000000005fd2; asc _ ;; 1: len 4; hex d771e310; asc q ;; 2: len 6; hex 00000021a31a; asc ! ;; InnoDB: record PHYSICAL RECORD: n_fields 3; compact format; info bits 32 0: len 8; hex 0000000000005fd2; asc _ ;; 1: len 4; hex d771e1e3; asc q ;; 2: len 6; hex 000000219a50; asc ! P;;
mysql会话监控阻塞的sql
当mysql数据库中的表被我锁上几个后,为什么用这两个sql语句查不出被锁的表和被锁的个数,大神们有没有什么好的sql语句啊,求助!!! ``` SELECT p2.`HOST` 被阻塞方host, p2.`USER` 被阻塞方用户, r.trx_id 被阻塞方事务id, r.trx_mysql_thread_id 被阻塞方线程号, TIMESTAMPDIFF( SECOND, r.trx_wait_started, CURRENT_TIMESTAMP ) 等待时间, r.trx_query 被阻塞的查询, l.lock_table 阻塞方锁住的表, m.`lock_mode` 被阻塞方的锁模式, m.`lock_type` "被阻塞方的锁类型(表锁还是行锁)", m.`lock_index` 被阻塞方锁住的索引, m.`lock_space` 被阻塞方锁对象的space_id, m.lock_page 被阻塞方事务锁定页的数量, m.lock_rec 被阻塞方事务锁定行的数量, m.lock_data 被阻塞方事务锁定记录的主键值, p.`HOST` 阻塞方主机, p.`USER` 阻塞方用户, b.trx_id 阻塞方事务id, b.trx_mysql_thread_id 阻塞方线程号, b.trx_query 阻塞方查询, l.`lock_mode` 阻塞方的锁模式, l.`lock_type` "阻塞方的锁类型(表锁还是行锁)", l.`lock_index` 阻塞方锁住的索引, l.`lock_space` 阻塞方锁对象的space_id, l.lock_page 阻塞方事务锁定页的数量, l.lock_rec 阻塞方事务锁定行的数量, l.lock_data 阻塞方事务锁定记录的主键值, IF ( p.COMMAND = 'Sleep', CONCAT(p.TIME, ' 秒'), 0 ) 阻塞方事务空闲的时间 FROM information_schema.INNODB_LOCK_WAITS w INNER JOIN information_schema.INNODB_TRX b ON b.trx_id = w.blocking_trx_id INNER JOIN information_schema.INNODB_TRX r ON r.trx_id = w.requesting_trx_id INNER JOIN information_schema.INNODB_LOCKS l ON w.blocking_lock_id = l.lock_id AND l.`lock_trx_id` = b.`trx_id` INNER JOIN information_schema.INNODB_LOCKS m ON m.`lock_id` = w.`requested_lock_id` AND m.`lock_trx_id` = r.`trx_id` INNER JOIN information_schema.PROCESSLIST p ON p.ID = b.trx_mysql_thread_id INNER JOIN information_schema.PROCESSLIST p2 ON p2.ID = r.trx_mysql_thread_id; ``` ``` SELECT r.trx_id waiting_trx_id, r.trx_mysql_thread_Id waiting_thread, r.trx_query waiting_query, b.trx_id blocking_trx_id, b.trx_mysql_thread_id blocking_thread, b.trx_query blocking_query FROM information_schema.innodb_lock_waits w INNER JOIN information_schema.innodb_trx b ON b.trx_id = w.blocking_trx_id INNER JOIN information_schema.innodb_trx r ON r.trx_id = w.requesting_trx_id; ```
启动mysql服务报ERROR:1067错误
这里是日志: 2014-09-01T06:12:49.816554Z 0 [Note] Plugin 'FEDERATED' is disabled. 2014-09-01T06:12:49.818554Z 0 [Note] InnoDB: Using atomics to ref count buffer pool pages 2014-09-01T06:12:49.820554Z 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions 2014-09-01T06:12:49.822554Z 0 [Note] InnoDB: Uses system mutexes 2014-09-01T06:12:49.824554Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3 2014-09-01T06:12:49.825555Z 0 [Warning] InnoDB: Adjusting innodb_buffer_pool_instances from 8 to 1 since innodb_buffer_pool_size is less than 1024 MiB 2014-09-01T06:12:49.830555Z 0 [Note] InnoDB: Number of pools: 1 2014-09-01T06:12:49.832555Z 0 [Note] InnoDB: Not using CPU crc32 instructions 2014-09-01T06:12:49.834555Z 0 [ERROR] InnoDB: Unable to create temporary file; errno: 2 2014-09-01T06:12:49.835555Z 0 [ERROR] Plugin 'InnoDB' init function returned error. 2014-09-01T06:12:49.837555Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 2014-09-01T06:12:49.840555Z 0 [ERROR] Unknown/unsupported storage engine: innodb 2014-09-01T06:12:49.841555Z 0 [ERROR] Aborting 2014-09-01T06:12:49.842556Z 0 [Note] Binlog end 2014-09-01T06:12:50.010565Z 0 [Note] Shutting down plugin 'partition' 2014-09-01T06:12:50.015565Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA' 2014-09-01T06:12:50.021566Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES' 2014-09-01T06:12:50.027566Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES' 2014-09-01T06:12:50.033566Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS' 2014-09-01T06:12:50.039567Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN' 2014-09-01T06:12:50.043567Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS' 2014-09-01T06:12:50.045567Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS' 2014-09-01T06:12:50.048567Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES' 2014-09-01T06:12:50.050567Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS' 2014-09-01T06:12:50.052568Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES' 2014-09-01T06:12:50.054568Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE' 2014-09-01T06:12:50.057568Z 0 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE' 2014-09-01T06:12:50.059568Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG' 2014-09-01T06:12:50.061568Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED' 2014-09-01T06:12:50.064568Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED' 2014-09-01T06:12:50.066568Z 0 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD' 2014-09-01T06:12:50.068568Z 0 [Note] Shutting down plugin 'INNODB_METRICS' 2014-09-01T06:12:50.071569Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO' 2014-09-01T06:12:50.073569Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS' 2014-09-01T06:12:50.074569Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU' 2014-09-01T06:12:50.076569Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE' 2014-09-01T06:12:50.078569Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET' 2014-09-01T06:12:50.079569Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX' 2014-09-01T06:12:50.081569Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET' 2014-09-01T06:12:50.083569Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM' 2014-09-01T06:12:50.084569Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET' 2014-09-01T06:12:50.086569Z 0 [Note] Shutting down plugin 'INNODB_CMP' 2014-09-01T06:12:50.087570Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS' 2014-09-01T06:12:50.089570Z 0 [Note] Shutting down plugin 'INNODB_LOCKS' 2014-09-01T06:12:50.091570Z 0 [Note] Shutting down plugin 'INNODB_TRX' 2014-09-01T06:12:50.092570Z 0 [Note] Shutting down plugin 'BLACKHOLE' 2014-09-01T06:12:50.094570Z 0 [Note] Shutting down plugin 'ARCHIVE' 2014-09-01T06:12:50.096570Z 0 [Note] Shutting down plugin 'MRG_MYISAM' 2014-09-01T06:12:50.097570Z 0 [Note] Shutting down plugin 'MyISAM' 2014-09-01T06:12:50.099570Z 0 [Note] Shutting down plugin 'MEMORY' 2014-09-01T06:12:50.100570Z 0 [Note] Shutting down plugin 'CSV' 2014-09-01T06:12:50.101570Z 0 [Note] Shutting down plugin 'sha256_password' 2014-09-01T06:12:50.103570Z 0 [Note] Shutting down plugin 'mysql_old_password' 2014-09-01T06:12:50.105571Z 0 [Note] Shutting down plugin 'mysql_native_password' 2014-09-01T06:12:50.107571Z 0 [Note] Shutting down plugin 'binlog' 2014-09-01T06:12:50.108571Z 0 [Note] F:\mysqlpath\MySQL\MySQL Server 5.7\bin\mysqld: Shutdown complete 有谁知道的吗?谢谢。。。
求解:mysql-5.6,搭建galera 集群出现的问题。数据库添加集群相关参数后就起不来
报错: 2016-08-18 13:49:00 24069 [ERROR] /usr/local/mysql/bin/mysqld: unknown variable 'wsrep_provider=/usr/lib64/libgalera_smm.so' 2016-08-18 13:49:00 24069 [ERROR] Aborting 配置: [mysqld] pid-file=/usr/local/mysql/mysql_db3.pid binlog_format=ROW default-storage-engine=innodb innodb_autoinc_lock_mode=2 innodb_locks_unsafe_for_binlog=1 query_cache_size=0 query_cache_type=0 wsrep_provider=/usr/lib64/libgalera_smm.so wsrep_cluster_name="my_wsrep_cluster" wsrep_cluster_address="gcomm://192.168.0.15,192.168.0.16,192.168.0.17" wsrep_node_name=17 wsrep_node_address=17 wsrep_slave_threads=4 wsrep_sst_method=rsync wsrep_sst_auth=sst:bjyappam port = 3306 socket = /var/lib/mysql/mysql.sock skip-external-locking key_buffer_size = 256M max_allowed_packet = 1M table_open_cache = 256 sort_buffer_size = 1M read_buffer_size = 1M read_rnd_buffer_size = 4M myisam_sort_buffer_size = 64M thread_cache_size = 8 query_cache_size= 16M innodb_buffer_pool_size = 5000M thread_concurrency = 10 character_set_server=utf8 max_allowed_packet=256M log-bin=mysql-bin lower_case_table_names=1 basedir=/usr/local/mysql datadir=/data1/data binlog_format=row server-id = 3 innodb_flush_log_at_trx_commit = 0
java.sql.SQLException: Column 'gp_id' not found.错误
[color=red]在hibernate中调用存储过程,其中我的存储过程编写如下:[/color] [code="java"] DELIMITER $$ DROP PROCEDURE IF EXISTS `qdrk`.`undobusiness`$$ CREATE DEFINER=`root`@`localhost` PROCEDURE `undobusiness`() BEGIN DECLARE business_date timestamp default current_timestamp; DECLARE mon int; SELECT business_date; SELECT max(plandate) into business_date from jz_business_plan; SELECT business_date; set mon = DATE_FORMAT(business_date,'%m'); WHILE (mon < DATE_FORMAT(Now(),'%m')) do select g_id ,gb_id,account_id,bs_id from jz_gbmes where ((stday < date_format(Now(),'%d') and enday > date_format(Now(),'%d') and remindtype= '2'); insert into jz_business_plan(g_id,gb_id,account_id,bs_id) values(g_id,gb_id,account_id,bs_id); set mon = mon+1; end WHILE; SELECT * from jz_business_plan WHERE DATE_FORMAT(jz_business_plan.plandate,'%m') = DATE_FORMAT(now(),'%m'); END$$ DELIMITER ; [/code] [color=red]hibernate的配置文件如下:[/color][code="java"] <hibernate-mapping> <class name="cn.qdrk.strive.model.JzBusinessPlan" table="jz_business_plan" catalog="qdrk"> <id name="gpId" type="java.lang.Integer"> <column name="gp_id" /> <generator class="native"></generator> </id> <many-to-one name="accountTable" class="cn.qdrk.strive.model.AccountTable" fetch="select"> <column name="account_id" /> </many-to-one> <many-to-one name="jzBusiness" class="cn.qdrk.strive.model.JzBusiness" fetch="select"> <column name="bs_id" /> </many-to-one> <many-to-one name="jzGuestbook" class="cn.qdrk.strive.model.JzGuestbook" fetch="select"> <column name="gb_id" /> </many-to-one> <many-to-one name="jzGbmes" class="cn.qdrk.strive.model.JzGbmes" fetch="select"> <column name="g_id" /> </many-to-one> <property name="plandate" type="java.util.Date"> <column name="plandate" length="19" not-null="true" /> </property> <property name="remark" type="java.lang.String"> <column name="remark" /> </property> </class> <sql-query name="undobusiness" callable="true"> <return alias="JzBusinessPlan" class="cn.qdrk.strive.model.JzBusinessPlan"> <return-property name="gpId" column="gp_id"/> <return-property name="jzGbmes" column="g_id" /> <return-property name="accountTable" column="account_id"/> <return-property name="jzBusiness" column="bs_id" /> <return-property name="plandate" column="plandate" /> <return-property name="remark" column="remark" /> <return-property name="jzGuestbook" column="gb_id" /> </return> {call undobusiness()} </sql-query> </hibernate-mapping> [/code] [color=red]dao接口:[/color][code="java"] public List undoBusiness() { List list = this.getSession().getNamedQuery("undobusiness").list(); [/code] [color=red]我的表jz_business_plan定义如下:[/color] [code="java"] CREATE TABLE jz_business_plan( gp_id int(10) unsigned NOT NULL auto_increment, g_id int(11) unsigned default NULL, account_id int(11) unsigned default NULL, bs_id int unsigned default null, plandate timestamp NOT NULL default CURRENT_TIMESTAMP, remark varchar(255) default NULL, gb_id int unsigned default null, index (gb_id), FOREIGN KEY (gb_id) REFERENCES jz_guestbook (gb_id), index (account_id), FOREIGN KEY (account_id) REFERENCES account_table(account_id) , index (g_id), FOREIGN KEY (g_id) REFERENCES jz_gbmes(g_id), index (bs_id), FOREIGN KEY (bs_id) REFERENCES jz_business(bs_id) , PRIMARY KEY (gp_id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; [/code] 我调用的时候会出现java.sql.SQLException: Column 'gp_id' not found.错误,用这种方式调用其他的存储过程时没有错误,郁闷!难道我的存储过程有问题么? 错误信息如下: [code="java"] 2008-11-13 08:33:13,382 WARN [org.hibernate.util.JDBCExceptionReporter] - SQL Error: 0, SQLState: S0022 2008-11-13 08:33:13,382 ERROR [org.hibernate.util.JDBCExceptionReporter] - Column 'gp_id' not found. org.hibernate.exception.SQLGrammarException: could not execute query at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.loader.Loader.doList(Loader.java:2148) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029) at org.hibernate.loader.Loader.list(Loader.java:2024) at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:111) at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1655) at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142) at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:164) at cn.qdrk.strive.dao.hibernate.CRMDaoHibernate.undoBusiness(CRMDaoHibernate.java:43) [color=red]at cn.qdrk.strive.dao.hibernate.CRMDaoHibernate$$FastClassByCGLIB$$afe1117e.invoke(<generated>)[/color] at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149) [/code] [code="java"] [color=red]Caused by: java.sql.SQLException: Column 'gp_id' not found.[/color] at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926) at com.mysql.jdbc.ResultSetImpl.findColumn(ResultSetImpl.java:1093) at com.mysql.jdbc.ResultSetImpl.getInt(ResultSetImpl.java:2734) at org.apache.tomcat.dbcp.dbcp.DelegatingResultSet.getInt(DelegatingResultSet.java:237) [/code]
Mysql服务启动意外终止,下面是错误日志!求大神帮解决。。。
170210 10:33:11 [Note] Plugin 'FEDERATED' is disabled. D:\MySQL\MySQL Server 5.5\bin\mysqld: Table 'mysql.plugin' doesn't exist 170210 10:33:11 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. 170210 10:33:11 InnoDB: The InnoDB memory heap is disabled 170210 10:33:11 InnoDB: Mutexes and rw_locks use Windows interlocked functions 170210 10:33:11 InnoDB: Compressed tables use zlib 1.2.3 170210 10:33:11 InnoDB: Initializing buffer pool, size = 93.0M 170210 10:33:11 InnoDB: Completed initialization of buffer pool 170210 10:33:11 InnoDB: highest supported file format is Barracuda. 170210 10:33:12 InnoDB: Waiting for the background threads to start 170210 10:33:13 InnoDB: 5.5.53 started; log sequence number 1806653 170210 10:33:13 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306 170210 10:33:13 [Note] - '0.0.0.0' resolves to '0.0.0.0'; 170210 10:33:13 [Note] Server socket created on IP: '0.0.0.0'. 170210 10:33:13 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
有关数据迁移中MYSQL错误请教
我在数据迁移建表时出错: Mysql::Error:Can't create table'.store_development\goals.frm'<error:121>CREATE TABLE 'goals'<'id' int<11> DEFAULT NULL auto_increment PRIMARY KEY, 'title' varchar<255> DEFAULT NULL, 'description' text DEFAULT NULL > ENGINE=InnoDB 我数据迁移的代码是: [code="ruby"]class CreateGoals < ActiveRecord::Migration def self.up create_table :goals do |t| t.column :title, :string t.column :description, :text end end def self.down drop_table :goals end end[/code] google了好久都不知是哪里出错,望指教!谢谢! [b]问题补充:[/b] 重启电脑还是不行,我查了语法没错,配置没错,都不知错在哪里了。
爬虫福利二 之 妹子图网MM批量下载
爬虫福利一:27报网MM批量下载    点击 看了本文,相信大家对爬虫一定会产生强烈的兴趣,激励自己去学习爬虫,在这里提前祝:大家学有所成! 目标网站:妹子图网 环境:Python3.x 相关第三方模块:requests、beautifulsoup4 Re:各位在测试时只需要将代码里的变量 path 指定为你当前系统要保存的路径,使用 python xxx.py 或IDE运行即可。
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、PDF搜索网站推荐 对于大部
linux系列之常用运维命令整理笔录
本博客记录工作中需要的linux运维命令,大学时候开始接触linux,会一些基本操作,可是都没有整理起来,加上是做开发,不做运维,有些命令忘记了,所以现在整理成博客,当然vi,文件操作等就不介绍了,慢慢积累一些其它拓展的命令,博客不定时更新 顺便拉下票,我在参加csdn博客之星竞选,欢迎投票支持,每个QQ或者微信每天都可以投5票,扫二维码即可,http://m234140.nofollow.ax.
比特币原理详解
一、什么是比特币 比特币是一种电子货币,是一种基于密码学的货币,在2008年11月1日由中本聪发表比特币白皮书,文中提出了一种去中心化的电子记账系统,我们平时的电子现金是银行来记账,因为银行的背后是国家信用。去中心化电子记账系统是参与者共同记账。比特币可以防止主权危机、信用风险。其好处不多做赘述,这一层面介绍的文章很多,本文主要从更深层的技术原理角度进行介绍。 二、问题引入  假设现有4个人
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发
网页实现一个简单的音乐播放器(大佬别看。(⊙﹏⊙))
今天闲着无事,就想写点东西。然后听了下歌,就打算写个播放器。 于是乎用h5 audio的加上js简单的播放器完工了。 欢迎 改进 留言。 演示地点跳到演示地点 html代码如下`&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;music&lt;/title&gt; &lt;meta charset="utf-8"&gt
Python十大装B语法
Python 是一种代表简单思想的语言,其语法相对简单,很容易上手。不过,如果就此小视 Python 语法的精妙和深邃,那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点,并附上详细的实例代码。如能在实战中融会贯通、灵活使用,必将使代码更为精炼、高效,同时也会极大提升代码B格,使之看上去更老练,读起来更优雅。 1. for - else 什么?不是 if 和 else 才
数据库优化 - SQL优化
前面一篇文章从实例的角度进行数据库优化,通过配置一些参数让数据库性能达到最优。但是一些“不好”的SQL也会导致数据库查询变慢,影响业务流程。本文从SQL角度进行数据库优化,提升SQL运行效率。 判断问题SQL 判断SQL是否有问题时可以通过两个表象进行判断: 系统级别表象 CPU消耗严重 IO等待严重 页面响应时间过长
2019年11月中国大陆编程语言排行榜
2019年11月2日,我统计了某招聘网站,获得有效程序员招聘数据9万条。针对招聘信息,提取编程语言关键字,并统计如下: 编程语言比例 rank pl_ percentage 1 java 33.62% 2 c/c++ 16.42% 3 c_sharp 12.82% 4 javascript 12.31% 5 python 7.93% 6 go 7.25% 7
通俗易懂地给女朋友讲:线程池的内部原理
餐厅的约会 餐盘在灯光的照耀下格外晶莹洁白,女朋友拿起红酒杯轻轻地抿了一小口,对我说:“经常听你说线程池,到底线程池到底是个什么原理?”我楞了一下,心里想女朋友今天是怎么了,怎么突然问出这么专业的问题,但做为一个专业人士在女朋友面前也不能露怯啊,想了一下便说:“我先给你讲讲我前同事老王的故事吧!” 大龄程序员老王 老王是一个已经北漂十多年的程序员,岁数大了,加班加不动了,升迁也无望,于是拿着手里
经典算法(5)杨辉三角
写在前面: 我是 扬帆向海,这个昵称来源于我的名字以及女朋友的名字。我热爱技术、热爱开源、热爱编程。技术是开源的、知识是共享的。 这博客是对自己学习的一点点总结及记录,如果您对 Java、算法 感兴趣,可以关注我的动态,我们一起学习。 用知识改变命运,让我们的家人过上更好的生活。 目录一、杨辉三角的介绍二、杨辉三角的算法思想三、代码实现1.第一种写法2.第二种写法 一、杨辉三角的介绍 百度
腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹?
昨天,有网友私信我,说去阿里面试,彻底的被打击到了。问了为什么网上大量使用ThreadLocal的源码都会加上private static?他被难住了,因为他从来都没有考虑过这个问题。无独有偶,今天笔者又发现有网友吐槽了一道腾讯的面试题,我们一起来看看。 腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹? 在互联网职场论坛,一名程序员发帖求助到。二面腾讯,其中一个算法题:64匹
面试官:你连RESTful都不知道我怎么敢要你?
面试官:了解RESTful吗? 我:听说过。 面试官:那什么是RESTful? 我:就是用起来很规范,挺好的 面试官:是RESTful挺好的,还是自我感觉挺好的 我:都挺好的。 面试官:… 把门关上。 我:… 要干嘛?先关上再说。 面试官:我说出去把门关上。 我:what ?,夺门而去 文章目录01 前言02 RESTful的来源03 RESTful6大原则1. C-S架构2. 无状态3.统一的接
为啥国人偏爱Mybatis,而老外喜欢Hibernate/JPA呢?
关于SQL和ORM的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行了一番讨论,感触还是有一些,于是就有了今天这篇文。 声明:本文不会下关于Mybatis和JPA两个持久层框架哪个更好这样的结论。只是摆事实,讲道理,所以,请各位看官勿喷。 一、事件起因 关于Mybatis和JPA孰优孰劣的问题,争论已经很多年了。一直也没有结论,毕竟每个人的喜好和习惯是大不相同的。我也看
SQL-小白最佳入门sql查询一
一 说明 如果是初学者,建议去网上寻找安装Mysql的文章安装,以及使用navicat连接数据库,以后的示例基本是使用mysql数据库管理系统; 二 准备前提 需要建立一张学生表,列分别是id,名称,年龄,学生信息;本示例中文章篇幅原因SQL注释略; 建表语句: CREATE TABLE `student` ( `id` int(11) NOT NULL AUTO_INCREMENT, `
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // dosho
【图解经典算法题】如何用一行代码解决约瑟夫环问题
约瑟夫环问题算是很经典的题了,估计大家都听说过,然后我就在一次笔试中遇到了,下面我就用 3 种方法来详细讲解一下这道题,最后一种方法学了之后保证让你可以让你装逼。 问题描述:编号为 1-N 的 N 个士兵围坐在一起形成一个圆圈,从编号为 1 的士兵开始依次报数(1,2,3…这样依次报),数到 m 的 士兵会被杀死出列,之后的士兵再从 1 开始报数。直到最后剩下一士兵,求这个士兵的编号。 1、方
致 Python 初学者
文章目录1. 前言2. 明确学习目标,不急于求成,不好高骛远3. 在开始学习 Python 之前,你需要做一些准备2.1 Python 的各种发行版2.2 安装 Python2.3 选择一款趁手的开发工具3. 习惯使用IDLE,这是学习python最好的方式4. 严格遵从编码规范5. 代码的运行、调试5. 模块管理5.1 同时安装了py2/py35.2 使用Anaconda,或者通过IDE来安装模
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,
程序员:我终于知道post和get的区别
IT界知名的程序员曾说:对于那些月薪三万以下,自称IT工程师的码农们,其实我们从来没有把他们归为我们IT工程师的队伍。他们虽然总是以IT工程师自居,但只是他们一厢情愿罢了。 此话一出,不知激起了多少(码农)程序员的愤怒,却又无可奈何,于是码农问程序员。 码农:你知道get和post请求到底有什么区别? 程序员:你看这篇就知道了。 码农:你月薪三万了? 程序员:嗯。 码农:你是怎么做到的? 程序员:
《程序人生》系列-这个程序员只用了20行代码就拿了冠军
你知道的越多,你不知道的越多 点赞再看,养成习惯GitHub上已经开源https://github.com/JavaFamily,有一线大厂面试点脑图,欢迎Star和完善 前言 这一期不算《吊打面试官》系列的,所有没前言我直接开始。 絮叨 本来应该是没有这期的,看过我上期的小伙伴应该是知道的嘛,双十一比较忙嘛,要值班又要去帮忙拍摄年会的视频素材,还得搞个程序员一天的Vlog,还要写BU
加快推动区块链技术和产业创新发展,2019可信区块链峰会在京召开
      11月8日,由中国信息通信研究院、中国通信标准化协会、中国互联网协会、可信区块链推进计划联合主办,科技行者协办的2019可信区块链峰会将在北京悠唐皇冠假日酒店开幕。   区块链技术被认为是继蒸汽机、电力、互联网之后,下一代颠覆性的核心技术。如果说蒸汽机释放了人类的生产力,电力解决了人类基本的生活需求,互联网彻底改变了信息传递的方式,区块链作为构造信任的技术有重要的价值。   1
程序员把地府后台管理系统做出来了,还有3.0版本!12月7号最新消息:已在开发中有github地址
第一幕:缘起 听说阎王爷要做个生死簿后台管理系统,我们派去了一个程序员…… 996程序员做的梦: 第一场:团队招募 为了应对地府管理危机,阎王打算找“人”开发一套地府后台管理系统,于是就在地府总经办群中发了项目需求。 话说还是中国电信的信号好,地府都是满格,哈哈!!! 经常会有外行朋友问:看某网站做的不错,功能也简单,你帮忙做一下? 而这次,面对这样的需求,这个程序员
网易云6亿用户音乐推荐算法
网易云音乐是音乐爱好者的集聚地,云音乐推荐系统致力于通过 AI 算法的落地,实现用户千人千面的个性化推荐,为用户带来不一样的听歌体验。 本次分享重点介绍 AI 算法在音乐推荐中的应用实践,以及在算法落地过程中遇到的挑战和解决方案。 将从如下两个部分展开: AI 算法在音乐推荐中的应用 音乐场景下的 AI 思考 从 2013 年 4 月正式上线至今,网易云音乐平台持续提供着:乐屏社区、UGC
【技巧总结】位运算装逼指南
位算法的效率有多快我就不说,不信你可以去用 10 亿个数据模拟一下,今天给大家讲一讲位运算的一些经典例子。不过,最重要的不是看懂了这些例子就好,而是要在以后多去运用位运算这些技巧,当然,采用位运算,也是可以装逼的,不信,你往下看。我会从最简单的讲起,一道比一道难度递增,不过居然是讲技巧,那么也不会太难,相信你分分钟看懂。 判断奇偶数 判断一个数是基于还是偶数,相信很多人都做过,一般的做法的代码如下
日均350000亿接入量,腾讯TubeMQ性能超过Kafka
整理 | 夕颜出品 | AI科技大本营(ID:rgznai100) 【导读】近日,腾讯开源动作不断,相继开源了分布式消息中间件TubeMQ,基于最主流的 OpenJDK8开发的
8年经验面试官详解 Java 面试秘诀
    作者 | 胡书敏 责编 | 刘静 出品 | CSDN(ID:CSDNnews) 本人目前在一家知名外企担任架构师,而且最近八年来,在多家外企和互联网公司担任Java技术面试官,前后累计面试了有两三百位候选人。在本文里,就将结合本人的面试经验,针对Java初学者、Java初级开发和Java开发,给出若干准备简历和准备面试的建议。   Java程序员准备和投递简历的实
面试官如何考察你的思维方式?
1.两种思维方式在求职面试中,经常会考察这种问题:北京有多少量特斯拉汽车? 某胡同口的煎饼摊一年能卖出多少个煎饼? 深圳有多少个产品经理? 一辆公交车里能装下多少个乒乓球? 一
so easy! 10行代码写个"狗屁不通"文章生成器
前几天,GitHub 有个开源项目特别火,只要输入标题就可以生成一篇长长的文章。背后实现代码一定很复杂吧,里面一定有很多高深莫测的机器学习等复杂算法不过,当我看了源代码之后这程序不到50
相关热词 c# 二进制截断字符串 c#实现窗体设计器 c#检测是否为微信 c# plc s1200 c#里氏转换原则 c# 主界面 c# do loop c#存为组套 模板 c# 停掉协程 c# rgb 读取图片
立即提问