MySQL5.6.19 binary installation method bitsCN.com
1. operating system
CentOS release 6.2 (Final)
2. create Users and Groups
[Root @ mymaster1 ~] # Groupadd mysql
[Root @ mymaster1 ~] # Useradd-r-g mysqlmysql
3. unzip the installation package (decompress it to the location where you want to store the database data)
[Root @ mymaster1 ~] # Cd/data
[Root @ mymaster1 data] # tar-xzvf/root/mysql_soft/mysql-5.6.19-linux-glibc2.5-x86_64.tar.gz
[Root @ mymaster1 data] # ln-s mysql-5.6.19-linux-glibc2.5-x86_64 mysql
4. view the decompression status
[Root @ mymaster1 data] # ll
Total usage 20
Lrwxrwxrwx. 1 root 34 June 27 15:31 mysql-> mysql-5.6.19-linux-glibc2.5-x86_64
Drwxr-xr-x. 13 rootroot 4096 June 27 15:31 mysql-5.6.19-linux-glibc2.5-x86_64
5. modify the user and group of the folder to mysql:
[Root @ mymaster1 data] # cd mysql
[Root @ mymaster1 mysql] # chown-R mysql: mysql.
6. install the database. The data storage directory is/data/mysql/data.
[Root @ mymaster1 mysql] # scripts/mysql_install_db -- user = mysql -- basedir =/data/mysql -- datadir =/data/mysql/data
WARNING: The host 'mymaster1. localdomain 'could not be looked up with/data/mysql/bin/resolveip.
This probably means thatyour libc libraries are not 100% compatible
With this binary MySQLversion. The MySQL daemon, mysqld, shocould work
Normally with the exceptionthat host name resolving will not work.
This means that youshocould use IP addresses instead of hostnames
When specifying MySQLprivileges!
When the above warning occurs, the solution is to add a ing between the IP address and the host name in the/etc/hosts configuration file.
For example
[Root @ mymaster1 Packages] # cat/etc/hosts
127.0.0.1 localhost. localdomain localhost4 localhost4.localdomain4
: 1 localhost. localdomain localhost6 localhost6.localdomain6
IP address mymaster1.localdomain
The correct prompt information is as follows:
[Root @ mymaster1 mysql] # scripts/mysql_install_db -- user = mysql -- basedir =/data/mysql -- datadir =/data/mysql/data
Installing MySQL system tables... 2014-06-2716: 02: 45 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. please use -- explicit_defaults_for_timestamp server option (see documentationfor more details ).
16:02:45 2134 [Note] InnoDB: Using atomics to ref count buffer pool pages
16:02:45 2134 [Note] InnoDB: TheInnoDB memory heap is disabled
16:02:45 2134 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
16:02:45 2134 [Note] InnoDB: Compressed tables use zlib 1.2.3
16:02:45 2134 [Note] InnoDB: Using Linux native AIO
16:02:45 2134 [Note] InnoDB: Using CPU crc32 instructions
16:02:45 2134 [Note] InnoDB: Initializing buffer pool, size = 128.0 M
16:02:45 2134 [Note] InnoDB: Completed initialization of buffer pool
16:02:45 2134 [Note] InnoDB: Thefirst specified data file./ibdata1 did not exist: a new database to becreated!
16:02:45 2134 [Note] InnoDB: Setting file./ibdata1 size to 12 MB
16:02:45 2134 [Note] InnoDB: Database physically writes the file full: wait...
16:02:45 2134 [Note] InnoDB: Setting log file./ib_logfile101 size to 48 MB
16:02:46 2134 [Note] InnoDB: Setting log file./ib_logfile1 size to 48 MB
16:02:46 2134 [Note] InnoDB: Renaming log file./ib_logfile101 to./ib_logfile0
16:02:46 2134 [Warning] InnoDB: New log files created, LSN = 45781
16:02:46 2134 [Note] InnoDB: Doublewrite buffer not found: creating new
16:02:46 2134 [Note] InnoDB: Doublewrite buffer created
16:02:46 2134 [Note] InnoDB: 128 rollback segment (s) are active.
16:02:46 2134 [Warning] InnoDB: Creating foreign key constraint system tables.
16:02:46 2134 [Note] InnoDB: Foreign key constraint system tables created
16:02:46 2134 [Note] InnoDB: Creating tablespace and datafile system tables.
16:02:46 2134 [Note] InnoDB: Tablespace and datafile system tables created.
16:02:46 2134 [Note] InnoDB: Waiting for purge to start
16:02:46 2134 [Note] InnoDB: 5.6.19 started; log sequence number 0
16:02:47 2134 [Note] Binlog end
16:02:47 2134 [Note] InnoDB: FTSoptimize thread exiting.
16:02:47 2134 [Note] InnoDB: Starting shutdown...
16:02:48 2134 [Note] InnoDB: Shutdown completed; log sequence number 1625977
OK
Filling help tables... 2014-06-27 16:02:48 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use -- explicit_defaults_for_timestamp server option (see documentation for moredetails ).
16:02:48 2157 [Note] InnoDB: Using atomics to ref count buffer pool pages
16:02:48 2157 [Note] InnoDB: TheInnoDB memory heap is disabled
16:02:48 2157 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
16:02:48 2157 [Note] InnoDB: Compressed tables use zlib 1.2.3
16:02:48 2157 [Note] InnoDB: Using Linux native AIO
16:02:48 2157 [Note] InnoDB: Using CPU crc32 instructions
16:02:48 2157 [Note] InnoDB: Initializing buffer pool, size = 128.0 M
16:02:48 2157 [Note] InnoDB: Completed initialization of buffer pool
16:02:48 2157 [Note] InnoDB: Highest supported file format is Barracuda.
16:02:48 2157 [Note] InnoDB: 128 rollback segment (s) are active.
16:02:48 2157 [Note] InnoDB: Waiting for purge to start
16:02:48 2157 [Note] InnoDB: 5.6.19 started; log sequence number 1625977
16:02:48 2157 [Note] Binlog end
16:02:48 2157 [Note] InnoDB: FTSoptimize thread exiting.
16:02:48 2157 [Note] InnoDB: Startingshutdown...
16:02:50 2157 [Note] InnoDB: Shutdown completed; log sequence number 1625987
OK
To start mysqld at boot time you have tocopy
Support-files/mysql. server to the rightplace for your system
Please remember to set a password for THEMySQL root USER!
To do so, start the server, then issue thefollowing commands:
/Data/mysql/bin/mysqladmin-u root password 'new-password'
/Data/mysql/bin/mysqladmin-u root-h mymaster1.localdomain password 'new-password'
Alternatively you can run:
/Data/mysql/bin/mysql_secure_installation
Which will also give you the option ofremoving the test
Databases and anonymous user created bydefault. This is
Stronugly recommended for productionservers.
See the manual for more instructions.
You can start the MySQL daemon:
Cd.;/data/mysql/bin/mysqld_safe &
You can test the MySQL daemon withmysql-test-run.pl
Cdmysql-test; perl mysql-test-run.pl.
Please report any problems athttp: // bugs.mysql.com/
The latest information about MySQL isavailable on the web
Http://www.mysql.com
Support MySQL by buying support/licenses athttp: // shop.mysql.com
New default config file was created as/data/mysql/my. cnf and
Will be used by default by the server whenyou start it.
You may edit this file to change serversettings
7. modify related directory permissions to improve security:
[Root @ mymaster1 mysql] # chown-R root.
[Root @ mymaster1 mysql] # chown-R mysql data
8. configure the MySQL service as the host service to start the service with service mysql start.
[Root @ mymaster1 mysql] # cpsupport-files/mysql. server/etc/init. d/mysql
[Root @ mymaster1 mysql] # vi/etc/init. d/mysql
Set the following
Basedir =
Datadir =
Change
Basedir =/data/mysql
Datadir =/data/mysql/data
9. start the database
[Root @ mymaster1 mysql] # service mysql start
Starting MySQL [OK]
10. modify the database root password
[Root @ mymaster1 mysql] #/data/mysql/bin/mysqladmin-u root password 'wengjixi'
[Root @ mymaster1 mysql] #/data/mysql/bin/mysqladmin-u root-h mymaster1.localdomain password 'wengjixi'
11. modify the environment variable and add the mysql execution file path to the environment variable.
[Root @ mymaster1 mysql] # vi/etc/profile
PATH = $ PATH:/data/mysql/bin
Export PATH
[Root @ mymaster1 mysql] # source/etc/profile
12. test logon
[Root @ mymaster1 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.6.19 MySQL CommunityServer (GPL)
Copyright (c) 2000,201 4, Oracle and/or itsaffiliates. All rights reserved.
Oracle is a registered trademark of OracleCorporation and/or its
Affiliates. Other names may be trademarksof their respective
Owners.
Type 'help; 'or'/h' for help. type'/C' toclear the current input statement.
Mysql>
Mysql> show variables like '% data % ';
+ ------------------------------- + ------------------------ +
| Variable_name | Value |
+ ------------------------------- + ------------------------ +
| Character_set_database | latin1 |
| Collation_database | latin1_swedish_ci |
| Datadir |/data/mysql/data/
BitsCN.com