(0) REF: http://forum.ubuntu.org.cn/viewtopic.php?t=319886
(1) [root@localhost webadm]# tar xvzf mysql-5.5.40.tar.gz [root@localhost mysql-5.5.40]# ls BUILD configure.cmake INSTALL-WIN-SOURCE packaging sql-common vio BUILD-CMAKE COPYING libmysql plugin storage win client dbug libmysqld README strings zlib cmake Docs libservices regex support-files CMakeLists.txt extra man scripts tests cmd-line-utils include mysql-test sql unittest config.h.cmake INSTALL-SOURCE mysys sql-bench VERSION [root@localhost mysql-5.5.40]#
(2)
[root@localhost mysql-5.5.40]# cat README |more : MySQL Server 5.5
This is a release of MySQL, a dual-license SQL database server. For the avoidance of doubt, this particular copy of the software is released under the version 2 of the GNU General Public License. MySQL is brought to you by Oracle.
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
License information can be found in the COPYING file.
MySQL FOSS License Exception We want free and open source software applications under certain licenses to be able to use specified GPL-licensed MySQL client libraries despite the fact that not all such FOSS licenses are compatible with version 2 of the GNU General Public License. Therefore there are special exceptions to the terms and conditions of the GPLv2 as applied to these client libraries, which are identified and described in more detail in the FOSS License Exception at <http://www.mysql.com/about/legal/licensing/foss-exception.html>.
This distribution may include materials developed by third parties. For license and attribution notices for these materials, please refer to the documentation that accompanies this distribution (see the "Licenses for Third-Party Components" appendix) or view the online documentation at <http://dev.mysql.com/doc/>.
[root@localhost mysql-5.5.40]# cat INSTALL-SOURCE
To install MySQL from source, your system must have the following tools, regardless of installation method:
* CMake, which is used as the build framework on all platforms. CMake can be downloaded from http://www.cmake.org. :
For example, with a compressed tar file source distribution on Unix, the basic installation command sequence looks like this: # Preconfiguration setup shell> groupadd mysql shell> useradd -r -g mysql mysql # Beginning of source-build specific instructions shell> tar zxvf mysql-VERSION.tar.gz shell> cd mysql-VERSION shell> cmake . shell> make shell> make install # End of source-build specific instructions # Postinstallation setup shell> cd /usr/local/mysql shell> chown -R mysql . shell> chgrp -R mysql . shell> scripts/mysql_install_db --user=mysql shell> chown -R root . shell> chown -R mysql data # Next command is optional shell> cp support-files/my-medium.cnf /etc/my.cnf shell> bin/mysqld_safe --user=mysql & # Next command is optional shell> cp support-files/mysql.server /etc/init.d/mysql.server
A more detailed version of the source-build specific instructions
(3)
[root@localhost mysql-5.5.40]# yum install cmake
: 1/1
Installed: cmake.i686 0:2.8.12.2-2.fc19
Complete! [root@localhost mysql-5.5.40]# (4) [root@localhost mysql-5.5.40]# cmake . : Warning: Bison executable not found in PATH -- Configuring done -- Generating done -- Build files have been written to: /home/webadm/mysql-5.5.40 [root@localhost mysql-5.5.40]#
[root@localhost mysql-5.5.40]# yum install bison : Installed: bison.i686 0:2.6.4-2.fc19
Complete! [root@localhost mysql-5.5.40]# [root@localhost mysql-5.5.40]# cmake . -- Running cmake version 2.8.12.2 -- MySQL 5.5.40 -- Packaging as: mysql-5.5.40-Linux-i686 -- Library mysqlclient depends on OSLIBS -lpthread;z;m;dl -- Configuring done -- Generating done -- Build files have been written to: /home/webadm/mysql-5.5.40 [root@localhost mysql-5.5.40]#
(5) [root@localhost mysql-5.5.40]# make : [100%] Built target my_safe_process
(6) [root@localhost mysql-5.5.40]# make install
[root@localhost mysql-5.5.40]# ls /usr/local/mysql/ -l 總計 212 drwxr-xr-x 2 root mysql 4096 11月 13 20:12 bin -rw-r--r-- 1 root root 17987 9月 8 17:53 COPYING drwxr-xr-x 3 root root 4096 11月 13 20:12 data drwxr-xr-x 2 root root 4096 11月 13 20:12 docs drwxr-xr-x 3 root mysql 4096 11月 13 20:12 include drwxr-xr-x 2 root mysql 4096 10月 14 17:12 info -rw-r--r-- 1 root root 132608 9月 8 17:53 INSTALL-BINARY drwxr-xr-x 4 root mysql 4096 11月 13 20:12 lib drwxr-xr-x 2 root mysql 4096 10月 14 17:12 libexec drwxr-xr-x 4 root mysql 4096 10月 14 17:12 man drwxr-xr-x 10 root mysql 4096 11月 13 20:12 mysql-test -rw-r--r-- 1 root root 2496 9月 8 17:53 README drwxr-xr-x 2 root root 4096 11月 13 20:12 scripts drwxr-xr-x 28 root mysql 4096 11月 13 20:12 share drwxr-xr-x 5 root mysql 4096 11月 13 20:12 sql-bench drwxr-xr-x 2 root root 4096 11月 13 20:12 support-files drwx------ 8 mysql mysql 4096 11月 13 19:35 var [root@localhost mysql-5.5.40]#
(7)
[root@localhost mysql]# tar cvzf var.tgz var [root@localhost mysql]# ls -l|grep tgz -rw-r--r-- 1 root root 456533439 11月 13 20:21 var.tgz [root@localhost mysql]#
(8) [root@localhost mysql]# chown -R mysql . [root@localhost mysql]# ls -l 總計 446048 drwxr-xr-x 2 mysql mysql 4096 11月 13 20:12 bin -rw-r--r-- 1 mysql root 17987 9月 8 17:53 COPYING drwxr-xr-x 3 mysql root 4096 11月 13 20:12 data drwxr-xr-x 2 mysql root 4096 11月 13 20:12 docs drwxr-xr-x 3 mysql mysql 4096 11月 13 20:12 include drwxr-xr-x 2 mysql mysql 4096 10月 14 17:12 info -rw-r--r-- 1 mysql root 132608 9月 8 17:53 INSTALL-BINARY drwxr-xr-x 4 mysql mysql 4096 11月 13 20:12 lib drwxr-xr-x 2 mysql mysql 4096 10月 14 17:12 libexec drwxr-xr-x 4 mysql mysql 4096 10月 14 17:12 man drwxr-xr-x 10 mysql mysql 4096 11月 13 20:12 mysql-test -rw-r--r-- 1 mysql root 2496 9月 8 17:53 README drwxr-xr-x 2 mysql root 4096 11月 13 20:12 scripts drwxr-xr-x 28 mysql mysql 4096 11月 13 20:12 share drwxr-xr-x 5 mysql mysql 4096 11月 13 20:12 sql-bench drwxr-xr-x 2 mysql root 4096 11月 13 20:12 support-files drwx------ 8 mysql mysql 4096 11月 13 20:24 var -rw-r--r-- 1 mysql root 456533439 11月 13 20:21 var.tgz (9) [root@localhost mysql]# chgrp -R mysql . [root@localhost mysql]# ls -l 總計 446048 drwxr-xr-x 2 mysql mysql 4096 11月 13 20:12 bin -rw-r--r-- 1 mysql mysql 17987 9月 8 17:53 COPYING drwxr-xr-x 3 mysql mysql 4096 11月 13 20:12 data drwxr-xr-x 2 mysql mysql 4096 11月 13 20:12 docs drwxr-xr-x 3 mysql mysql 4096 11月 13 20:12 include drwxr-xr-x 2 mysql mysql 4096 10月 14 17:12 info -rw-r--r-- 1 mysql mysql 132608 9月 8 17:53 INSTALL-BINARY drwxr-xr-x 4 mysql mysql 4096 11月 13 20:12 lib drwxr-xr-x 2 mysql mysql 4096 10月 14 17:12 libexec drwxr-xr-x 4 mysql mysql 4096 10月 14 17:12 man drwxr-xr-x 10 mysql mysql 4096 11月 13 20:12 mysql-test -rw-r--r-- 1 mysql mysql 2496 9月 8 17:53 README drwxr-xr-x 2 mysql mysql 4096 11月 13 20:12 scripts drwxr-xr-x 28 mysql mysql 4096 11月 13 20:12 share drwxr-xr-x 5 mysql mysql 4096 11月 13 20:12 sql-bench drwxr-xr-x 2 mysql mysql 4096 11月 13 20:12 support-files drwx------ 8 mysql mysql 4096 11月 13 20:24 var -rw-r--r-- 1 mysql mysql 456533439 11月 13 20:21 var.tgz [root@localhost mysql]#
(10)
[root@localhost mysql]# scripts/mysql_install_db --user=mysql Installing MySQL system tables... 141113 20:27:25 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead. 141113 20:27:25 [ERROR] ./bin/mysqld: unknown option '--skip-locking' 141113 20:27:25 [ERROR] Aborting
141113 20:27:25 [Note] ./bin/mysqld: Shutdown complete
Installation of system tables failed! Examine the logs in ./data for more information.
You can try to start the mysqld daemon with:
shell> ./bin/mysqld --skip-grant &
and use the command line tool ./bin/mysql to connect to the mysql database and look at the grant tables:
shell> ./bin/mysql -u root mysql mysql> show tables
Try 'mysqld --help' if you have problems with paths. Using --log gives you a log in ./data that may be helpful.
Please consult the MySQL manual section 'Problems running mysql_install_db', and the manual section that describes problems on your OS. Another information source are the MySQL email archives available at http://lists.mysql.com/.
Please check all of the above before submitting a bug report at http://bugs.mysql.com/
[root@localhost mysql]# [root@localhost mysql]# ps ax|grep mysql 667 ? S 0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe 12935 ? Sl 0:00 /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/var --user=mysql --pid-file=/usr/local/mysql/var/localhost.localdomain.pid --skip-external-locking --port=3306 --socket=/tmp/mysql.sock 12989 pts/1 S+ 0:00 grep --color=auto mysql [root@localhost mysql]# kill -9 667 12935 [root@localhost mysql]# ps ax|grep mysql 12992 pts/1 S+ 0:00 grep --color=auto mysql [root@localhost mysql]# [root@localhost mysql]# scripts/mysql_install_db --user=mysql Installing MySQL system tables... 141113 20:29:07 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead. 141113 20:29:07 [ERROR] ./bin/mysqld: unknown option '--skip-locking' 141113 20:29:07 [ERROR] Aborting
141113 20:29:07 [Note] ./bin/mysqld: Shutdown complete
Installation of system tables failed! Examine the logs in ./data for more information.
You can try to start the mysqld daemon with:
shell> ./bin/mysqld --skip-grant &
and use the command line tool ./bin/mysql to connect to the mysql database and look at the grant tables:
shell> ./bin/mysql -u root mysql mysql> show tables
Try 'mysqld --help' if you have problems with paths. Using --log gives you a log in ./data that may be helpful.
Please consult the MySQL manual section 'Problems running mysql_install_db', and the manual section that describes problems on your OS. Another information source are the MySQL email archives available at http://lists.mysql.com/.
Please check all of the above before submitting a bug report at http://bugs.mysql.com/
[root@localhost mysql]#
(11) [root@localhost mysql]# ls /etc -l|grep cnf -rw-r--r-- 1 root root 4983 11月 6 11:24 my.cnf -rw-r--r-- 1 root root 4912 11月 3 17:05 my.cnf_20141103 drwxr-xr-x 2 root root 4096 11月 3 16:42 my.cnf.d -rw-r--r-- 1 root root 558 8月 27 00:29 my.cnf.rpmnew [root@localhost mysql]# cp /etc/my.cnf /etc/my.cnf.20141113 [root@localhost mysql]# cp support-files/my-medium.cnf /etc/my.cnf cp:是否覆寫 ‘/etc/my.cnf’? y [root@localhost mysql]#
(12) [root@localhost mysql]# scripts/mysql_install_db --user=mysql Installing MySQL system tables... OK Filling help tables... OK
To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, start the server, then issue the following commands:
./bin/mysqladmin -u root password 'new-password' ./bin/mysqladmin -u root -h localhost.localdomain password 'new-password'
Alternatively you can run: ./bin/mysql_secure_installation
which will also give you the option of removing the test databases and anonymous user created by default. This is strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with: cd . ; ./bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl cd ./mysql-test ; perl mysql-test-run.pl
Please report any problems at http://bugs.mysql.com/
[root@localhost mysql]#
(13) [root@localhost mysql]# ./bin/mysqld_safe & [1] 13095 [root@localhost mysql]# 141113 20:40:42 mysqld_safe Logging to '/usr/local/mysql/data/localhost.localdomain.err'. 141113 20:40:42 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
[root@localhost mysql]# ps ax|grep mysql 13095 pts/1 S 0:00 /bin/sh ./bin/mysqld_safe 13337 pts/1 Sl 0:00 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/data/localhost.localdomain.err --pid-file=/usr/local/mysql/data/localhost.localdomain.pid --socket=/tmp/mysql.sock --port=3306 13355 pts/1 S+ 0:00 grep --color=auto mysql [root@localhost mysql]#
(14) [root@localhost mysql]# bin/mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 11 Server version: 5.5.40-log Source distribution
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.
Reading history-file /root/.mysql_history Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | test | +--------------------+ 4 rows in set (0.00 sec)
mysql> quit Writing history-file /root/.mysql_history Bye [root@localhost mysql]#
(15) [root@localhost mysql]# pwd /usr/local/mysql [root@localhost mysql]# cp -R var/insectawikidb data [root@localhost mysql]# ls data ibdata1 insectawikidb mysql mysql-bin.000003 test ib_logfile0 localhost.localdomain.err mysql-bin.000001 mysql-bin.index mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | insectawikidb | | mysql | | performance_schema | | test | +--------------------+ 5 rows in set (0.00 sec)
: mysql> use insectawikidb; Database changed mysql> show tables; ERROR 1018 (HY000): Can't read dir of './insectawikidb/' (errno: 13) : (16) [root@localhost mysql]# ls data -l 總計 29780 -rw-rw---- 1 mysql mysql 18874368 11月 13 20:40 ibdata1 -rw-rw---- 1 mysql mysql 5242880 11月 13 20:40 ib_logfile0 -rw-rw---- 1 mysql mysql 5242880 11月 13 20:40 ib_logfile1 drwxr-x--x 2 root root 4096 11月 13 20:47 insectawikidb -rw-r----- 1 mysql root 1786 11月 13 20:40 localhost.localdomain.err -rw-rw---- 1 mysql mysql 6 11月 13 20:40 localhost.localdomain.pid drwx------ 2 mysql root 4096 11月 13 20:38 mysql -rw-rw---- 1 mysql mysql 27735 11月 13 20:38 mysql-bin.000001 -rw-rw---- 1 mysql mysql 1070662 11月 13 20:38 mysql-bin.000002 -rw-rw---- 1 mysql mysql 107 11月 13 20:40 mysql-bin.000003 -rw-rw---- 1 mysql mysql 57 11月 13 20:40 mysql-bin.index drwx------ 2 mysql mysql 4096 11月 13 20:38 performance_schema drwxr-xr-x 2 mysql mysql 4096 11月 13 20:12 test [root@localhost mysql]# ps ax|grep mysql 13095 pts/1 S 0:00 /bin/sh ./bin/mysqld_safe 13337 pts/1 Sl 0:00 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/data/localhost.localdomain.err --pid-file=/usr/local/mysql/data/localhost.localdomain.pid --socket=/tmp/mysql.sock --port=3306 13475 pts/1 S+ 0:00 grep --color=auto mysql [root@localhost mysql]# kill -9 13095 13337 [1]+ 已砍掉 ./bin/mysqld_safe [root@localhost mysql]# [root@localhost mysql]# mv data/ibdata1 data/ibdata1.old [root@localhost mysql]# mv data/ib_logfile0 data/ib_logfile0.old [root@localhost mysql]# mv data/ib_logfile1 data/ib_logfile1.old [root@localhost mysql]# ls data -l 總計 29780 -rw-rw---- 1 mysql mysql 18874368 11月 13 20:40 ibdata1.old -rw-rw---- 1 mysql mysql 5242880 11月 13 20:40 ib_logfile0.old -rw-rw---- 1 mysql mysql 5242880 11月 13 20:40 ib_logfile1.old drwxr-x--x 2 root root 4096 11月 13 20:47 insectawikidb -rw-r----- 1 mysql root 1786 11月 13 20:40 localhost.localdomain.err -rw-rw---- 1 mysql mysql 6 11月 13 20:40 localhost.localdomain.pid drwx------ 2 mysql root 4096 11月 13 20:38 mysql -rw-rw---- 1 mysql mysql 27735 11月 13 20:38 mysql-bin.000001 -rw-rw---- 1 mysql mysql 1070662 11月 13 20:38 mysql-bin.000002 -rw-rw---- 1 mysql mysql 107 11月 13 20:40 mysql-bin.000003 -rw-rw---- 1 mysql mysql 57 11月 13 20:40 mysql-bin.index drwx------ 2 mysql mysql 4096 11月 13 20:38 performance_schema drwxr-xr-x 2 mysql mysql 4096 11月 13 20:12 test [root@localhost mysql]#
(17) [root@localhost mysql]# ls var -l|grep ib -rw-rw---- 1 mysql mysql 597688320 11月 13 20:28 ibdata1 -rw-rw---- 1 mysql mysql 5242880 11月 13 20:28 ib_logfile0 -rw-rw---- 1 mysql mysql 5242880 10月 15 19:26 ib_logfile0.old -rw-rw---- 1 mysql mysql 5242880 11月 13 20:27 ib_logfile1 -rw-rw---- 1 mysql mysql 5242880 10月 14 17:13 ib_logfile1.old [root@localhost mysql]# cp var/ib_logfile1 data/ib_logfile1 [root@localhost mysql]# cp var/ib_logfile0 data/ib_logfile0 [root@localhost mysql]# cp var/ibdata1 data/ibdata1 [root@localhost mysql]# ls data -l|grep ib -rw-r----- 1 root root 597688320 11月 13 20:57 ibdata1 -rw-rw---- 1 mysql mysql 18874368 11月 13 20:40 ibdata1.old -rw-r----- 1 root root 5242880 11月 13 20:57 ib_logfile0 -rw-rw---- 1 mysql mysql 5242880 11月 13 20:40 ib_logfile0.old -rw-r----- 1 root root 5242880 11月 13 20:57 ib_logfile1 -rw-rw---- 1 mysql mysql 5242880 11月 13 20:40 ib_logfile1.old [root@localhost mysql]#
(18) [root@localhost mysql]# chown -R mysql . [root@localhost mysql]# chgrp -R mysql . [root@localhost mysql]# ls data -l|grep ib -rw-r----- 1 mysql mysql 597688320 11月 13 20:57 ibdata1 -rw-rw---- 1 mysql mysql 18874368 11月 13 20:40 ibdata1.old -rw-r----- 1 mysql mysql 5242880 11月 13 20:57 ib_logfile0 -rw-rw---- 1 mysql mysql 5242880 11月 13 20:40 ib_logfile0.old -rw-r----- 1 mysql mysql 5242880 11月 13 20:57 ib_logfile1 -rw-rw---- 1 mysql mysql 5242880 11月 13 20:40 ib_logfile1.old [root@localhost mysql]# chmod -R 660 data [root@localhost mysql]# ls data -l|grep ib -rw-rw---- 1 mysql mysql 597688320 11月 13 20:57 ibdata1 -rw-rw---- 1 mysql mysql 18874368 11月 13 20:40 ibdata1.old -rw-rw---- 1 mysql mysql 5242880 11月 13 20:57 ib_logfile0 -rw-rw---- 1 mysql mysql 5242880 11月 13 20:40 ib_logfile0.old -rw-rw---- 1 mysql mysql 5242880 11月 13 20:57 ib_logfile1 -rw-rw---- 1 mysql mysql 5242880 11月 13 20:40 ib_logfile1.old [root@localhost mysql]#
(19) [root@localhost mysql]# ./bin/mysqld_safe & [1] 13526 [root@localhost mysql]# 141113 21:01:38 mysqld_safe Logging to '/usr/local/mysql/data/localhost.localdomain.err'. 141113 21:01:38 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data 141113 21:01:38 mysqld_safe mysqld from pid file /usr/local/mysql/data/localhost.localdomain.pid ended
[1]+ Done ./bin/mysqld_safe [root@localhost mysql]# ps ax|grep mysql 13773 pts/1 S+ 0:00 grep --color=auto mysql [root@localhost mysql]# reboot
(20)
[root@localhost ~]# ps ax|grep mysql 1323 ? Ss 0:00 /bin/sh /usr/bin/mysqld_safe --basedir=/usr 1595 ? Sl 0:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --log-error=/var/lib/mysql/localhost.localdomain.err --pid-file=localhost.localdomain.pid --socket=/tmp/mysql.sock --port=3306 1656 pts/0 S+ 0:00 grep --color=auto mysql [root@localhost ~]# mysql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) [root@localhost ~]# kill -9 1323 1595 [root@localhost ~]# cat /etc/rc.d/rc.local #!/bin/bash ntpdate watch.stdtime.gov.tw /usr/local/apache2/bin/apachectl start cd /usr/local/mysql ; /usr/local/mysql/bin/mysqld_safe & [root@localhost ~]#
(21) [root@localhost mysql]# ./bin/mysqld_safe & [1] 1717 [root@localhost mysql]# 141113 21:08:32 mysqld_safe Logging to '/usr/local/mysql/data/localhost.localdomain.err'. 141113 21:08:32 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data 141113 21:08:32 mysqld_safe mysqld from pid file /usr/local/mysql/data/localhost.localdomain.pid ended
[1]+ Done ./bin/mysqld_safe [root@localhost mysql]# ps ax|grep mysql 1964 pts/0 S+ 0:00 grep --color=auto mysql [root@localhost mysql]#
(22) 141113 21:08:32 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data /usr/local/mysql/bin/mysqld: File './mysql-bin.index' not found (Errcode: 13) 141113 21:08:32 [ERROR] Aborting
141113 21:08:32 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete
141113 21:08:32 mysqld_safe mysqld from pid file /usr/local/mysql/data/localhost.localdomain.pid ended [root@localhost mysql]# cat /usr/local/mysql/data/localhost.localdomain.err
(23) [root@localhost mysql]# ls /usr/local/mysql/data -l|grep mysql-bin -rw-rw---- 1 mysql mysql 27735 11月 13 20:38 mysql-bin.000001 -rw-rw---- 1 mysql mysql 1070662 11月 13 20:38 mysql-bin.000002 -rw-rw---- 1 mysql mysql 107 11月 13 20:40 mysql-bin.000003 -rw-rw---- 1 mysql mysql 57 11月 13 20:40 mysql-bin.index [root@localhost mysql]# ls /usr/local/mysql/var -l|grep mysql-bin -rw-rw---- 1 mysql mysql 15149 10月 14 17:13 mysql-bin.000001 -rw-rw---- 1 mysql mysql 504809 10月 14 17:13 mysql-bin.000002 -rw-rw---- 1 mysql mysql 255 10月 15 16:44 mysql-bin.000003 -rw-rw---- 1 mysql mysql 466 10月 15 19:19 mysql-bin.000004 -rw-rw---- 1 mysql mysql 617 10月 15 19:42 mysql-bin.000005 -rw-rw---- 1 mysql mysql 577 10月 20 13:52 mysql-bin.000006 -rw-rw---- 1 mysql mysql 7689666 10月 21 17:13 mysql-bin.000007 -rw-rw---- 1 mysql mysql 3793 10月 21 17:14 mysql-bin.000008 -rw-rw---- 1 mysql mysql 2958480 10月 21 21:37 mysql-bin.000009 -rw-rw---- 1 mysql mysql 48919 10月 21 21:47 mysql-bin.000010 -rw-rw---- 1 mysql mysql 569709 10月 21 23:43 mysql-bin.000011 -rw-rw---- 1 mysql mysql 8091009 10月 22 09:56 mysql-bin.000012 -rw-rw---- 1 mysql mysql 2510224 10月 22 12:55 mysql-bin.000013 -rw-rw---- 1 mysql mysql 392408 10月 22 13:10 mysql-bin.000014 -rw-rw---- 1 mysql mysql 311151 10月 22 13:49 mysql-bin.000015 -rw-rw---- 1 mysql mysql 332506 10月 22 13:51 mysql-bin.000016 -rw-rw---- 1 mysql mysql 1675622 10月 22 15:08 mysql-bin.000017 -rw-rw---- 1 mysql mysql 1667662 10月 22 16:10 mysql-bin.000018 -rw-rw---- 1 mysql mysql 149851 10月 22 16:22 mysql-bin.000019 -rw-rw---- 1 mysql mysql 934150 10月 22 17:11 mysql-bin.000020 -rw-rw---- 1 mysql mysql 376014 10月 22 17:13 mysql-bin.000021 -rw-rw---- 1 mysql mysql 656760 10月 22 17:37 mysql-bin.000022 -rw-rw---- 1 mysql mysql 2720934 10月 22 20:09 mysql-bin.000023 -rw-rw---- 1 mysql mysql 31929 10月 22 20:12 mysql-bin.000024 -rw-rw---- 1 mysql mysql 9072962 10月 23 06:27 mysql-bin.000025 -rw-rw---- 1 mysql mysql 780548 10月 23 07:08 mysql-bin.000026 -rw-rw---- 1 mysql mysql 1415859 10月 23 09:16 mysql-bin.000027 -rw-rw---- 1 mysql mysql 2275505 10月 23 10:26 mysql-bin.000028 -rw-rw---- 1 mysql mysql 8962631 10月 23 11:39 mysql-bin.000029 -rw-rw---- 1 mysql mysql 12370740 10月 23 21:46 mysql-bin.000030 -rw-rw---- 1 mysql mysql 1495866 10月 23 23:55 mysql-bin.000031 -rw-rw---- 1 mysql mysql 13430146 10月 24 14:55 mysql-bin.000032 -rw-rw---- 1 mysql mysql 8168771 10月 24 22:07 mysql-bin.000033 -rw-rw---- 1 mysql mysql 2910590 10月 25 01:25 mysql-bin.000034 -rw-rw---- 1 mysql mysql 816181 10月 25 02:26 mysql-bin.000035 -rw-rw---- 1 mysql mysql 6387665 10月 25 11:06 mysql-bin.000036 -rw-rw---- 1 mysql mysql 2241422 10月 25 13:48 mysql-bin.000037 -rw-rw---- 1 mysql mysql 8260636 10月 25 19:26 mysql-bin.000038 -rw-rw---- 1 mysql mysql 11870338 10月 26 12:43 mysql-bin.000039 -rw-rw---- 1 mysql mysql 2960476 10月 26 17:29 mysql-bin.000040 -rw-rw---- 1 mysql mysql 3315707 10月 26 21:50 mysql-bin.000041 -rw-rw---- 1 mysql mysql 788620 10月 27 00:38 mysql-bin.000042 -rw-rw---- 1 mysql mysql 1696343 10月 27 03:28 mysql-bin.000043 -rw-rw---- 1 mysql mysql 4930599 10月 27 13:04 mysql-bin.000044 -rw-rw---- 1 mysql mysql 2564569 10月 27 16:15 mysql-bin.000045 -rw-rw---- 1 mysql mysql 1026534 10月 27 17:34 mysql-bin.000046 -rw-rw---- 1 mysql mysql 3878167 10月 27 23:16 mysql-bin.000047 -rw-rw---- 1 mysql mysql 3270415 10月 28 06:40 mysql-bin.000048 -rw-rw---- 1 mysql mysql 1315788 10月 28 09:15 mysql-bin.000049 -rw-rw---- 1 mysql mysql 3789495 10月 28 13:15 mysql-bin.000050 -rw-rw---- 1 mysql mysql 286155 10月 28 13:18 mysql-bin.000051 -rw-rw---- 1 mysql mysql 3482610 10月 28 19:14 mysql-bin.000052 -rw-rw---- 1 mysql mysql 1531237 10月 28 21:48 mysql-bin.000053 -rw-rw---- 1 mysql mysql 4073697 10月 29 08:03 mysql-bin.000054 -rw-rw---- 1 mysql mysql 6810670 10月 29 18:45 mysql-bin.000055 -rw-rw---- 1 mysql mysql 4373515 10月 30 01:50 mysql-bin.000056 -rw-rw---- 1 mysql mysql 2638043 10月 30 03:52 mysql-bin.000057 -rw-rw---- 1 mysql mysql 9569065 10月 30 06:15 mysql-bin.000058 -rw-rw---- 1 mysql mysql 4871238 10月 30 06:19 mysql-bin.000059 -rw-rw---- 1 mysql mysql 3262853 10月 30 09:04 mysql-bin.000060 -rw-rw---- 1 mysql mysql 229889 10月 30 11:19 mysql-bin.000061 -rw-rw---- 1 mysql mysql 1174930 10月 30 16:10 mysql-bin.000062 -rw-rw---- 1 mysql mysql 598543 10月 30 20:45 mysql-bin.000063 -rw-rw---- 1 mysql mysql 1342985 10月 31 01:01 mysql-bin.000064 -rw-rw---- 1 mysql mysql 359899 10月 31 02:34 mysql-bin.000065 -rw-rw---- 1 mysql mysql 779662 10月 31 06:04 mysql-bin.000066 -rw-rw---- 1 mysql mysql 3024680 10月 31 14:53 mysql-bin.000067 -rw-rw---- 1 mysql mysql 1934678 10月 31 22:23 mysql-bin.000068 -rw-rw---- 1 mysql mysql 30214 10月 31 22:30 mysql-bin.000069 -rw-rw---- 1 mysql mysql 222530 10月 31 23:45 mysql-bin.000070 -rw-rw---- 1 mysql mysql 1989280 10月 31 23:53 mysql-bin.000071 -rw-rw---- 1 mysql mysql 7853830 11月 2 07:09 mysql-bin.000072 -rw-rw---- 1 mysql mysql 1081679 11月 2 10:47 mysql-bin.000073 -rw-rw---- 1 mysql mysql 1948576 11月 2 21:23 mysql-bin.000074 -rw-rw---- 1 mysql mysql 3582410 11月 3 06:28 mysql-bin.000075 -rw-rw---- 1 mysql mysql 1188949 11月 3 08:26 mysql-bin.000076 -rw-rw---- 1 mysql mysql 1242312 11月 3 11:26 mysql-bin.000077 -rw-rw---- 1 mysql mysql 249579 11月 3 13:11 mysql-bin.000078 -rw-rw---- 1 mysql mysql 1125197 11月 3 16:44 mysql-bin.000079 -rw-rw---- 1 mysql mysql 24606 11月 3 17:13 mysql-bin.000080 -rw-rw---- 1 mysql mysql 4394 11月 3 17:13 mysql-bin.000081 -rw-rw---- 1 mysql mysql 413832 11月 3 20:08 mysql-bin.000082 -rw-rw---- 1 mysql mysql 331484 11月 3 21:45 mysql-bin.000083 -rw-rw---- 1 mysql mysql 708659 11月 4 01:52 mysql-bin.000084 -rw-rw---- 1 mysql mysql 1251619 11月 4 07:57 mysql-bin.000085 -rw-rw---- 1 mysql mysql 1885173 11月 4 18:31 mysql-bin.000086 -rw-rw---- 1 mysql mysql 1068724 11月 5 00:08 mysql-bin.000087 -rw-rw---- 1 mysql mysql 426052 11月 5 02:59 mysql-bin.000088 -rw-rw---- 1 mysql mysql 403227 11月 5 05:14 mysql-bin.000089 -rw-rw---- 1 mysql mysql 4304503 11月 5 12:41 mysql-bin.000090 -rw-rw---- 1 mysql mysql 1753689 11月 5 13:59 mysql-bin.000091 -rw-rw---- 1 mysql mysql 1486545 11月 5 16:37 mysql-bin.000092 -rw-rw---- 1 mysql mysql 550683 11月 5 19:27 mysql-bin.000093 -rw-rw---- 1 mysql mysql 147883 11月 5 19:47 mysql-bin.000094 -rw-rw---- 1 mysql mysql 632866 11月 6 00:26 mysql-bin.000095 -rw-rw---- 1 mysql mysql 331177 11月 6 01:31 mysql-bin.000096 -rw-rw---- 1 mysql mysql 3565041 11月 6 11:12 mysql-bin.000097 -rw-rw---- 1 mysql mysql 92944 11月 6 11:24 mysql-bin.000098 -rw-rw---- 1 mysql mysql 370997 11月 6 13:25 mysql-bin.000099 -rw-rw---- 1 mysql mysql 4671691 11月 6 18:36 mysql-bin.000100 -rw-rw---- 1 mysql mysql 571578 11月 6 20:50 mysql-bin.000101 -rw-rw---- 1 mysql mysql 320695 11月 6 22:55 mysql-bin.000102 -rw-rw---- 1 mysql mysql 242085 11月 7 00:59 mysql-bin.000103 -rw-rw---- 1 mysql mysql 265035 11月 7 03:26 mysql-bin.000104 -rw-rw---- 1 mysql mysql 427020 11月 7 06:38 mysql-bin.000105 -rw-rw---- 1 mysql mysql 445159 11月 7 10:47 mysql-bin.000106 -rw-rw---- 1 mysql mysql 451880 11月 7 14:55 mysql-bin.000107 -rw-rw---- 1 mysql mysql 482514 11月 7 18:42 mysql-bin.000108 -rw-rw---- 1 mysql mysql 33389 11月 7 18:47 mysql-bin.000109 -rw-rw---- 1 mysql mysql 127545 11月 7 20:08 mysql-bin.000110 -rw-rw---- 1 mysql mysql 1727327 11月 8 20:55 mysql-bin.000111 -rw-rw---- 1 mysql mysql 1104893 11月 9 16:06 mysql-bin.000112 -rw-rw---- 1 mysql mysql 1451751 11月 9 18:43 mysql-bin.000113 -rw-rw---- 1 mysql mysql 1389094 11月 10 08:19 mysql-bin.000114 -rw-rw---- 1 mysql mysql 328357 11月 10 09:48 mysql-bin.000115 -rw-rw---- 1 mysql mysql 1416389 11月 11 07:37 mysql-bin.000116 -rw-rw---- 1 mysql mysql 447198 11月 11 17:38 mysql-bin.000117 -rw-rw---- 1 mysql mysql 498021 11月 11 20:06 mysql-bin.000118 -rw-rw---- 1 mysql mysql 207504 11月 11 20:42 mysql-bin.000119 -rw-rw---- 1 mysql mysql 488755 11月 11 22:44 mysql-bin.000120 -rw-rw---- 1 mysql mysql 1490349 11月 12 13:39 mysql-bin.000121 -rw-rw---- 1 mysql mysql 1046897 11月 13 11:08 mysql-bin.000122 -rw-rw---- 1 mysql mysql 424689 11月 13 19:32 mysql-bin.000123 -rw-rw---- 1 mysql mysql 26800 11月 13 19:35 mysql-bin.000124 -rw-rw---- 1 mysql mysql 140990 11月 13 20:24 mysql-bin.000125 -rw-rw---- 1 mysql mysql 6541 11月 13 20:28 mysql-bin.000126 -rw-rw---- 1 mysql mysql 2394 11月 13 20:24 mysql-bin.index [root@localhost mysql]#
(24) [root@localhost mysql]# cp /usr/local/mysql/data/mysql-bin.index bin [root@localhost mysql]# ls /usr/local/mysql/bin -l|grep index -rw-r----- 1 root root 57 11月 14 07:01 mysql-bin.index [root@localhost mysql]# [root@localhost mysql]# chmod 660 bin/mysql-bin.index [root@localhost mysql]# stat /usr/local/mysql/data/mysql-bin.index File: ‘/usr/local/mysql/data/mysql-bin.index’ Size: 57 Blocks: 8 IO Block: 4096 普通檔案 Device: fd01h/64769d Inode: 1590745 Links: 1 Access: (0660/-rw-rw----) Uid: ( 1001/ mysql) Gid: ( 1001/ mysql) Access: 2014-11-14 07:01:07.175913193 +0800 Modify: 2014-11-13 20:40:44.615146800 +0800 Change: 2014-11-13 21:00:28.134059843 +0800 Birth: - [root@localhost mysql]# stat /usr/local/mysql/var/mysql-bin.index File: ‘/usr/local/mysql/var/mysql-bin.index’ Size: 2394 Blocks: 8 IO Block: 4096 普通檔案 Device: fd01h/64769d Inode: 1583850 Links: 1 Access: (0660/-rw-rw----) Uid: ( 1001/ mysql) Gid: ( 1001/ mysql) Access: 2014-11-13 20:21:13.731232828 +0800 Modify: 2014-11-13 20:24:42.062217521 +0800 Change: 2014-11-13 20:59:38.915063460 +0800 Birth: - [root@localhost mysql]#
(25) [root@localhost data]# cp ../var/mysql-bin.* .
(26) [root@localhost mysql]# cat /etc/selinux/config
# This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=disabled # SELINUXTYPE= can take one of these two values: # targeted - Targeted processes are protected, # minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection. SELINUXTYPE=targeted
[root@localhost mysql]#
(27)
[root@localhost mysql]# chown -R mysql.mysql /usr/local/mysql [root@localhost mysql]# /usr/local/mysql/bin/mysqld_safe & [1] 3210 [root@localhost mysql]# 141114 07:22:04 mysqld_safe Logging to '/usr/local/mysql/data/localhost.localdomain.err'. 141114 07:22:04 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data 141114 07:22:04 mysqld_safe mysqld from pid file /usr/local/mysql/data/localhost.localdomain.pid ended
[1]+ Done /usr/local/mysql/bin/mysqld_safe [root@localhost mysql]#
(28)
[root@localhost mysql]# ps ax|grep mysql 4593 pts/0 S 0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --user=root 4881 pts/0 Sl 0:00 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=root --log-error=/usr/local/mysql/data/localhost.localdomain.err --pid-file=/usr/local/mysql/data/localhost.localdomain.pid --socket=/tmp/mysql.sock --port=3306 4900 pts/0 S+ 0:00 grep --color=auto mysql [root@localhost mysql]#
(29) [root@localhost mysql]# chmod 777 /usr/local/apache2/htdocs/moodle/config.php [root@localhost mysql]# ./bin/mysqladmin -u root password '??????' [root@localhost mysql]# mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) [root@localhost mysql]# mysql -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 56 to server version: 5.5.40-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> quit Bye [root@localhost mysql]# |