RHEL6 Series under Installation Mysql5.6

Source: Internet
Author: User


mysql-5.6.16.tar.gz Source Package Download:

http://down.51cto.com/data/1875835


[Email protected] ~]# yum-y install gcc gcc-c++ autoconf automake zlib* libxml* ncurses-devel make CMake


TAR-XZVF mysql-5.6.16.tar.gz #解压缩文件

TAR-CZVF mysql-5.6.16.tar.gz #压缩文件


[[email protected] ~]#groupadd MySQL

[[email protected] ~]#useradd-r-g MySQL MySQL

[Email protected] ~]# TAR-XZVF mysql-5.6.16.tar.gz

[Email protected] ~]# CD mysql-5.6.16

[Email protected] mysql-5.6.16]# cmake.

[[email protected] mysql-5.6.16]# make && make install

[Email protected] mysql-5.6.16]# chown-r mysql.mysql/usr/local/mysql

[Email protected] mysql-5.6.16]# cd/usr/local/mysql/scripts/

[Email protected] scripts]# /mysql_install_db--user=mysql--basedir=/usr/local/mysql--datadir=/usr/local/ Mysql/data

[Email protected] scripts]# cd/usr/local/mysql/support-files/

[Email protected] support-files]# CP mysql.server/etc/rc.d/init.d/mysql

[Email protected] support-files]# CP my-default.cnf/etc/my.cnf

[[email protected] support-files]# chkconfig--add MySQL

[[email protected] support-files]# chkconfig MySQL on

[[email protected] support-files]# service MySQL start

Starting MySQL ... [OK]

[Email protected] support-files]# ln-s/usr/local/mysql/bin/*/usr/bin/

[[email protected] support-files]# MySQL

Welcome to the MySQL Monitor. Commands End With; or \g.

Your MySQL Connection ID is 1

Server version:5.6.16 Source Distribution


Copyright (c), the Oracle and/or its affiliates. All rights reserved.


Oracle is a registered trademark of the Oracle Corporation and/or its

Affiliates. Other names trademarks of their respective

Owners.


Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.


Mysql>


mysql> status;

--------------

MySQL Ver 14.14 distrib 5.6.16, for Linux (x86_64) using Editline Wrapper


Connection ID:1

Current database:

Current User:[email protected]

SSL:not on use

Current Pager:stdout

Using outfile:'

Using delimiter:;

Server version:5.6.16 Source Distribution

Protocol version:10

Connection:Localhost via UNIX socket

Server characterset:latin1

Db characterset:latin1

Client characterset:UTF8

Conn. CharacterSet:UTF8

UNIX sockets:/tmp/mysql.sock

Uptime:1 min sec


Threads:1 questions:5 Slow queries:0 opens:67 Flush tables:1 Open tables:60 queries per second avg:0.053

--------------


Mysql>





Create a test table for Scott users in the Oracle database:


mysql> use MySQL

Reading table information for completion of table and column names

Can turn off this feature to get a quicker startup with-a


Database changed

Mysql> Show Database;

Error 1064 (42000): You have a error in your SQL syntax; Check the manual-corresponds to your MySQL server version for the right syntax-use near ' database ' at line 1

mysql> show databases;

+--------------------+

| Database |

+--------------------+

| Information_schema |

| MySQL |

| Performance_schema |

| Test |

+--------------------+

4 rows in Set (0.00 sec)


mysql> CREATE TABLE Dept

(

-Deptno INT PRIMARY KEY,

Dname VARCHAR (14),

Loc VARCHAR (13)

);

Query OK, 0 rows affected (0.04 sec)


mysql> CREATE TABLE EMP

(

-EMPNO INT (4) PRIMARY KEY,

Ename VARCHAR (10),

JOB VARCHAR (10),

-MGR INT (4),

-HireDate DATE,

SAL DOUBLE,

-COMM DOUBLE,

-Deptno INT,

-FOREIGN KEY (DEPTNO) REFERENCES Dept (DEPTNO));

Query OK, 0 rows affected (0.02 sec)


mysql> CREATE TABLE Salgrade

-Grade INT PRIMARY KEY,

-Losal INT,

-Hisal INT);

Query OK, 0 rows affected (0.02 sec)


Mysql>



Insert test data:


mysql> INSERT into Dept VALUES

(Ten, ' ACCOUNTING ', ' NEW YORK ');

Query OK, 1 row Affected (0.00 sec)


mysql> INSERT into Dept VALUES

(+, ' DALLAS ');

Query OK, 1 row affected (0.01 sec)


mysql> INSERT into Dept VALUES

(+, ' SALES ', ' CHICAGO ');

Query OK, 1 row Affected (0.00 sec)


mysql> INSERT into Dept VALUES

(+, ' OPERATIONS ', ' BOSTON ');

Query OK, 1 row Affected (0.00 sec)


Mysql>





mysql> INSERT into EMP VALUES

(7369, ' SMITH ', ' Clerk ', 7902,date (' 1980-12-17 '), 800,null,20);

RT into EMP VALUES

(7566, ' JONES ', ' MANAGER ', 7839,date (' 1981-4-2 '), 2975,null,20);

INSERT into EMP VALUES

(7654, ' MARTIN ', ' salesman ', 7698,date (' 1981-9-28 '), 1250,1400,30);

INSERT into EMP VALUES

(7698, ' BLAKE ', ' MANAGER ', 7839,date (' 1981-5-1 '), 2850,null,30);

Inserquery OK, 1 row Affected (0.00 sec)


mysql> INSERT into EMP VALUES

(7499, ' ALLEN ', ' salesman ', 7698,date (' 1981-2-20 '), 1600,300,30);

Query OK, 1 row affected (0.01 sec)


mysql> INSERT into EMP VALUES

(7521, ' WARD ', ' salesman ', 7698,date (' 1981-2-22 '), 1250,500,30);

T into EMP VALUES

(7844, ' TURNER ', ' salesman ', 7698,date (' 1981-9-8 '), 1500,0,30);

INSERT into EMP VALUES

(7876, ' ADAMS ', ' Clerk ', 7788,date (' 1987-5-23 '), 1100,null,20);

INSERT into EMP VALUES

(7900, ' JAMES ', ' Clerk ', 7698,date (' 1981-12-3 '), 950,null,30);

INSERT into Equery OK, 1 row affected (0.01 sec)


mysql> INSERT into EMP VALUES

(7566, ' JONES ', ' MANAGER ', 7839,date (' 1981-4-2 '), 2975,null,20);

Query OK, 1 row Affected (0.00 sec)


mysql> INSERT into EMP VALUES

(7654, ' MARTIN ', ' salesman ', 7698,date (' 1981-9-28 '), 1250,1400,30);

Query OK, 1 row Affected (0.00 sec)


mysql> INSERT into EMP VALUES

(7698, ' BLAKE ', ' MANAGER ', 7839,date (' 1981-5-1 '), 2850,null,30);

Query OK, 1 row Affected (0.00 sec)


mysql> INSERT into EMP VALUES

(7782, ' CLARK ', ' MANAGER ', 7839,date (' 1981-6-9 '), 2450,null,10);

Query OK, 1 row Affected (0.00 sec)


mysql> INSERT into EMP VALUES

(7788, ' SCOTT ', ' ANALYST ', 7566,date (' 1987-4-19 '), 3000,null,20);

MP VALUES

(7902, ' FORD ', ' ANALYST ', 7566,date (' 1981-12-3 '), 3000,null,20);

INSERT into EMP VALUES

(7934, ' MILLER ', ' Clerk ', 7782,date (' 1982-1-23 '), 1300,null,10); Query OK, 1 row Affected (0.00 sec)


mysql> INSERT into EMP VALUES

(7839, ' KING ', ' president ', null,date (' 1981-11-17 '), 5000,null,10);

Query OK, 1 row Affected (0.00 sec)


mysql> INSERT into EMP VALUES

(7844, ' TURNER ', ' salesman ', 7698,date (' 1981-9-8 '), 1500,0,30);

Query OK, 1 row Affected (0.00 sec)


mysql> INSERT into EMP VALUES

(7876, ' ADAMS ', ' Clerk ', 7788,date (' 1987-5-23 '), 1100,null,20);

Query OK, 1 row Affected (0.00 sec)


mysql> INSERT into EMP VALUES

(7900, ' JAMES ', ' Clerk ', 7698,date (' 1981-12-3 '), 950,null,30);

Query OK, 1 row affected (0.01 sec)


mysql> INSERT into EMP VALUES

(7902, ' FORD ', ' ANALYST ', 7566,date (' 1981-12-3 '), 3000,null,20);

Query OK, 1 row Affected (0.00 sec)


mysql> INSERT into EMP VALUES

(7934, ' MILLER ', ' Clerk ', 7782,date (' 1982-1-23 '), 1300,null,10);

Query OK, 1 row Affected (0.00 sec)


Mysql>




Mysql> INSERT into Salgrade VALUES (1,700,1200);

Query OK, 1 row affected (0.01 sec)


Mysql> INSERT into Salgrade VALUES (2,1201,1400);

Query OK, 1 row Affected (0.00 sec)


Mysql> INSERT into Salgrade VALUES (3,1401,2000);

Query OK, 1 row affected (0.02 sec)


Mysql> INSERT into Salgrade VALUES (4,2001,3000);

Query OK, 1 row Affected (0.00 sec)


Mysql> INSERT into Salgrade VALUES (5,3001,9999);

Query OK, 1 row Affected (0.00 sec)


Mysql>




[1] Script reference:

How to create an Oracle database in MySQL database Scott's tables




This article is from the "Xbc's homepage" blog, so be sure to keep this source http://alipay.blog.51cto.com/7119970/1570454

RHEL6 Series under Installation Mysql5.6

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.