Home Database Mysql Tutorial Linux上安装MySQL5.6_MySQL

Linux上安装MySQL5.6_MySQL

May 31, 2016 am 08:48 AM

OS & MySQL的版本和配置:

MySQL Version: 5.6.19 Linux Version: Linux boston.oracle.com 2.6.18-164.el5 #1 SMP Thu Sep 3 02:16:47 EDT 2009 i686 i686 i386 GNU/Linux

一,下载MySQL安装软件,请到www.oracle.com   去找DATABASE DOWNLOAD,下载MySQL需要注册一个账号。我下载的版本如下:

下载后解压就是以下的8个文件 :

二, 在Linux上安装MySQL(一个服务器程序和一个客户端程序)

 [root@vmoel5u4 mysql_installer]# ll

total 115896

-rw-r--r-- 1 root root 22925106 May  8  2014 MySQL-client-advanced-5.6.19-1.rhel5.i386.rpm

-rw-r--r-- 1 root root 95621549 May  8  2014 MySQL-server-advanced-5.6.19-1.rhel5.i386.rpm

--安装Server端:

[root@vmoel5u4 mysql_installer]# rpm -ivh MySQL-server-advanced-5.6.19-1.rhel5.i386.rpm

Preparing...                ########################################### [100%]

   1:MySQL-server-advanced  ########################################### [100%]

2012-11-18 00:34:49 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

2012-11-18 00:34:49 16251 [Note] InnoDB: Using mutexes to ref count buffer pool pages

2012-11-18 00:34:49 16251 [Note] InnoDB: The InnoDB memory heap is disabled

2012-11-18 00:34:49 16251 [Note] InnoDB: Mutexes and rw_locks use InnoDB's own implementation

2012-11-18 00:34:49 16251 [Note] InnoDB: Compressed tables use zlib 1.2.3

2012-11-18 00:34:49 16251 [Note] InnoDB: Using Linux native AIO

2012-11-18 00:34:49 16251 [Note] InnoDB: Not using CPU crc32 instructions

2012-11-18 00:34:49 16251 [Note] InnoDB: Initializing buffer pool, size = 128.0M

2012-11-18 00:34:49 16251 [Note] InnoDB: Completed initialization of buffer pool

2012-11-18 00:34:49 16251 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!

2012-11-18 00:34:49 16251 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB

2012-11-18 00:34:49 16251 [Note] InnoDB: Database physically writes the file full: wait...

2012-11-18 00:34:49 16251 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB

2012-11-18 00:34:50 16251 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB

2012-11-18 00:34:50 16251 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0

2012-11-18 00:34:50 16251 [Warning] InnoDB: New log files created, LSN=45781

2012-11-18 00:34:50 16251 [Note] InnoDB: Doublewrite buffer not found: creating new

2012-11-18 00:34:50 16251 [Note] InnoDB: Doublewrite buffer created

2012-11-18 00:34:50 16251 [Note] InnoDB: 128 rollback segment(s) are active.

2012-11-18 00:34:50 16251 [Warning] InnoDB: Creating foreign key constraint system tables.

2012-11-18 00:34:50 16251 [Note] InnoDB: Foreign key constraint system tables created

2012-11-18 00:34:50 16251 [Note] InnoDB: Creating tablespace and datafile system tables.

2012-11-18 00:34:50 16251 [Note] InnoDB: Tablespace and datafile system tables created.

2012-11-18 00:34:50 16251 [Note] InnoDB: Waiting for purge to start

2012-11-18 00:34:50 16251 [Note] InnoDB: 5.6.19 started; log sequence number 0

2012-11-18 00:34:50 16251 [Note] RSA private key file not found: /var/lib/mysql//private_key.pem. Some authentication plugins will not work.

2012-11-18 00:34:50 16251 [Note] RSA public key file not found: /var/lib/mysql//public_key.pem. Some authentication plugins will not work.

A random root password has been set. You will find it in '/root/.mysql_secret'.

2012-11-18 00:34:51 16251 [Note] Binlog end

2012-11-18 00:34:51 16251 [Note] InnoDB: FTS optimize thread exiting.

2012-11-18 00:34:51 16251 [Note] InnoDB: Starting shutdown...

2012-11-18 00:34:53 16251 [Note] InnoDB: Shutdown completed; log sequence number 1625977

2012-11-18 00:34:53 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

2012-11-18 00:34:53 16282 [Note] InnoDB: Using mutexes to ref count buffer pool pages

2012-11-18 00:34:53 16282 [Note] InnoDB: The InnoDB memory heap is disabled

2012-11-18 00:34:53 16282 [Note] InnoDB: Mutexes and rw_locks use InnoDB's own implementation

2012-11-18 00:34:53 16282 [Note] InnoDB: Compressed tables use zlib 1.2.3

2012-11-18 00:34:53 16282 [Note] InnoDB: Using Linux native AIO

2012-11-18 00:34:53 16282 [Note] InnoDB: Not using CPU crc32 instructions

2012-11-18 00:34:53 16282 [Note] InnoDB: Initializing buffer pool, size = 128.0M

2012-11-18 00:34:53 16282 [Note] InnoDB: Completed initialization of buffer pool

2012-11-18 00:34:53 16282 [Note] InnoDB: Highest supported file format is Barracuda.

2012-11-18 00:34:53 16282 [Note] InnoDB: 128 rollback segment(s) are active.

2012-11-18 00:34:53 16282 [Note] InnoDB: Waiting for purge to start

2012-11-18 00:34:53 16282 [Note] InnoDB: 5.6.19 started; log sequence number 1625977

2012-11-18 00:34:53 16282 [Note] RSA private key file not found: /var/lib/mysql//private_key.pem. Some authentication plugins will not work.

2012-11-18 00:34:53 16282 [Note] RSA public key file not found: /var/lib/mysql//public_key.pem. Some authentication plugins will not work.

2012-11-18 00:34:53 16282 [Note] Binlog end

2012-11-18 00:34:53 16282 [Note] InnoDB: FTS optimize thread exiting.

2012-11-18 00:34:53 16282 [Note] InnoDB: Starting shutdown...

2012-11-18 00:34:55 16282 [Note] InnoDB: Shutdown completed; log sequence number 1625987

A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER !

You will find that password in '/root/.mysql_secret'.

You must change that password on your first connect,

no other statement but 'SET PASSWORD' will be accepted.

See the manual for the semantics of the 'password expired' flag.

Also, the account for the anonymous user has been removed.

In addition, you can run:

  /usr/bin/mysql_secure_installation

which will also give you the option of removing the test database.

This is strongly recommended for production servers.

/*  上面的红色的大概意思如下:

为MySQL的数据库的root的用户生成了一个随机的秘密,请到/root/.mysql_secret里去找密码。

当你第一次登陆时必须修改密码,同时匿名帐号已经被删除掉了。

除此之外,你可以执行:

/usr/bin/mysql_secure_installation

他可以给你一些移除test 数据库的选项。

强烈推荐在生产服务器上做此操作。

*/

See the manual for more instructions.

Please report any problems athttp://bugs.mysql.com/

The latest information about MySQL is available on the web at

 http://www.mysql.com

Support MySQL by buying support/licenses athttp://shop.mysql.com

New default config file was created as /usr/my.cnf and

will be used by default by the server when you start it.

You may edit this file to change server settings

--安装Client端:

[root@vmoel5u4 mysql_installer]# rpm -ivh MySQL-client-advanced-5.6.19-1.rhel5.i386.rpm

Preparing...                ########################################### [100%]

   1:MySQL-client-advanced  ########################################### [100%]

三,MySQL 数据库的配置

1,启动MySQL服务

 [root@vmoel5u4 mysql_installer]# cd /etc/rc.d/init.d

[root@vmoel5u4 init.d]# service mysql start

Starting MySQL..........                                   [  OK  ]

2,修改MySQL数据库root用户的初始密码,先查下初始密码

[root@vmoel5u4 mysql_installer]# vi /root/.mysql_secret

# The random password set for the root user at Sun Nov 18 00:34:51 2012 (local time): kX65UtYvovXN9VOV

从上面可以初始密码是:kX65UtYvovXN9VOV

[root@vmoel5u4 init.d]# mysql -uroot -p

Enter password:

Welcome to the MySQL monitor.  Commands end with ; or /g.

Your MySQL connection id is 15

Server version: 5.6.19-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>

/*修改密码为123456*/

mysql> update user set password=PASSWORD('123456') where user='root';

Query OK, 3 rows affected (0.00 sec)

Rows matched: 3  Changed: 3  Warnings: 0

/*刷新权限表*/

mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)

3,用新密码123456登陆MySQL

[root@vmoel5u4 init.d]# mysql -uroot -p

Enter password:

Welcome to the MySQL monitor.  Commands end with ; or /g.

Your MySQL connection id is 16

Server version: 5.6.19-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> 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> select Host,User,Password from user;

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

| Host      | User | Password                                  |

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

| localhost | root | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 |

| 127.0.0.1 | root | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 |

| ::1       | root | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 |

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

3 rows in set (0.00 sec)

4, 创建新的表test,并插入测试数据

mysql> create table test(id int);

Query OK, 0 rows affected (0.05 sec)

mysql> insert into test(id) values(1);

Query OK, 1 row affected (0.05 sec)

mysql> insert into test(id) values(2);

Query OK, 1 row affected (0.01 sec)

mysql> commit;

Query OK, 0 rows affected (0.00 sec)

mysql> select * from test;

+------+

| id   |

+------+

|    1 |

|    2 |

+------+

2 rows in set (0.02 sec)

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Reduce the use of MySQL memory in Docker Reduce the use of MySQL memory in Docker Mar 04, 2025 pm 03:52 PM

This article explores optimizing MySQL memory usage in Docker. It discusses monitoring techniques (Docker stats, Performance Schema, external tools) and configuration strategies. These include Docker memory limits, swapping, and cgroups, alongside

How to solve the problem of mysql cannot open shared library How to solve the problem of mysql cannot open shared library Mar 04, 2025 pm 04:01 PM

This article addresses MySQL's "unable to open shared library" error. The issue stems from MySQL's inability to locate necessary shared libraries (.so/.dll files). Solutions involve verifying library installation via the system's package m

How do you alter a table in MySQL using the ALTER TABLE statement? How do you alter a table in MySQL using the ALTER TABLE statement? Mar 19, 2025 pm 03:51 PM

The article discusses using MySQL's ALTER TABLE statement to modify tables, including adding/dropping columns, renaming tables/columns, and changing column data types.

Run MySQl in Linux (with/without podman container with phpmyadmin) Run MySQl in Linux (with/without podman container with phpmyadmin) Mar 04, 2025 pm 03:54 PM

This article compares installing MySQL on Linux directly versus using Podman containers, with/without phpMyAdmin. It details installation steps for each method, emphasizing Podman's advantages in isolation, portability, and reproducibility, but also

What is SQLite? Comprehensive overview What is SQLite? Comprehensive overview Mar 04, 2025 pm 03:55 PM

This article provides a comprehensive overview of SQLite, a self-contained, serverless relational database. It details SQLite's advantages (simplicity, portability, ease of use) and disadvantages (concurrency limitations, scalability challenges). C

Running multiple MySQL versions on MacOS: A step-by-step guide Running multiple MySQL versions on MacOS: A step-by-step guide Mar 04, 2025 pm 03:49 PM

This guide demonstrates installing and managing multiple MySQL versions on macOS using Homebrew. It emphasizes using Homebrew to isolate installations, preventing conflicts. The article details installation, starting/stopping services, and best pra

How do I configure SSL/TLS encryption for MySQL connections? How do I configure SSL/TLS encryption for MySQL connections? Mar 18, 2025 pm 12:01 PM

Article discusses configuring SSL/TLS encryption for MySQL, including certificate generation and verification. Main issue is using self-signed certificates' security implications.[Character count: 159]

What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)? What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)? Mar 21, 2025 pm 06:28 PM

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]

See all articles