/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.