Linux binary universal package installation mysql5.6.20 tutorial, linuxmysql5.6.20

Source: Internet
Author: User

Linux binary universal package installation mysql5.6.20 tutorial, linuxmysql5.6.20

We use a binary universal package to install MySQL. This is similar to the green software in windows. After decompression, we can use the Configuration ,:
Https://edelivery.Oracle.com/EPD/Search/handle_go

2. decompress the binary mysql Installation File to/usr/local. Here, the soft connection is used as mysql.

[root@mysql1 soft]tar xvf mysql-advanced-5.6.20-linux-glibc2.5-x86_64.tar.gz -C /usr/local [root@mysql1 local]ln -sv mysql-advanced-5.6.20-linux-glibc2.5-x86_64 mysql [root@mysql1 local]# pwd /usr/local [root@mysql1 local]# ls -l total 64 -rw-r--r--. 1 root root 20465 Aug 16 20:21 1 drwxr-xr-x. 2 root root 4096 Jun 28 2011 bin drwxr-xr-x. 2 root root 4096 Jun 28 2011 etc drwxr-xr-x. 2 root root 4096 Jun 28 2011 games drwxr-xr-x. 2 root root 4096 Jun 28 2011 include drwxr-xr-x. 2 root root 4096 Jun 28 2011 lib drwxr-xr-x. 2 root root 4096 Jun 28 2011 lib64 drwxr-xr-x. 2 root root 4096 Jun 28 2011 libexec lrwxrwxrwx. 1 root root 43 Aug 17 18:25 mysql -> mysql-advanced-5.6.20-linux-glibc2.5-x86_64 drwxr-xr-x. 13 root root 4096 Aug 17 18:37 mysql-advanced-5.6.20-linux-glibc2.5-x86_64 drwxr-xr-x. 2 root root 4096 Jun 28 2011 sbin drwxr-xr-x. 5 root root 4096 Aug 16 19:14 share drwxr-xr-x. 2 root root 4096 Jun 28 2011 src 

3. Add mysql users and groups. skip this step if they already exist.

[Root @ mysql1 local] groupadd-r-g 306 mysql #-r indicates that it is a pseudo user and is only used to run mysql programs, you cannot log on to the system [root @ mysql1 local] useradd-g 306-r-u 306 mysql

4. Set the installation file to mysql. Here, set the data file directory to/mydata/data.

[root@mysql1 mysql]# chown -R mysql.mysql /usr/local/mysql/* [root@mysql1 mysql]# chown -R mysql.mysql /mydata 

5. initialize mysql

[root@mysql1 mysql]#scripts/mysql_install_db --user=mysql --datadir=/mydata/data/ 

6. Copy mysql. server to mysqld in the support-files directory, create the initialization process, and add it to the service.

[root@mysql1 mysql]# cp support-files/mysql.server /etc/init.d/mysqld [root@mysql1 mysql]# ls -l /etc/init.d/mysqld -rwxr-xr-x. 1 root root 10880 Aug 17 18:52 /etc/init.d/mysqld [root@mysql1 mysql]# chkconfig --add mysqld [root@mysql1 mysql]# chkconfig --list |grep mysqld mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off 

7. Configure the mysql configuration file

The configuration file search sequence of mysql is/etc/my. cnf->/etc/mysql/my. cnf-> $ BASEDIR/my. cnf-> ~ /My. cnf
If multiple configuration files exist, the latter overwrites the former, and datadir is used as the data file directory location.

[root@mysql1 support-files]# grep -v '^#' /etc/my.cnf  [mysqld]  basedir = /usr/local/mysql datadir = /mydata/data port = 3306  sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 

8. Start mysql

[root@mysql1 support-files]# service mysqld start Starting MySQL.  [ OK ] [root@mysql1 support-files]# netstat -tnlp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1224/rpcbind tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1567/sshd tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1439/cupsd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1781/master tcp 0 0 0.0.0.0:49830 0.0.0.0:* LISTEN 1347/rpc.statd tcp 0 0 :::111 :::* LISTEN 1224/rpcbind tcp 0 0 :::22 :::* LISTEN 1567/sshd tcp 0 0 ::1:631 :::* LISTEN 1439/cupsd tcp 0 0 ::1:25 :::* LISTEN 1781/master tcp 0 0 :::58044 :::* LISTEN 1347/rpc.statd tcp 0 0 :::3306 :::* LISTEN 3899/mysqld 

Add the mysql environment variable to the profile file.

[root@mysql1 ~]# grep PATH .bash_profile PATH=$PATH:$HOME/bin:/usr/local/mysql/bin export PATH 

You can access mysql.

[root@mysql1 ~]# mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 5 Server version: 5.6.20-enterprise-commercial-advanced MySQL Enterprise Server - Advanced Edition (Commercial)  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.  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> 

9. There are some small configurations

1) Add MySQL man help document
Modify/etc/man. conf, add the corresponding configuration, and add a line
MANPATH/usr/local/mysql/man
[Root @ mysql1 data] # vi/etc/man. config

2) Add the mysql Library File

[root@mysql1 data]# cd /etc/ld.so.conf.d [root@mysql1 ld.so.conf.d]# ls atlas-x86_64.conf ctapi-x86_64.conf kernel-2.6.32-358.el6.x86_64.conf qt-x86_64.conf [root@mysql1 ld.so.conf.d]# vi /etc/ld.so.conf.d/mysql.conf /usr/local/mysql/lib [root@mysql1 ld.so.conf.d]# ldconfig -v

Make library files take effect

3) Add the mysql header file

[root@mysql1 ld.so.conf.d]# ln -sv /usr/local/mysql/include /usr/include/mysql `/usr/include/mysql/include' -> `/usr/local/mysql/include' 

Highlights: mysql installation tutorials for different versions mysql5.7 installation tutorials for various versions mysql5.6 installation tutorials

The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.