mysql5.5 启动报错:ERROR!_MySQL
bitsCN.com
在FreeBSD中启动mysql时报错,ERROR! The server quit without updating PID file,通常这是可以查看数据库目录下的.err日志,里面会记录一些具体的错误信息,对排错相当有用,内容如下:
110805 17:30:19 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql5.5/data
110805 17:30:19 InnoDB: The InnoDB memory heap is disabled
110805 17:30:19 InnoDB: Mutexes and rw_locks use GCC atomic builtins
110805 17:30:19 InnoDB: Compressed tables use zlib 1.2.3
110805 17:30:19 InnoDB: Initializing buffer pool, size = 256.0M
110805 17:30:19 InnoDB: Completed initialization of buffer pool
InnoDB: Error: log file /usr/local/mysql5.5/data/ib_logfile0 is of different size 0 5242880 bytes
InnoDB: than specified in the .cnf file 0 67108864 bytes!
110805 17:30:19 [ERROR] Plugin 'InnoDB' init function returned error.
110805 17:30:19 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
110805 17:30:19 [ERROR] Unknown/unsupported storage engine: InnoDB
110805 17:30:19 [ERROR] Aborting
110805 17:30:19 [Note] /usr/local/mysql5.5/bin/mysqld: Shutdown complete
看到上面红色字体,显示错误是出在日志文件大小上,于是查看mysql的配置文件/etc/my.cnf
# Uncomment the following if you are using InnoDB tables
innodb_data_home_dir = /usr/local/mysql5.5/data
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = /usr/local/mysql5.5/data
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
innodb_buffer_pool_size = 256M
innodb_additional_mem_pool_size = 20M
# Set .._log_file_size to 25 % of buffer pool size
innodb_log_file_size = 64M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50
配置文件中指定了innodb_log_file_size=64M,在看看我的数据库目录下,日志文件大小是不是64M,如下图,发现问题了,日志文件是5242880是5M
找到问题了,解决办法可以更改配置文件,也可以删除现在这个日志,再启动mysql这样它会重新生成这两个日志文件。
怎么会出现这个问题呢?
一般来说,是由于,在my.cnf中关于INNODB的一些配置是被注释的,在没有更改的情况下,系统就使用了默认值,这样,当你把关于innodb的配置选项注释去掉的时候,就会出现这个报错!
bitsCN.com
Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











Apple's latest releases of iOS18, iPadOS18 and macOS Sequoia systems have added an important feature to the Photos application, designed to help users easily recover photos and videos lost or damaged due to various reasons. The new feature introduces an album called "Recovered" in the Tools section of the Photos app that will automatically appear when a user has pictures or videos on their device that are not part of their photo library. The emergence of the "Recovered" album provides a solution for photos and videos lost due to database corruption, the camera application not saving to the photo library correctly, or a third-party application managing the photo library. Users only need a few simple steps

Hibernate polymorphic mapping can map inherited classes to the database and provides the following mapping types: joined-subclass: Create a separate table for the subclass, including all columns of the parent class. table-per-class: Create a separate table for subclasses, containing only subclass-specific columns. union-subclass: similar to joined-subclass, but the parent class table unions all subclass columns.

To handle database connection errors in PHP, you can use the following steps: Use mysqli_connect_errno() to obtain the error code. Use mysqli_connect_error() to get the error message. By capturing and logging these error messages, database connection issues can be easily identified and resolved, ensuring the smooth running of your application.

How to use MySQLi to establish a database connection in PHP: Include MySQLi extension (require_once) Create connection function (functionconnect_to_db) Call connection function ($conn=connect_to_db()) Execute query ($result=$conn->query()) Close connection ( $conn->close())

Using the database callback function in Golang can achieve: executing custom code after the specified database operation is completed. Add custom behavior through separate functions without writing additional code. Callback functions are available for insert, update, delete, and query operations. You must use the sql.Exec, sql.QueryRow, or sql.Query function to use the callback function.

JSON data can be saved into a MySQL database by using the gjson library or the json.Unmarshal function. The gjson library provides convenience methods to parse JSON fields, and the json.Unmarshal function requires a target type pointer to unmarshal JSON data. Both methods require preparing SQL statements and performing insert operations to persist the data into the database.

Through the Go standard library database/sql package, you can connect to remote databases such as MySQL, PostgreSQL or SQLite: create a connection string containing database connection information. Use the sql.Open() function to open a database connection. Perform database operations such as SQL queries and insert operations. Use defer to close the database connection to release resources.

PHP database connection guide: MySQL: Install the MySQLi extension and create a connection (servername, username, password, dbname). PostgreSQL: Install the PgSQL extension and create a connection (host, dbname, user, password). Oracle: Install the OracleOCI8 extension and create a connection (servername, username, password). Practical case: Obtain MySQL data, PostgreSQL query, OracleOCI8 update record.
