An error occurred while creating the data file in mysql innodb.

Source: Internet
Author: User

/Etc/my. cnf Configuration

[Mysqld]
Datadir =/var/lib/mysql
Socket =/var/lib/mysql. sock
User = mysql
# Default to using old password format for compatibility with mysql 3.x
# Clients (those using the mysqlclient10 compatibility package ).
Old_passwords = 1

# Disabling symbolic-links is recommended to prevent assorted security risks;
# To do so, uncomment this line:
# Symbolic-links = 0

Default-character-set = utf8
Default-storage-engine = innodb
# Uncomment the following if you are using InnoDB tables
Innodb_data_home_dir =/var/mysql/innodb/
Innodb_data_file_path = ibdata1: 2000 M; ibdata2: 10 M: autoextend
Innodb_log_group_home_dir =/var/mysql/innodb/log/
Innodb_log_arch_dir =/var/mysql/innodb/log/

# You can set .. _ buffer_pool_size up to 50-80%
# Of RAM but beware of setting memory usage too high
Innodb_buffer_pool_size = 1024 M
Innodb_additional_mem_pool_size = 20 M
# Set .. _ log_file_size to 25% of buffer pool size
Innodb_log_file_size = 192 M
Innodb_log_buffer_size = 18 M
Innodb_flush_log_at_trx_commit = 1
Innodb_lock_wait_timeout = 50

[Client]
Default-character-set = gbk

[Mysqld_safe]
Log-error =/var/log/mysqld. log
Pid-file =/var/run/mysqld. pid

Failed to start mysqld, directory permission set to 777, and/usr/bin/mysql_install_db -- user = mysql

It seems that the innodb data directory must be in the subdirectory configured by datadir!

View logs/var/log/mysqld. log

.........................

120817 13:08:17 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights
InnoDB: the directory.
InnoDB: File name/var/mysql/innodb/ibdata1
InnoDB: File operation call: 'create '.
InnoDB: Cannot continue operation.
120817 13:08:17 mysqld ended

Modify/etc/my. cnf Configuration

[Mysqld]
Datadir =/var/lib/mysql
Socket =/var/lib/mysql. sock
User = mysql
# Default to using old password format for compatibility with mysql 3.x
# Clients (those using the mysqlclient10 compatibility package ).
Old_passwords = 1

# Disabling symbolic-links is recommended to prevent assorted security risks;
# To do so, uncomment this line:
# Symbolic-links = 0

Default-character-set = utf8
Default-storage-engine = innodb
# Uncomment the following if you are using InnoDB tables
Innodb_data_home_dir =/var/lib/mysql/innodb/
Innodb_data_file_path = ibdata1: 2000 M; ibdata2: 10 M: autoextend
Innodb_log_group_home_dir =/var/lib/mysql/innodb/log/
Innodb_log_arch_dir =/var/lib/mysql/innodb/log/
# You can set .. _ buffer_pool_size up to 50-80%
# Of RAM but beware of setting memory usage too high
Innodb_buffer_pool_size = 1024 M
Innodb_additional_mem_pool_size = 20 M
# Set .. _ log_file_size to 25% of buffer pool size
Innodb_log_file_size = 192 M
Innodb_log_buffer_size = 18 M
Innodb_flush_log_at_trx_commit = 1
Innodb_lock_wait_timeout = 50

[Client]
Default-character-set = gbk

[Mysqld_safe]
Log-error =/var/log/mysqld. log
Pid-file =/var/run/mysqld. pid

Started successfully.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.