install mysql 5.6 from binary on CentOS 6.4

来源:互联网 发布:怎么用网络看电视 编辑:程序博客网 时间:2024/05/29 18:54
[root@CentOS local]# groupadd mysql[root@CentOS local]# useradd -r -g mysql mysql[root@CentOS local]# cd /usr/local[root@CentOS local]# tar zxvf /usr/local/mysql-5.6.11-linux-glibc2.5-x86_64.tar.gz[root@CentOS local]# ln -s /usr/local/mysql-5.6.11-linux-glibc2.5-x86_64 mysql[root@CentOS local]# cd mysql[root@CentOS mysql]# chown -R mysql .[root@CentOS mysql]# chgrp -R mysql .[root@CentOS mysql]# ls -latotal 84drwxr-xr-x. 13 mysql mysql  4096 May  2 03:54 .drwxr-xr-x. 13 root  root   4096 May  2 03:55 ..drwxr-xr-x.  2 mysql mysql  4096 May  2 03:54 bin-rw-r--r--.  1 mysql mysql 17987 Apr  5 08:27 COPYINGdrwxr-xr-x.  3 mysql mysql  4096 May  2 03:53 datadrwxr-xr-x.  2 mysql mysql  4096 May  2 03:53 docsdrwxr-xr-x.  3 mysql mysql  4096 May  2 03:53 include-rw-r--r--.  1 mysql mysql  7468 Apr  5 08:27 INSTALL-BINARYdrwxr-xr-x.  3 mysql mysql  4096 May  2 03:53 libdrwxr-xr-x.  4 mysql mysql  4096 May  2 03:53 mandrwxr-xr-x. 10 mysql mysql  4096 May  2 03:53 mysql-test-rw-r--r--.  1 mysql mysql  2552 Apr  5 08:27 READMEdrwxr-xr-x.  2 mysql mysql  4096 May  2 03:54 scriptsdrwxr-xr-x. 28 mysql mysql  4096 May  2 03:53 sharedrwxr-xr-x.  4 mysql mysql  4096 May  2 03:54 sql-benchdrwxr-xr-x.  3 mysql mysql  4096 May  2 03:54 support-files[root@CentOS mysql]# scripts/mysql_install_db --user=mysqlWARNING: The host 'CentOS' could not be looked up with ./bin/resolveip.This probably means that your libc libraries are not 100 % compatiblewith this binary MySQL version. The MySQL daemon, mysqld, should worknormally with the exception that host name resolving will not work.This means that you should use IP addresses instead of hostnameswhen specifying MySQL privileges !Installing MySQL system tables...2013-05-02 04:21:14 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).2013-05-02 04:21:14 6416 [Note] InnoDB: The InnoDB memory heap is disabled2013-05-02 04:21:14 6416 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins2013-05-02 04:21:14 6416 [Note] InnoDB: Compressed tables use zlib 1.2.32013-05-02 04:21:14 6416 [Note] InnoDB: Using Linux native AIO2013-05-02 04:21:14 6416 [Note] InnoDB: Using CPU crc32 instructions2013-05-02 04:21:14 6416 [Note] InnoDB: Initializing buffer pool, size = 128.0M2013-05-02 04:21:14 6416 [Note] InnoDB: Completed initialization of buffer pool2013-05-02 04:21:14 6416 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!2013-05-02 04:21:14 6416 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB2013-05-02 04:21:14 6416 [Note] InnoDB: Database physically writes the file full: wait...2013-05-02 04:21:14 6416 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB2013-05-02 04:21:14 6416 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB2013-05-02 04:21:15 6416 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile02013-05-02 04:21:15 6416 [Warning] InnoDB: New log files created, LSN=457812013-05-02 04:21:15 6416 [Note] InnoDB: Doublewrite buffer not found: creating new2013-05-02 04:21:15 6416 [Note] InnoDB: Doublewrite buffer created2013-05-02 04:21:15 6416 [Note] InnoDB: 128 rollback segment(s) are active.2013-05-02 04:21:15 6416 [Warning] InnoDB: Creating foreign key constraint system tables.2013-05-02 04:21:15 6416 [Note] InnoDB: Foreign key constraint system tables created2013-05-02 04:21:15 6416 [Note] InnoDB: Creating tablespace and datafile system tables.2013-05-02 04:21:15 6416 [Note] InnoDB: Tablespace and datafile system tables created.2013-05-02 04:21:15 6416 [Note] InnoDB: Waiting for purge to start2013-05-02 04:21:15 6416 [Note] InnoDB: 5.6.11 started; log sequence number 02013-05-02 04:21:17 6416 [Note] Binlog end2013-05-02 04:21:17 6416 [Note] InnoDB: FTS optimize thread exiting.2013-05-02 04:21:17 6416 [Note] InnoDB: Starting shutdown...2013-05-02 04:21:19 6416 [Note] InnoDB: Shutdown completed; log sequence number 1625977OKFilling help tables...2013-05-02 04:21:19 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).2013-05-02 04:21:19 6439 [Note] InnoDB: The InnoDB memory heap is disabled2013-05-02 04:21:19 6439 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins2013-05-02 04:21:19 6439 [Note] InnoDB: Compressed tables use zlib 1.2.32013-05-02 04:21:19 6439 [Note] InnoDB: Using Linux native AIO2013-05-02 04:21:19 6439 [Note] InnoDB: Using CPU crc32 instructions2013-05-02 04:21:19 6439 [Note] InnoDB: Initializing buffer pool, size = 128.0M2013-05-02 04:21:19 6439 [Note] InnoDB: Completed initialization of buffer pool2013-05-02 04:21:19 6439 [Note] InnoDB: Highest supported file format is Barracuda.2013-05-02 04:21:19 6439 [Note] InnoDB: 128 rollback segment(s) are active.2013-05-02 04:21:19 6439 [Note] InnoDB: Waiting for purge to start2013-05-02 04:21:19 6439 [Note] InnoDB: 5.6.11 started; log sequence number 16259772013-05-02 04:21:19 6439 [Note] Binlog end2013-05-02 04:21:19 6439 [Note] InnoDB: FTS optimize thread exiting.2013-05-02 04:21:19 6439 [Note] InnoDB: Starting shutdown...2013-05-02 04:21:21 6439 [Note] InnoDB: Shutdown completed; log sequence number 1625987OKTo start mysqld at boot time you have to copysupport-files/mysql.server to the right place for your systemPLEASE 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 CentOS password 'new-password'Alternatively you can run:  ./bin/mysql_secure_installationwhich will also give you the option of removing the testdatabases and anonymous user created by default.  This isstrongly 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.plPlease report any problems with the ./bin/mysqlbug script!The latest information about MySQL is available on the web at  http://www.mysql.comSupport MySQL by buying support/licenses at http://shop.mysql.comNew default config file was created as ./my.cnf andwill be used by default by the server when you start it.You may edit this file to change server settings[root@CentOS mysql]# chown -R root .[root@CentOS mysql]# chown -R mysql data[root@CentOS mysql]# ls support-filesbinary-configure  magic  my-default.cnf  mysqld_multi.server  mysql-log-rotate[root@CentOS mysql]# cp support-files/my-default.cnf /etc/my.cnf[root@CentOS mysql]# cp support-files/mysql.server /etc/init.d/mysql[root@CentOS mysql]# bin/mysqld_safe --user=mysql &[1] 6468[root@CentOS mysql]# 130502 04:23:50 mysqld_safe Logging to '/usr/local/mysql/da130502 04:23:50 mysqld_safe Starting mysqld daemon with databases from /usr/loca[root@CentOS mysql]# mysql-bash: mysql: command not found[root@CentOS mysql]# bin/mysqlWelcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 1Server version: 5.6.11 MySQL Community Server (GPL)Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> exitBye[root@CentOS mysql]# bin/mysqladmin -u root password '1234';[root@CentOS mysql]# bin/mysql -uroot -pEnter password:Welcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 3Server version: 5.6.11 MySQL Community Server (GPL)Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.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> exitBye[root@CentOS mysql]# cd[root@CentOS ~]# cd /usr/lib/mysql/-bash: cd: /usr/lib/mysql/: No such file or directory[root@CentOS ~]# cd /usr/local/mysql/[root@CentOS mysql]# ls -latotal 88drwxr-xr-x. 13 root  mysql  4096 May  2 04:21 .drwxr-xr-x. 13 root  root   4096 May  2 03:55 ..drwxr-xr-x.  2 root  mysql  4096 May  2 03:54 bin-rw-r--r--.  1 root  mysql 17987 Apr  5 08:27 COPYINGdrwxr-xr-x.  5 mysql mysql  4096 May  2 04:23 datadrwxr-xr-x.  2 root  mysql  4096 May  2 03:53 docsdrwxr-xr-x.  3 root  mysql  4096 May  2 03:53 include-rw-r--r--.  1 root  mysql  7468 Apr  5 08:27 INSTALL-BINARYdrwxr-xr-x.  3 root  mysql  4096 May  2 03:53 libdrwxr-xr-x.  4 root  mysql  4096 May  2 03:53 man-rw-r--r--.  1 root  root    943 May  2 04:21 my.cnfdrwxr-xr-x. 10 root  mysql  4096 May  2 03:53 mysql-test-rw-r--r--.  1 root  mysql  2552 Apr  5 08:27 READMEdrwxr-xr-x.  2 root  mysql  4096 May  2 03:54 scriptsdrwxr-xr-x. 28 root  mysql  4096 May  2 03:53 sharedrwxr-xr-x.  4 root  mysql  4096 May  2 03:54 sql-benchdrwxr-xr-x.  3 root  mysql  4096 May  2 03:54 support-files[root@CentOS mysql]# cd[root@CentOS ~]# echo "export PATH=$PATH:/usr/local/mysql/bin" >>/etc/profile[root@CentOS ~]# source /etc/profile[root@CentOS ~]# mysql -u root -pEnter password:Welcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 4Server version: 5.6.11 MySQL Community Server (GPL)Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.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> exitBye[root@CentOS ~]# mysql stop;ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)[root@CentOS ~]# service mysql stop;Shutting down MySQL..130502 05:37:55 mysqld_safe mysqld from pid file /usr/local/mysql/data/CentOS.pid ended SUCCESS![1]+  Done                    bin/mysqld_safe --user=mysql  (wd: /usr/local/mysql)(wd now: ~)[root@CentOS ~]# service mysql start;Starting MySQL. SUCCESS![root@CentOS ~]# service mysql stop;Shutting down MySQL.. SUCCESS![root@CentOS ~]# ls -la /etc/init.d/mysql-rwxr-xr-x. 1 root root 10650 May  2 04:23 /etc/init.d/mysql[root@CentOS ~]# cd /etc[root@CentOS etc]# ln -s rc.d/init.d .ln: creating symbolic link `./init.d': File exists[root@CentOS etc]# chkconfig --add mysql[root@CentOS etc]# chkconfig --level 345 mysql on[root@CentOS etc]# cd[root@CentOS ~]# service mysql start;Starting MySQL. SUCCESS![root@CentOS ~]#

原创粉丝点击