[root@DB-Server tmp]# mysqladmin -u root -p variables | grep datadir
Enter password:
| datadir | /var/lib/mysql/
[root@DB-Server ~]# service mysql status
MySQL running (9411)[ OK ]
[root@DB-Server ~]# service mysql stop
Shutting down MySQL..[ OK ]
[root@DB-Server ~]#
[root@DB-Server ~]# /etc/rc.d/init.d/mysql status
MySQL running (8900)[ OK ]
[root@DB-Server ~]# /etc/rc.d/init.d/mysql stop
Shutting down MySQL..[ OK ]
[root@DB-Server ~]#
# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3306
socket = /u01/mysqldata/mysql/mysql.sock
# Here follows entries for some specific programs
# The MySQL server
[mysqld]
port = 3306
socket = /u01/mysqldata/mysql/mysql.sock
skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
[root@DB-Server ~]# service mysql start
Starting MySQL..[ OK ]
[root@DB-Server ~]# mysqladmin -u root -p variables | grep datadir
Enter password:
| datadir | /u01/mysqldata/mysql/
[root@DB-Server mysql]# /etc/init.d/mysql start
Starting MySQL....The server quit without updating PID file (/u01/mysqldata/mysql//DB-Server.localdomain.pid).[FAILED]
[root@DB-Server mysql]#
[root@DB-Server mysql]# chcon -R -t mysqld_db_t /u01/mysqldata/mysql/
[root@DB-Server mysql]# /etc/init.d/mysql start
Starting MySQL.[ OK ]
[root@DB-Server mysql]#