日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪(fǎng)問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 运维知识 > 数据库 >内容正文

数据库

mysql-5.1.73-8.el6_在centos中安装mysql详细步骤说明

發(fā)布時(shí)間:2025/3/12 数据库 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 mysql-5.1.73-8.el6_在centos中安装mysql详细步骤说明 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

Last login: Sun Dec 24 04:55:59 2017

1、安裝依賴(lài)

[root@node001 ~]# yum install -y perl

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

base | 3.7 kB 00:00

extras | 3.4 kB 00:00

updates | 3.4 kB 00:00

Setting up Install Process

Package 4:perl-5.10.1-144.el6.x86_64 already installed and latest version

Nothing to do

2、?卸載舊版本的mysql及插件

[root@node001 ~]# rpm -qa | grep mysql

mysql-5.1.73-8.el6_8.x86_64

mysql-libs-5.1.73-8.el6_8.x86_64

mysql-server-5.1.73-8.el6_8.x86_64

[root@node001 ~]#rpm -e mysql-5.1.73-8.el6_8.x86_64 --nodeps

[root@node001 ~]# rpm -e mysql-libs-5.1.73-8.el6_8.x86_64?--nodeps

[root@node001 ~]# rpm -e mysql-server-5.1.73-8.el6_8.x86_64?--nodeps

(--nodeps:忽略其他依賴(lài),直接卸載)

3、 安裝rpm(4個(gè))

安裝包

[root@node001 ~]#tar zxvf mysql.tar.gz

MySQL-client-5.6.28-1.el6.x86_64.rpm

MySQL-devel-5.6.28-1.el6.x86_64.rpm

MySQL-server-5.6.28-1.el6.x86_64.rpm

numactl-2.0.9-2.el6.x86_64.rpm

[root@node001 ~]# rpm -ivh MySQL-client-5.6.28-1.el6.x86_64.rpm

warning: MySQL-client-5.6.28-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

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

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

[root@node001 ~]# rpm -ivh MySQL-devel-5.6.28-1.el6.x86_64.rpm

warning: MySQL-devel-5.6.28-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

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

1:MySQL-devel ########################################### [100%]

[root@node001 ~]# rpm -ivh numactl-2.0.9-2.el6.x86_64.rpm

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

1:numactl ########################################### [100%]

[root@node001 ~]# rpm -ivh MySQL-server-5.6.28-1.el6.x86_64.rpm

warning: MySQL-server-5.6.28-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

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

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

2017-12-24 05:39:08 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestam

p server option (see documentation for more details).2017-12-24 05:39:08 0 [Note] /usr/sbin/mysqld (mysqld 5.6.28) starting as process 1287 ...

2017-12-24 05:39:08 1287 [Note] InnoDB: Using atomics to ref count buffer pool pages

2017-12-24 05:39:08 1287 [Note] InnoDB: The InnoDB memory heap is disabled

2017-12-24 05:39:08 1287 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins

2017-12-24 05:39:08 1287 [Note] InnoDB: Memory barrier is not used

2017-12-24 05:39:08 1287 [Note] InnoDB: Compressed tables use zlib 1.2.3

2017-12-24 05:39:08 1287 [Note] InnoDB: Using Linux native AIO

2017-12-24 05:39:08 1287 [Note] InnoDB: Using CPU crc32 instructions

2017-12-24 05:39:08 1287 [Note] InnoDB: Initializing buffer pool, size = 128.0M

2017-12-24 05:39:08 1287 [Note] InnoDB: Completed initialization of buffer pool

2017-12-24 05:39:08 1287 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created

.............................

The latest information about MySQL is available on the web at

http://www.mysql.com

Support MySQL by buying support/licenses at http://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

4、上傳mysql配置文件my.cnf

[root@node001 ~]# cd /etc

上傳文件

[root@node001 etc]# ls /etc/my.cnf

/etc/my.cnf

5、初始化

[root@node001 etc]#/usr/bin/mysql_install_db

Installing MySQL system tables...2017-12-24 05:41:57 0 [Note] /usr/sbin/mysqld (mysqld 5.6.28-log) starting as process 1353 ...

2017-12-24 05:41:57 1353 [Note] InnoDB: Using atomics to ref count buffer pool pages

2017-12-24 05:41:57 1353 [Note] InnoDB: The InnoDB memory heap is disabled

2017-12-24 05:41:57 1353 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins

2017-12-24 05:41:57 1353 [Note] InnoDB: Memory barrier is not used

2017-12-24 05:41:57 1353 [Note] InnoDB: Compressed tables use zlib 1.2.3

2017-12-24 05:41:57 1353 [Note] InnoDB: Using Linux native AIO

2017-12-24 05:41:57 1353 [Note] InnoDB: Using CPU crc32 instructions

2017-12-24 05:41:57 1353 [Note] InnoDB: Initializing buffer pool, size = 64.0M

2017-12-24 05:41:57 1353 [Note] InnoDB: Completed initialization of buffer pool

2017-12-24 05:41:57 1353 [Note] InnoDB: Highest supported file format is Barracuda.

2017-12-24 05:41:57 1353 [Warning] InnoDB: Resizing redo log from 2*3072 to 3*2048 pages, LSN=1625987

....................

WARNING: Default config file /etc/my.cnf exists on the system

This file will be read by default by the MySQL server

If you do not want to use this, either remove it, or use the

--defaults-file argument to mysqld_safe when starting the server

6、 ?啟動(dòng)mysql

[root@node001 etc]# service mysql start

Starting MySQL....... SUCCESS!

7、重置密碼

查看初始化密碼

[root@node001 etc]# cat /root/.mysql_secret

# The random password set for the root user at Sun Dec 24 05:39:11 2017 (local time): DMBe85LznCxRo16N

[root@node001 etc]# mysql -u root -pDMBe85LznCxRo16N

Warning: Using a password on the command line interface can be insecure.

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

Your MySQL connection id is 2

Server version: 5.6.28-log

Copyright (c) 2000, 2015, 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>set password=password('mysql');

Query OK, 0 rows affected (0.00 sec)

mysql>show databases;

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

| Database |

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

| information_schema |

| mysql |

| performance_schema |

| test |

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

4 rows in set (0.00 sec)

8、遠(yuǎn)程授權(quán)

原因:默認(rèn)遠(yuǎn)程無(wú)法連接

授權(quán)命令:

mysql> grant all privileges on *.* to 'root'@'%' identified by 'mysql' with grant option;

Query OK, 0 rows affected (0.00 sec)

mysql>flush privileges;

Query OK, 0 rows affected (0.01 sec)

總結(jié)

以上是生活随笔為你收集整理的mysql-5.1.73-8.el6_在centos中安装mysql详细步骤说明的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。