mysql-5.7.9 在centos6.6上面源码编译安装记录 weir 2015-05-25 11:14:26.0 mysql 5258 首先要准备编译的依赖安装: yum -y install make gcc-c++ cmake bison-devel ncurses-devel 除了这些还有一个重要的Boost库。这个是mysql5.7必须要的,而且还必须是boost_1_57_0.tar.gz这个版本,是不是很变态。 下载这个文件随便解压一个位置就行了。(现在的正式版5.7.9需要boost_1_59) 新建mysql用户、组及目录: # groupadd mysql ---新建一个msyql组 # useradd -r -g mysql mysql ---新建msyql用户禁止登录shell # mkdir /usr/local/mysql ---创建目录 # mkdir /usr/local/mysql/data ---数据仓库目录 这些命令就不解释了,你自己随意都可以。 mysql-5.7.7-rc/mysql-test/lib/My/CoreDump.pm mysql-5.7.7-rc/mysql-test/lib/mtr_io.pl mysql-5.7.7-rc/mysql-test/lib/mtr_misc.pl mysql-5.7.7-rc/mysql-test/lib/mtr_gcov.pl [root@w1 w1]# groupadd mysql [root@w1 w1]# useradd -r g mysql mysql Usage: useradd [options] LOGIN Options: -b, --base-dir BASE_DIR base directory for the home directory of the new account -c, --comment COMMENT GECOS field of the new account -d, --home-dir HOME_DIR home directory of the new account -D, --defaults print or change default useradd configuration -e, --expiredate EXPIRE_DATE expiration date of the new account -f, --inactive INACTIVE password inactivity period of the new account -g, --gid GROUP name or ID of the primary group of the new account -G, --groups GROUPS list of supplementary groups of the new account -h, --help display this help message and exit -k, --skel SKEL_DIR use this alternative skeleton directory -K, --key KEY=VALUE override /etc/login.defs defaults -l, --no-log-init do not add the user to the lastlog and faillog databases -m, --create-home create the user's home directory -M, --no-create-home do not create the user's home directory -N, --no-user-group do not create a group with the same name as the user -o, --non-unique allow to create users with duplicate (non-unique) UID -p, --password PASSWORD encrypted password of the new account -r, --system create a system account -s, --shell SHELL login shell of the new account -u, --uid UID user ID of the new account -U, --user-group create a group with the same name as the user -Z, --selinux-user SEUSER use a specific SEUSER for the SELinux user mapping [root@w1 w1]# useradd -r -g mysql mysql [root@w1 w1]# mkdir /root/w1/mysql [root@w1 w1]# mkdir /root/w1/mysql/data [root@w1 w1]# 编译安装mysql: 解压下载好的源码并进入目录: 执行命令: cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data/ -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_PERFSCHEMA_STORAGE_ENGINE=1 -DWITH_BOOST=/root/w1/boost_1_57_0 不出什么问题就可以 make && make install 了,漫长的等待。。。。。。 完了之后就是设置权限和初始化授权: 请尝试执行"chown --help"来获取更多信息。 [root@w1 local]# chown -R mysql:mysql mysql/ [root@w1 local]# chown -R 777 mysql/ [root@w1 local]# cd mysql/ [root@w1 mysql]# ll 总用量 164 drwxr-xr-x. 2 777 mysql 4096 5月 25 18:17 bin -rw-r--r--. 1 777 mysql 17987 3月 30 20:16 COPYING drwxr-xr-x. 2 777 mysql 4096 5月 25 18:14 docs drwxr-xr-x. 3 777 mysql 4096 5月 25 18:14 include -rw-r--r--. 1 777 mysql 104452 3月 30 20:16 INSTALL-BINARY drwxr-xr-x. 3 777 mysql 4096 5月 25 18:15 lib drwxr-xr-x. 4 777 mysql 4096 5月 25 18:15 man drwxr-xr-x. 10 777 mysql 4096 5月 25 18:19 mysql-test -rw-r--r--. 1 777 mysql 2478 3月 30 20:16 README drwxr-xr-x. 28 777 mysql 4096 5月 25 18:19 share drwxr-xr-x. 4 777 mysql 4096 5月 25 18:19 sql-bench drwxr-xr-x. 2 777 mysql 4096 5月 25 18:19 support-files [root@w1 mysql]# bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data 2015-05-25T10:29:20.306539Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2015-05-25T10:29:21.123860Z 0 [Warning] InnoDB: New log files created, LSN=45790 2015-05-25T10:29:21.391832Z 0 [Warning] InnoDB: Creating foreign key constraint system tables. 2015-05-25T10:29:21.670313Z 0 [Warning] Failed to setup SSL 2015-05-25T10:29:21.670361Z 0 [Warning] SSL error: SSL context is not usable without certificate and private key 2015-05-25T10:29:21.677484Z 1 [Warning] A temporary password is generated for root@localhost: !n;h89/4S)=i 记住最后这个密码:!n;h89/4S)=i 配置自动启动mysql“ [root@w1 mysql]# mv /etc/my.cnf my.cnf.bak [root@w1 mysql]# cd support-files/ [root@w1 support-files]# ll 总用量 28 -rw-r--r--. 1 777 mysql 773 3月 30 20:16 magic -rw-r--r--. 1 777 mysql 1126 5月 25 17:01 my-default.cnf -rwxr-xr-x. 1 777 mysql 1061 5月 25 17:01 mysqld_multi.server -rwxr-xr-x. 1 777 mysql 894 5月 25 17:01 mysql-log-rotate -rwxr-xr-x. 1 777 mysql 10975 5月 25 17:01 mysql.server [root@w1 support-files]# cp my-default.cnf /etc/my.cnf [root@w1 support-files]# cd . [root@w1 support-files]# cd .. [root@w1 mysql]# ll 总用量 172 drwxr-xr-x. 2 777 mysql 4096 5月 25 18:17 bin -rw-r--r--. 1 777 mysql 17987 3月 30 20:16 COPYING drwxr-x---. 5 mysql mysql 4096 5月 25 18:29 data drwxr-xr-x. 2 777 mysql 4096 5月 25 18:14 docs drwxr-xr-x. 3 777 mysql 4096 5月 25 18:14 include -rw-r--r--. 1 777 mysql 104452 3月 30 20:16 INSTALL-BINARY drwxr-xr-x. 3 777 mysql 4096 5月 25 18:15 lib drwxr-xr-x. 4 777 mysql 4096 5月 25 18:15 man -rw-r--r--. 1 root root 251 2月 13 2014 my.cnf.bak drwxr-xr-x. 10 777 mysql 4096 5月 25 18:19 mysql-test -rw-r--r--. 1 777 mysql 2478 3月 30 20:16 README drwxr-xr-x. 28 777 mysql 4096 5月 25 18:19 share drwxr-xr-x. 4 777 mysql 4096 5月 25 18:19 sql-bench drwxr-xr-x. 2 777 mysql 4096 5月 25 18:19 support-files [root@w1 mysql]# bin bin/ bind [root@w1 mysql]# bin/mysqld mysqld mysqld_multi mysqld_safe mysqldump mysqldumpslow [root@w1 mysql]# bin/mysqld mysqld mysqld_multi mysqld_safe mysqldump mysqldumpslow [root@w1 mysql]# bin/mysqld_safe --user=mysql& [1] 20568 [root@w1 mysql]# 150525 18:34:40 mysqld_safe Logging to '/usr/local/mysql/data/w1.err'. 150525 18:34:40 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data [root@w1 mysql]# cp support-files/mysql.server /etc/in init/ init.d/ inittab inputrc [root@w1 mysql]# cp support-files/mysql.server /etc/init.d/mysql [root@w1 mysql]# chmod 755 /etc/init.d/mysql [root@w1 mysql]# chkconfig --add mysql [root@w1 mysql]# chkconfig --level 345 mysql on [root@w1 mysql]# source /etc/profile [root@w1 mysql]# service mysql start # mv /etc/my.cnf my.cnf.bak ---将默认生成my.cnf改名或删除否则启动服务会报错 # cd /usr/local/mysql/support-files ---进入MySQL安装目录支持文件目录 # cp my-default.cnf /etc/my.cnf ---复制模板为新的配置文件,根据需要修改文件中配置选项如不修改配置MySQL则按默认配置参数运行。 # /usr/local/mysql/bin/mysqld_safe --user=mysql & ---后台启动mysql # cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql ---复制启动文件 # chmod 755 /etc/init.d/mysql ---增加执行权限 # chkconfig --add mysql ---加入自动启动项 # chkconfig --level 345 mysql on ---设置MySQL在345等级自动启动 # vi /etc/profile ---编辑/etc/profile文件在最后添加如下两行 PATH=/usr/local/mysql/bin:$PATH export PATH # source /etc/profile ---使环境变量及时生效 # mysql -u root -h 127.0.0.1 -p ---连接mysql,输入初始化时生成的随机密码 mysql> alter user 'root'@'localhost' identified by '123456'; ---修改root新密码 mysql>quit; ---退出也可用exit; # myslq -u root -p ---重新登录时输入新的密码回车 mysql>use mysql; ---访问数据库mysql # cd /usr/local/mysql/bin ---切换目录 # mysql_ssl_rsa_setup --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data ---创建新的SSL文件 最难的还是编译mysql 会出现很多错误。 下面是所有命令操作: -- Installing: /usr/local/mysql/mysql-test/./std_data/bug36055.frm -- Installing: /usr/local/mysql/mysql-test/./std_data/wl6219_55_innodb.frm -- Installing: /usr/local/mysql/mysql-test/./std_data/bug48449.frm -- Installing: /usr/local/mysql/mysql-test/./std_data/wl5766_data.txt -- Installing: /usr/local/mysql/mysql-test/./std_data/Europe -- Installing: /usr/local/mysql/mysql-test/./std_data/Europe/London -- Installing: /usr/local/mysql/mysql-test/./std_data/Europe/Paris -- Installing: /usr/local/mysql/mysql-test/./std_data/Europe/Berlin -- Installing: /usr/local/mysql/mysql-test/./std_data/cacert.pem -- Installing: /usr/local/mysql/mysql-test/./std_data/server-cert-sha512.pem -- Installing: /usr/local/mysql/mysql-test/./std_data/onerow.xml -- Installing: /usr/local/mysql/mysql-test/./std_data/bug47012.ARM -- Installing: /usr/local/mysql/mysql-test/./std_data/loaddata_utf8.dat -- Installing: /usr/local/mysql/mysql-test/./std_data/loaddata6.dat -- Installing: /usr/local/mysql/mysql-test/./std_data/server-cert.pem -- Installing: /usr/local/mysql/mysql-test/./std_data/bug47012.ARZ -- Installing: /usr/local/mysql/mysql-test/./std_data/corrupt_t1.MYI -- Installing: /usr/local/mysql/mysql-test/./std_data/system_tap.stp -- Installing: /usr/local/mysql/mysql-test/./std_data/cat_file.txt -- Installing: /usr/local/mysql/mysql-test/./std_data/latin1.xml -- Installing: /usr/local/mysql/mysql-test/./std_data/Factory -- Installing: /usr/local/mysql/mysql-test/./std_data/crl-client-revoked-cert.pem -- Installing: /usr/local/mysql/mysql-test/./std_data/parts -- Installing: /usr/local/mysql/mysql-test/./std_data/parts/t1TIMESTAMP.frm -- Installing: /usr/local/mysql/mysql-test/./std_data/parts/t1_will_crash#P#p1_first_1024.MYD -- Installing: /usr/local/mysql/mysql-test/./std_data/parts/t1_will_crash#P#p3.MYI -- Installing: /usr/local/mysql/mysql-test/./std_data/parts/part_supported_sql_funcs_int_time.inc -- Installing: /usr/local/mysql/mysql-test/./std_data/parts/t1_blackhole.frm -- Installing: /usr/local/mysql/mysql-test/./std_data/parts/t1_will_crash#P#p6_3.MYD -- Installing: /usr/local/mysql/mysql-test/./std_data/parts/part_supported_sql_funcs_int_date.inc -- Installing: /usr/local/mysql/mysql-test/./std_data/parts/t1_will_crash#P#p2.MYI -- Installing: /usr/local/mysql/mysql-test/./std_data/parts/t1_will_crash#P#p4.MYI -- Installing: /usr/local/mysql/mysql-test/./std_data/parts/part_supported_sql_funcs_int_ch1.inc -- Installing: /usr/local/mysql/mysql-test/./std_data/parts/t1_blackhole.par -- Installing: /usr/local/mysql/mysql-test/./std_data/parts/t1_will_crash#P#p2.MYD -- Installing: /usr/local/mysql/mysql-test/./std_data/parts/t1_will_crash#P#p6.MYD -- Installing: /usr/local/mysql/mysql-test/./std_data/parts/t1_will_crash#P#p6_2.MYD -- Installing: /usr/local/mysql/mysql-test/./std_data/parts/part_supported_sql_funcs_int_float.inc -- Installing: /usr/local/mysql/mysql-test/./std_data/parts/part_supported_sql_funcs_int_int.inc -- Installing: /usr/local/mysql/mysql-test/./std_data/parts/t1.frm -- Installing: /usr/local/mysql/mysql-test/./std_data/words.dat -- Installing: /usr/local/mysql/mysql-test/./std_data/bug40482-bin.000001 -- Installing: /usr/local/mysql/mysql-test/./std_data/rpl_loaddata2.dat -- Installing: /usr/local/mysql/mysql-test/./std_data/crl-server-key.pem -- Installing: /usr/local/mysql/mysql-test/./std_data/binlog_transaction_with_anonymous_GTID.000001 -- Installing: /usr/local/mysql/mysql-test/./std_data/bug30435_5k.txt -- Installing: /usr/local/mysql/mysql-test/./std_data/charset_utf8.txt -- Installing: /usr/local/mysql/mysql-test/./std_data/bug49823.frm -- Installing: /usr/local/mysql/mysql-test/./std_data/dtrace.d -- Installing: /usr/local/mysql/mysql-test/./std_data/funcs_1 -- Installing: /usr/local/mysql/mysql-test/./std_data/funcs_1/t3.txt -- Installing: /usr/local/mysql/mysql-test/./std_data/funcs_1/innodb_tb4.txt -- Installing: /usr/local/mysql/mysql-test/./std_data/funcs_1/load_file.txt -- Installing: /usr/local/mysql/mysql-test/./std_data/funcs_1/t7.txt -- Installing: /usr/local/mysql/mysql-test/./std_data/funcs_1/memory_tb1.txt -- Installing: /usr/local/mysql/mysql-test/./std_data/funcs_1/ndb_tb3.txt -- Installing: /usr/local/mysql/mysql-test/./std_data/funcs_1/t4.txt -- Installing: /usr/local/mysql/mysql-test/./std_data/funcs_1/t9.txt -- Installing: /usr/local/mysql/mysql-test/./std_data/funcs_1/memory_tb3.txt -- Installing: /usr/local/mysql/mysql-test/./std_data/funcs_1/myisam_tb1.txt -- Installing: /usr/local/mysql/mysql-test/./std_data/funcs_1/myisam_tb2.txt -- Installing: /usr/local/mysql/mysql-test/./std_data/funcs_1/innodb_tb3.txt -- Installing: /usr/local/mysql/mysql-test/./std_data/funcs_1/innodb_tb2.txt -- Installing: /usr/local/mysql/mysql-test/./std_data/funcs_1/ndb_tb2.txt -- Installing: /usr/local/mysql/mysql-test/./std_data/funcs_1/innodb_tb1.txt -- Installing: /usr/local/mysql/mysql-test/./std_data/funcs_1/ndb_tb1.txt -- Installing: /usr/local/mysql/mysql-test/./std_data/funcs_1/ndb_tb4.txt -- Installing: /usr/local/mysql/mysql-test/./std_data/funcs_1/memory_tb2.txt -- Installing: /usr/local/mysql/mysql-test/./std_data/funcs_1/memory_tb4.txt -- Installing: /usr/local/mysql/mysql-test/./std_data/funcs_1/myisam_tb3.txt -- Installing: /usr/local/mysql/mysql-test/./std_data/funcs_1/myisam_tb4.txt -- Installing: /usr/local/mysql/mysql-test/./std_data/mylogin-bad-cipher.cnf -- Installing: /usr/local/mysql/mysql-test/./std_data/bug47205.frm -- Installing: /usr/local/mysql/mysql-test/./std_data/binlog_transaction.000001 -- Installing: /usr/local/mysql/mysql-test/./std_data/client-cert.pem -- Installing: /usr/local/mysql/mysql-test/./std_data/vchar.frm -- Installing: /usr/local/mysql/mysql-test/./std_data/trunc_binlog.000001 -- Installing: /usr/local/mysql/mysql-test/./std_data/bug49823.CSV -- Installing: /usr/local/mysql/mysql-test/./std_data/bug17532932.MYD -- Installing: /usr/local/mysql/mysql-test/./std_data/rpl_mixed.dat -- Installing: /usr/local/mysql/mysql-test/./std_data/bug48265.frm -- Installing: /usr/local/mysql/mysql-test/./std_data/old_table-323.frm -- Installing: /usr/local/mysql/mysql-test/./std_data/wl7957_1.MYD -- Installing: /usr/local/mysql/mysql-test/./std_data/loaddata2.dat -- Installing: /usr/local/mysql/mysql-test/./std_data/bug48633.frm -- Installing: /usr/local/mysql/mysql-test/./std_data/loaddata4.dat -- Installing: /usr/local/mysql/mysql-test/./std_data/bug17532932.frm -- Installing: /usr/local/mysql/mysql-test/./std_data/bad_gis_data.dat -- Installing: /usr/local/mysql/mysql-test/./std_data/bug19371.MYD -- Installing: /usr/local/mysql/mysql-test/./std_data/cluster_7022_table.MYD -- Installing: /usr/local/mysql/mysql-test/./std_data/wl6030_2.dat -- Installing: /usr/local/mysql/mysql-test/./Makefile -- Installing: /usr/local/mysql/mysql-test/./collections -- Installing: /usr/local/mysql/mysql-test/./collections/default.release.done -- Installing: /usr/local/mysql/mysql-test/./collections/default.daily-valgrind -- Installing: /usr/local/mysql/mysql-test/./collections/README -- Installing: /usr/local/mysql/mysql-test/./collections/disabled-gtid-on.list -- Installing: /usr/local/mysql/mysql-test/./collections/disabled-weekly.list -- Installing: /usr/local/mysql/mysql-test/./collections/default.release -- Installing: /usr/local/mysql/mysql-test/./collections/mysql-trunk-stage.push -- Installing: /usr/local/mysql/mysql-test/./collections/default.push-valgrind -- Installing: /usr/local/mysql/mysql-test/./collections/README.experimental -- Installing: /usr/local/mysql/mysql-test/./collections/disabled-daily.list -- Installing: /usr/local/mysql/mysql-test/./collections/default.push-ndbcluster -- Installing: /usr/local/mysql/mysql-test/./collections/default.weekly-valgrind -- Installing: /usr/local/mysql/mysql-test/./collections/default.experimental -- Installing: /usr/local/mysql/mysql-test/./collections/default.weekly-ndbcluster -- Installing: /usr/local/mysql/mysql-test/./collections/default.daily -- Installing: /usr/local/mysql/mysql-test/./collections/mysql-trunk-protocol.weekly -- Installing: /usr/local/mysql/mysql-test/./collections/default.weekly -- Installing: /usr/local/mysql/mysql-test/./collections/default.weekly.basic -- Installing: /usr/local/mysql/mysql-test/./collections/disabled-per-push.list -- Installing: /usr/local/mysql/mysql-test/./collections/default.push -- Installing: /usr/local/mysql/mysql-test/./cmake_install.cmake -- Up-to-date: /usr/local/mysql/mysql-test/mtr -- Up-to-date: /usr/local/mysql/mysql-test/mysql-test-run -- Installing: /usr/local/mysql/mysql-test/lib/My/SafeProcess/my_safe_process -- Up-to-date: /usr/local/mysql/mysql-test/lib/My/SafeProcess/my_safe_process -- Installing: /usr/local/mysql/mysql-test/lib/My/SafeProcess/Base.pm -- Installing: /usr/local/mysql/support-files/my-default.cnf -- Installing: /usr/local/mysql/support-files/mysqld_multi.server -- Installing: /usr/local/mysql/support-files/mysql-log-rotate -- Installing: /usr/local/mysql/support-files/magic -- Installing: /usr/local/mysql/share/aclocal/mysql.m4 -- Installing: /usr/local/mysql/support-files/mysql.server -- Installing: /usr/local/mysql/sql-bench/Data/ATIS -- Installing: /usr/local/mysql/sql-bench/Data/ATIS/fconnection.txt -- Installing: /usr/local/mysql/sql-bench/Data/ATIS/transport.txt -- Installing: /usr/local/mysql/sql-bench/Data/ATIS/airport_service.txt -- Installing: /usr/local/mysql/sql-bench/Data/ATIS/food_service.txt -- Installing: /usr/local/mysql/sql-bench/Data/ATIS/compound_class.txt -- Installing: /usr/local/mysql/sql-bench/Data/ATIS/stop.txt -- Installing: /usr/local/mysql/sql-bench/Data/ATIS/time_zone.txt -- Installing: /usr/local/mysql/sql-bench/Data/ATIS/connect_leg.txt -- Installing: /usr/local/mysql/sql-bench/Data/ATIS/aircraft.txt -- Installing: /usr/local/mysql/sql-bench/Data/ATIS/flight_day.txt -- Installing: /usr/local/mysql/sql-bench/Data/ATIS/flight.txt -- Installing: /usr/local/mysql/sql-bench/Data/ATIS/class_of_service.txt -- Installing: /usr/local/mysql/sql-bench/Data/ATIS/restriction.txt -- Installing: /usr/local/mysql/sql-bench/Data/ATIS/airline.txt -- Installing: /usr/local/mysql/sql-bench/Data/ATIS/airport.txt -- Installing: /usr/local/mysql/sql-bench/Data/ATIS/city.txt -- Installing: /usr/local/mysql/sql-bench/Data/ATIS/day_name.txt -- Installing: /usr/local/mysql/sql-bench/Data/ATIS/ground_service.txt -- Installing: /usr/local/mysql/sql-bench/Data/ATIS/dual_carrier.txt -- Installing: /usr/local/mysql/sql-bench/Data/ATIS/month_name.txt -- Installing: /usr/local/mysql/sql-bench/Data/ATIS/time_interval.txt -- Installing: /usr/local/mysql/sql-bench/Data/ATIS/stop1.txt -- Installing: /usr/local/mysql/sql-bench/Data/ATIS/code_description.txt -- Installing: /usr/local/mysql/sql-bench/Data/ATIS/flight_fare.txt -- Installing: /usr/local/mysql/sql-bench/Data/ATIS/fare.txt -- Installing: /usr/local/mysql/sql-bench/Data/ATIS/restrict_carrier.txt -- Installing: /usr/local/mysql/sql-bench/Data/ATIS/flight_class.txt -- Installing: /usr/local/mysql/sql-bench/Data/ATIS/state.txt -- Installing: /usr/local/mysql/sql-bench/Data/ATIS/date_day.txt -- Installing: /usr/local/mysql/sql-bench/Data/ATIS/restrict_class.txt -- Installing: /usr/local/mysql/sql-bench/Data/Wisconsin -- Installing: /usr/local/mysql/sql-bench/Data/Wisconsin/onek.data -- Installing: /usr/local/mysql/sql-bench/Data/Wisconsin/tenk.data -- Installing: /usr/local/mysql/sql-bench/limits -- Installing: /usr/local/mysql/sql-bench/limits/empress.cfg -- Installing: /usr/local/mysql/sql-bench/limits/db2.cfg -- Installing: /usr/local/mysql/sql-bench/limits/oracle.cfg -- Installing: /usr/local/mysql/sql-bench/limits/interbase-superserver.cfg -- Installing: /usr/local/mysql/sql-bench/limits/Adabas.cfg -- Installing: /usr/local/mysql/sql-bench/limits/access.cfg -- Installing: /usr/local/mysql/sql-bench/limits/msql.cfg -- Installing: /usr/local/mysql/sql-bench/limits/access_odbc.cfg -- Installing: /usr/local/mysql/sql-bench/limits/frontbase.cfg -- Installing: /usr/local/mysql/sql-bench/limits/mysql-3.22.cfg -- Installing: /usr/local/mysql/sql-bench/limits/mysql.cfg -- Installing: /usr/local/mysql/sql-bench/limits/Informix.cfg -- Installing: /usr/local/mysql/sql-bench/limits/mysql-4.0.cfg -- Installing: /usr/local/mysql/sql-bench/limits/sybase.cfg -- Installing: /usr/local/mysql/sql-bench/limits/mysql-3.23.cfg -- Installing: /usr/local/mysql/sql-bench/limits/interbase.cfg -- Installing: /usr/local/mysql/sql-bench/limits/mysql-4.1.cfg -- Installing: /usr/local/mysql/sql-bench/limits/ms-sql.cfg -- Installing: /usr/local/mysql/sql-bench/limits/ms-sql65.cfg -- Installing: /usr/local/mysql/sql-bench/limits/solid-nt4.cfg -- Installing: /usr/local/mysql/sql-bench/limits/interbase-dialect1.cfg -- Installing: /usr/local/mysql/sql-bench/limits/pg.cfg -- Installing: /usr/local/mysql/sql-bench/limits/interbase-dialect3.cfg -- Installing: /usr/local/mysql/sql-bench/limits/solid.cfg -- Installing: /usr/local/mysql/sql-bench/limits/mimer.cfg -- Installing: /usr/local/mysql/sql-bench/graph-compare-results -- Installing: /usr/local/mysql/sql-bench/crash-me -- Installing: /usr/local/mysql/sql-bench/README -- Installing: /usr/local/mysql/sql-bench/innotest2b -- Installing: /usr/local/mysql/sql-bench/innotest1a -- Installing: /usr/local/mysql/sql-bench/test-ATIS -- Installing: /usr/local/mysql/sql-bench/test-create -- Installing: /usr/local/mysql/sql-bench/test-insert -- Installing: /usr/local/mysql/sql-bench/test-select -- Installing: /usr/local/mysql/sql-bench/test-connect -- Installing: /usr/local/mysql/sql-bench/copy-db -- Installing: /usr/local/mysql/sql-bench/test-big-tables -- Installing: /usr/local/mysql/sql-bench/run-all-tests -- Installing: /usr/local/mysql/sql-bench/bench-count-distinct -- Installing: /usr/local/mysql/sql-bench/compare-results -- Installing: /usr/local/mysql/sql-bench/innotest2a -- Installing: /usr/local/mysql/sql-bench/test-alter-table -- Installing: /usr/local/mysql/sql-bench/innotest1b -- Installing: /usr/local/mysql/sql-bench/test-wisconsin -- Installing: /usr/local/mysql/sql-bench/test-transactions -- Installing: /usr/local/mysql/sql-bench/innotest2 -- Installing: /usr/local/mysql/sql-bench/server-cfg -- Installing: /usr/local/mysql/sql-bench/bench-init.pl -- Installing: /usr/local/mysql/sql-bench/innotest1 [root@w1 mysql-5.7.7-rc]# cd /usr/l lib/ libexec/ local/ [root@w1 mysql-5.7.7-rc]# cd /usr/l lib/ libexec/ local/ [root@w1 mysql-5.7.7-rc]# cd /usr/local/mysql/ [root@w1 mysql]# ll 总用量 164 drwxr-xr-x. 2 root root 4096 5月 25 18:17 bin -rw-r--r--. 1 root root 17987 3月 30 20:16 COPYING drwxr-xr-x. 2 root root 4096 5月 25 18:14 docs drwxr-xr-x. 3 root root 4096 5月 25 18:14 include -rw-r--r--. 1 root root 104452 3月 30 20:16 INSTALL-BINARY drwxr-xr-x. 3 root root 4096 5月 25 18:15 lib drwxr-xr-x. 4 root root 4096 5月 25 18:15 man drwxr-xr-x. 10 root root 4096 5月 25 18:19 mysql-test -rw-r--r--. 1 root root 2478 3月 30 20:16 README drwxr-xr-x. 28 root root 4096 5月 25 18:19 share drwxr-xr-x. 4 root root 4096 5月 25 18:19 sql-bench drwxr-xr-x. 2 root root 4096 5月 25 18:19 support-files [root@w1 mysql]# chown -R mysql chown: "mysql" 后缺少操作数 请尝试执行"chown --help"来获取更多信息。 [root@w1 mysql]# cd .. [root@w1 local]# ll 总用量 40 drwxr-xr-x. 2 root root 4096 9月 23 2011 bin drwxr-xr-x. 2 root root 4096 9月 23 2011 etc drwxr-xr-x. 2 root root 4096 9月 23 2011 games drwxr-xr-x. 2 root root 4096 9月 23 2011 include drwxr-xr-x. 2 root root 4096 9月 23 2011 lib drwxr-xr-x. 2 root root 4096 9月 23 2011 libexec drwxr-xr-x. 11 root root 4096 5月 25 18:19 mysql drwxr-xr-x. 2 root root 4096 9月 23 2011 sbin drwxr-xr-x. 5 root root 4096 5月 25 05:04 share drwxr-xr-x. 2 root root 4096 9月 23 2011 src [root@w1 local]# cd mysql/ [root@w1 mysql]# chown -R mysql. chown: "mysql." 后缺少操作数 请尝试执行"chown --help"来获取更多信息。 [root@w1 mysql]# chown -R mysql. chown: "mysql." 后缺少操作数 请尝试执行"chown --help"来获取更多信息。 [root@w1 mysql]# chown --help 用法:chown [选项]... [所有者][:[组]] 文件... 或:chown [选项]... --reference=参考文件 文件... 更改每个文件的所有者和/或所属组。 当使用 --referebce 参数时,将文件的所有者和所属组更改为与指定参考文件相同。 -c, --changes 类似 verbose,但只在有更改时才显示结果 --dereference 受影响的是符号链接所指示的对象,而非符号链接本身 -h, --no-dereference 会影响符号链接本身,而非符号链接所指示的目的地 (当系统支持更改符号链接的所有者时,此选项才有用) --from=当前所有者:当前所属组 只当每个文件的所有者和组符合选项所指定时才更改所 有者和组。其中一个可以省略,这时已省略的属性就不 需要符合原有的属性。 --no-preserve-root 不特殊对待"/"(默认值) --preserve-root 不允许在"/"上递归操作 -f, --silent, --quiet 去除大部份的错误信息 --reference=参考文件 使用参考文件的所属组,而非指定值 -R, --recursive 递归处理所有的文件及子目录 -v, --verbose 为处理的所有文件显示诊断信息 以下选项是在指定了 -R 选项时被用于设置如何穿越目录结构体系。 如果您指定了多于一个选项,那么只有最后一个会生效。 -H 如果命令行参数是一个通到目录的符号链接,则遍历符号链接 -L 遍历每一个遇到的通到目录的符号链接 -P 不遍历任何符号链接(默认) --help 显示此帮助信息并退出 --version 显示版本信息并退出 如果没有指定所有者,则不会更改。 所属组若没有指定也不会更改,但当加上 ":"时 GROUP 会更改为指定所有者的主要组。所有者和所属组可以是数字或名称。 示例: chown root /u 将 /u 的属主更改为"root"。 chown root:staff /u 和上面类似,但同时也将其属组更改为"staff"。 chown -hR root /u 将 /u 及其子目录下所有文件的属主更改为"root"。 请向bug-coreutils@gnu.org 报告chown 的错误 GNU coreutils 项目主页: GNU 软件一般性帮助: 请向 报告chown 的翻译错误 要获取完整文档,请运行:info coreutils 'chown invocation' [root@w1 mysql]# cd .. [root@w1 local]# chown -R mysql/ chown: "mysql/" 后缺少操作数 请尝试执行"chown --help"来获取更多信息。 [root@w1 local]# chown -R mysql chown: "mysql" 后缺少操作数 请尝试执行"chown --help"来获取更多信息。 [root@w1 local]# chown -R mysql:mysql mysql/ [root@w1 local]# chown -R 777 mysql/ [root@w1 local]# cd mysql/ [root@w1 mysql]# ll 总用量 164 drwxr-xr-x. 2 777 mysql 4096 5月 25 18:17 bin -rw-r--r--. 1 777 mysql 17987 3月 30 20:16 COPYING drwxr-xr-x. 2 777 mysql 4096 5月 25 18:14 docs drwxr-xr-x. 3 777 mysql 4096 5月 25 18:14 include -rw-r--r--. 1 777 mysql 104452 3月 30 20:16 INSTALL-BINARY drwxr-xr-x. 3 777 mysql 4096 5月 25 18:15 lib drwxr-xr-x. 4 777 mysql 4096 5月 25 18:15 man drwxr-xr-x. 10 777 mysql 4096 5月 25 18:19 mysql-test -rw-r--r--. 1 777 mysql 2478 3月 30 20:16 README drwxr-xr-x. 28 777 mysql 4096 5月 25 18:19 share drwxr-xr-x. 4 777 mysql 4096 5月 25 18:19 sql-bench drwxr-xr-x. 2 777 mysql 4096 5月 25 18:19 support-files [root@w1 mysql]# bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data 2015-05-25T10:29:20.306539Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2015-05-25T10:29:21.123860Z 0 [Warning] InnoDB: New log files created, LSN=45790 2015-05-25T10:29:21.391832Z 0 [Warning] InnoDB: Creating foreign key constraint system tables. 2015-05-25T10:29:21.670313Z 0 [Warning] Failed to setup SSL 2015-05-25T10:29:21.670361Z 0 [Warning] SSL error: SSL context is not usable without certificate and private key 2015-05-25T10:29:21.677484Z 1 [Warning] A temporary password is generated for root@localhost: !n;h89/4S)=i [root@w1 mysql]# mv /etc/my.cnf my.cnf.bak [root@w1 mysql]# cd support-files/ [root@w1 support-files]# ll 总用量 28 -rw-r--r--. 1 777 mysql 773 3月 30 20:16 magic -rw-r--r--. 1 777 mysql 1126 5月 25 17:01 my-default.cnf -rwxr-xr-x. 1 777 mysql 1061 5月 25 17:01 mysqld_multi.server -rwxr-xr-x. 1 777 mysql 894 5月 25 17:01 mysql-log-rotate -rwxr-xr-x. 1 777 mysql 10975 5月 25 17:01 mysql.server [root@w1 support-files]# cp my-default.cnf /etc/my.cnf [root@w1 support-files]# cd . [root@w1 support-files]# cd .. [root@w1 mysql]# ll 总用量 172 drwxr-xr-x. 2 777 mysql 4096 5月 25 18:17 bin -rw-r--r--. 1 777 mysql 17987 3月 30 20:16 COPYING drwxr-x---. 5 mysql mysql 4096 5月 25 18:29 data drwxr-xr-x. 2 777 mysql 4096 5月 25 18:14 docs drwxr-xr-x. 3 777 mysql 4096 5月 25 18:14 include -rw-r--r--. 1 777 mysql 104452 3月 30 20:16 INSTALL-BINARY drwxr-xr-x. 3 777 mysql 4096 5月 25 18:15 lib drwxr-xr-x. 4 777 mysql 4096 5月 25 18:15 man -rw-r--r--. 1 root root 251 2月 13 2014 my.cnf.bak drwxr-xr-x. 10 777 mysql 4096 5月 25 18:19 mysql-test -rw-r--r--. 1 777 mysql 2478 3月 30 20:16 README drwxr-xr-x. 28 777 mysql 4096 5月 25 18:19 share drwxr-xr-x. 4 777 mysql 4096 5月 25 18:19 sql-bench drwxr-xr-x. 2 777 mysql 4096 5月 25 18:19 support-files [root@w1 mysql]# bin bin/ bind [root@w1 mysql]# bin/mysqld mysqld mysqld_multi mysqld_safe mysqldump mysqldumpslow [root@w1 mysql]# bin/mysqld mysqld mysqld_multi mysqld_safe mysqldump mysqldumpslow [root@w1 mysql]# bin/mysqld_safe --user=mysql& [1] 20568 [root@w1 mysql]# 150525 18:34:40 mysqld_safe Logging to '/usr/local/mysql/data/w1.err'. 150525 18:34:40 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data [root@w1 mysql]# cp support-files/mysql.server /etc/in init/ init.d/ inittab inputrc [root@w1 mysql]# cp support-files/mysql.server /etc/init.d/mysql [root@w1 mysql]# chmod 755 /etc/init.d/mysql [root@w1 mysql]# chkconfig --add mysql [root@w1 mysql]# chkconfig --level 345 mysql on [root@w1 mysql]# source /etc/profile [root@w1 mysql]# service mysql start Starting MySQL[确定] [root@w1 mysql]# [root@w1 mysql]# service mysql stop Shutting down MySQL..150525 18:39:35 mysqld_safe mysqld from pid file /usr/local/mysql/data/w1.pid ended [确定] [1]+ Done bin/mysqld_safe --user=mysql [root@w1 mysql]# service mysql start Starting MySQL..[确定] [root@w1 mysql]# mysql -u root -h 127.0.0.1 -p Enter password: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) [root@w1 mysql]# mysql -u root -h 127.0.0.1 -p Enter password: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) [root@w1 mysql]# !n;h89/4S)=i -bash: !n: event not found [root@w1 mysql]# mysql -u root -h 127.0.0.1 -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 4 Server version: 5.7.7-rc Copyright (c) 2000, 2015, 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. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> alter user 'root'@'localhost' identified by '336393'; Query OK, 0 rows affected (0.00 sec) mysql> exit Bye [root@w1 mysql]# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 5 Server version: 5.7.7-rc Source distribution Copyright (c) 2000, 2015, 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. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> use mysql; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> exit; Bye [root@w1 mysql]# ll 总用量 172 drwxr-xr-x. 2 777 mysql 4096 5月 25 18:17 bin -rw-r--r--. 1 777 mysql 17987 3月 30 20:16 COPYING drwxr-x---. 5 mysql mysql 4096 5月 25 18:39 data drwxr-xr-x. 2 777 mysql 4096 5月 25 18:14 docs drwxr-xr-x. 3 777 mysql 4096 5月 25 18:14 include -rw-r--r--. 1 777 mysql 104452 3月 30 20:16 INSTALL-BINARY drwxr-xr-x. 3 777 mysql 4096 5月 25 18:15 lib drwxr-xr-x. 4 777 mysql 4096 5月 25 18:15 man -rw-r--r--. 1 root root 251 2月 13 2014 my.cnf.bak drwxr-xr-x. 10 777 mysql 4096 5月 25 18:19 mysql-test -rw-r--r--. 1 777 mysql 2478 3月 30 20:16 README drwxr-xr-x. 28 777 mysql 4096 5月 25 18:19 share drwxr-xr-x. 4 777 mysql 4096 5月 25 18:19 sql-bench drwxr-xr-x. 2 777 mysql 4096 5月 25 18:19 support-files [root@w1 mysql]# cd bin/ [root@w1 bin]# ll 总用量 897652 -rwxr-xr-x. 1 777 mysql 5372327 5月 25 17:47 innochecksum -rwxr-xr-x. 1 777 mysql 7916273 5月 25 17:06 myisamchk -rwxr-xr-x. 1 777 mysql 7450569 5月 25 17:06 myisam_ftdump -rwxr-xr-x. 1 777 mysql 7312951 5月 25 17:06 myisamlog -rwxr-xr-x. 1 777 mysql 7540855 5月 25 17:06 myisampack -rwxr-xr-x. 1 777 mysql 5110959 5月 25 17:47 my_print_defaults -rwxr-xr-x. 1 777 mysql 9307356 5月 25 17:47 mysql -rwxr-xr-x. 1 777 mysql 8391617 5月 25 17:48 mysqladmin -rwxr-xr-x. 1 777 mysql 10011575 5月 25 17:48 mysqlbinlog -rwxr-xr-x. 1 777 mysql 8607780 5月 25 17:48 mysqlcheck -rwxr-xr-x. 1 777 mysql 9365430 5月 25 17:49 mysql_client_test -rwxr-xr-x. 1 777 mysql 173169158 5月 25 18:11 mysql_client_test_embedded -rwxr-xr-x. 1 777 mysql 6514 5月 25 17:01 mysql_config -rwxr-xr-x. 1 777 mysql 7563554 5月 25 17:47 mysql_config_editor -rwxr-xr-x. 1 777 mysql 199591884 5月 25 17:50 mysqld -rwxr-xr-x. 1 777 mysql 26543 5月 25 17:01 mysqld_multi -rwxr-xr-x. 1 777 mysql 26026 5月 25 17:01 mysqld_safe -rwxr-xr-x. 1 777 mysql 8591742 5月 25 17:48 mysqldump -rwxr-xr-x. 1 777 mysql 7424 5月 25 17:01 mysqldumpslow -rwxr-xr-x. 1 777 mysql 172890036 5月 25 18:11 mysql_embedded -rwxr-xr-x. 1 777 mysql 8383620 5月 25 17:48 mysqlimport -rwxr-xr-x. 1 777 mysql 9170412 5月 25 17:47 mysql_install_db -rwxr-xr-x. 1 777 mysql 5165970 5月 25 17:47 mysql_plugin -rwxr-xr-x. 1 777 mysql 8353337 5月 25 17:47 mysql_secure_installation -rwxr-xr-x. 1 777 mysql 8349155 5月 25 17:48 mysqlshow -rwxr-xr-x. 1 777 mysql 8426154 5月 25 17:48 mysqlslap -rwxr-xr-x. 1 777 mysql 5419959 5月 25 17:47 mysql_ssl_rsa_setup -rwxr-xr-x. 1 777 mysql 9135806 5月 25 17:48 mysqltest -rwxr-xr-x. 1 777 mysql 172613257 5月 25 18:12 mysqltest_embedded -rwxr-xr-x. 1 777 mysql 4750529 5月 25 17:49 mysql_tzinfo_to_sql -rwxr-xr-x. 1 777 mysql 10714549 5月 25 17:48 mysql_upgrade -rwxr-xr-x. 1 777 mysql 5222535 5月 25 17:47 perror -rwxr-xr-x. 1 777 mysql 4932639 5月 25 17:47 replace -rwxr-xr-x. 1 777 mysql 5110956 5月 25 17:47 resolveip -rwxr-xr-x. 1 777 mysql 5117430 5月 25 17:47 resolve_stack_dump [root@w1 bin]# my my-default-printer mysql_client_test_embedded mysql_plugin myisamchk mysql_config mysql_secure_installation myisam_ftdump mysql_config_editor mysqlshow myisamlog mysqld mysqlslap myisampack mysqld_multi mysql_ssl_rsa_setup my_print_defaults mysqld_safe mysqltest mysql mysqldump mysqltest_embedded mysqladmin mysqldumpslow mysql_tzinfo_to_sql mysqlbinlog mysql_embedded mysql_upgrade mysqlcheck mysqlimport mysql_client_test mysql_install_db [root@w1 bin]# mysql_ssl_rsa_setup --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data OpenSSL 1.0.1e-fips 11 Feb 2013 Generating a 2048 bit RSA private key ...................................+++ ......................................+++ writing new private key to 'ca-key.pem' ----- writing RSA key Signature ok subject=/CN=MySQL_Server_5.7.7-rc_Auto_Generated_CA_Certificate Getting Private key Generating a 2048 bit RSA private key .............................................................................................................................................................................................................................................+++ ........................+++ writing new private key to 'server-key.pem' ----- writing RSA key Signature ok subject=/CN=MySQL_Server_5.7.7-rc_Auto_Generated_Server_Certificate Getting CA Private Key Generating a 2048 bit RSA private key ...+++ .....+++ writing new private key to 'client-key.pem' ----- writing RSA key Signature ok subject=/CN=MySQL_Server_5.7.7-rc_Auto_Generated_Server_Certificate Getting CA Private Key server-cert.pem: OK client-cert.pem: OK Generating RSA private key, 2048 bit long modulus ..............................+++ .......................................................................+++ e is 65537 (0x10001) writing RSA key [root@w1 bin]#