[Root @ localhostvar] # vietcmy. cnflog-binusrlocalmysqldatamylog -- add the log-bin parameter [root @ localhostvar] # servicemysqldstopmysqld: unrecognizedservice [root @ localhostvar] # servicemysqlstopShuttingdownMySQL .... [OK] [root
[Root @ localhost var] # vi/etc/my. cnf log-bin =/usr/local/mysql/data/mylog -- add the log-bin parameter [root @ localhost var] # service mysqld stop mysqld: unrecognized service [root @ localhost var] # service mysql stop Shutting down MySQL .... [OK] [root
[Root @ localhost var] # vi/etc/my. cnf
Log-bin =/usr/local/mysql/data/mylog -- add the log-bin Parameter
[Root @ localhost var] # service mysqld stop
Mysqld: unrecognized service
[Root @ localhost var] # service mysql stop
Shutting down MySQL... [OK]
[Root @ localhost var] # service mysql start
Starting MySQL. The server quit without updating PID file (/[FAILED] l/mysql/var/localhost. localdomain. pid ).
[Root @ localhost var] # service mysql start
Starting MySQL. The server quit without updating PID file (/[FAILED] l/mysql/var/localhost. localdomain. pid ).
[Root @ localhost var] # tail-25 localhost. localdomain. err
140805 13:43:22 mysqld_safe Starting mysqld daemon with databases from/usr/local/mysql/var
/Usr/local/mysql/bin/mysqld:File '/usr/local/mysql/data/mylog. Index' not found (Errcode: 13)
140805 13:43:22 [ERROR] Aborting
140805 13:43:22 [Note]/usr/local/mysql/bin/mysqld: Shutdown complete
140805 13:42:53 mysqld_safe mysqld from pid file/usr/local/mysql/var/localhost. localdomain. pid ended
[Root @ localhost mysql] # ll/usr/local/mysql/
Total 80
-Rw-r -- 1 root mysql 17987 Aug 29 2012 COPYING
-Rw-r -- 1 root mysql 7604 Aug 29 2012 INSTALL-BINARY
-Rw-r -- 1 root mysql 2552 Aug 29 2012 README
Drwxr-xr-x 2 root mysql 4096 Dec 26 2013 bin
Drwxr-xr-x 4 root mysql 4096 Dec 26 2013 data
Drwxr-xr-x 2 root mysql 4096 Dec 26 2013 docs
Drwxr-xr-x 3 root mysql 4096 Dec 26 2013 include
Drwxr-xr-x 3 root mysql 4096 Dec 26 2013 lib
Drwxr-xr-x 4 root mysql 4096 Dec 26 2013 man
Drwxr-xr-x 10 root mysql 4096 Dec 26 2013 mysql-test
Drwxr-xr-x 2 root mysql 4096 Dec 26 2013 scripts
Drwxr-xr-x 27 root mysql 4096 Dec 26 2013 share
Drwxr-xr-x 4 root mysql 4096 Dec 26 2013 SQL-statements
Drwxr-xr-x 2 root mysql 4096 Dec 26 2013 support-files
Drwx ------ 5 mysql 4096 Aug 5 var
[Root @ localhost mysql] # chown-R mysql/usr/local/mysql/data -- change the data directory owner
[Root @ localhost mysql] # ll/usr/local/mysql/
Total 80
-Rw-r -- 1 root mysql 17987 Aug 29 2012 COPYING
-Rw-r -- 1 root mysql 7604 Aug 29 2012 INSTALL-BINARY
-Rw-r -- 1 root mysql 2552 Aug 29 2012 README
Drwxr-xr-x 2 root mysql 4096 Dec 26 2013 bin
Drwxr-xr-x 4 mysql 4096 Dec 26 2013 data
Drwxr-xr-x 2 root mysql 4096 Dec 26 2013 docs
Drwxr-xr-x 3 root mysql 4096 Dec 26 2013 include
Drwxr-xr-x 3 root mysql 4096 Dec 26 2013 lib
Drwxr-xr-x 4 root mysql 4096 Dec 26 2013 man
Drwxr-xr-x 10 root mysql 4096 Dec 26 2013 mysql-test
Drwxr-xr-x 2 root mysql 4096 Dec 26 2013 scripts
Drwxr-xr-x 27 root mysql 4096 Dec 26 2013 share
Drwxr-xr-x 4 root mysql 4096 Dec 26 2013 SQL-statements
Drwxr-xr-x 2 root mysql 4096 Dec 26 2013 support-files
Drwx ------ 5 mysql 4096 Aug 5 var
[Root @ localhost mysql] # service mysql start
Starting MySQL... [OK]