文档章节

SLE12 Server 在线安装MySQL Server

m
 muman
发布于 2016/06/07 09:38
字数 1247
阅读 19
收藏 0
点赞 0
评论 0

1、确认是否安装了MYSQL 旧版本或应用

# rpm -qa|grep mysql

>libmysqlclient18-10.0.11-6.4.x86_64

>libqt4-sql-mysql-4.8.6-2.6.x86_64

 

2、卸载旧版本或应用

#rpm -ev libqt4-sql-mysql-4.8.6-2.6.x86_64

>Preparing packages...

>libqt4-sql-mysql-4.8.6-2.6.x86_64

 

# rpm -ev libmysqlclient18-10.0.11-6.4.x86_64

>Preparing packages...

>libmysqlclient18-10.0.11-6.4.x86_64

 

3、更新Zypper 库(Adding the MySQL SLES Repository)

# wget http://repo.mysql.com//mysql57-community-release-sles12-7.noarch.rpm

>--2016-05-12 22:06:11--  http://repo.mysql.com//mysql57-community-release-sles12-7.noarch.rpm

>Resolving repo.mysql.com (repo.mysql.com)... 23.13.185.161

>Connecting to repo.mysql.com (repo.mysql.com)|23.13.185.161|:80... connected.

>HTTP request sent, awaiting response... 200 OK

>Length: 8593 (8.4K) [application/x-redhat-package-manager]

>Saving to: mysql57-community-release-sles12-7.noarch.rpm?

>

>100%[======================================>] 8,593       --.-K/s   in 0s     

>

>2016-05-12 22:06:11 (97.5 MB/s) - 鈓ysql57-community-release-sles12-7.noarch.rpm?saved [8593/8593]

 

# rpm -Uvh mysql57-community-release-sles12-7.noarch.rpm

>warning: mysql57-community-release-sles12-7.noarch.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

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

>Updating / installing...

>  1:mysql57-community-release-sles12-################################# [100%]

 

# zypper repos|grep mysql.*community

>2 | mysql-connectors-community              | MySQL Connectors Community                  | Yes     | No    

>3 | mysql-connectors-community-source | MySQL Connectors Community - Source   | No      | No    

>4 | mysql-tools-community                         | MySQL Tools Community                             | Yes     | No    

>5 | mysql-tools-community-source            | MySQL Tools Community - Source              | No      | No    

>6 | mysql56-community                               | MySQL 5.6 Community Server                     | No      | No    

>7 | mysql56-community-source                  | MySQL 5.6 Community Server - Source      | No      | No    

>8 | mysql57-community                               | MySQL 5.7 Community Server                      | Yes     | No    

>9 | mysql57-community-source                  | MySQL 5.7 Community Server - Source       | No      | No    

 

*本次安装mysql57-community  如果为非Yes 则需要使用以下命令

# zypper repos -E |grep mysql57-community

>8 | mysql57-community                               | MySQL 5.7 Community Server                      | Yes     | No    

*使用以下命令是禁止

>mysqlrouter01:~ # sudo zypper modifyrepo -d mysql57-community

>Repository 'mysql57-community' has been successfully disabled.

*使用以下命令是允许

# sudo zypper modifyrepo -e mysql57-community

>Repository 'mysql57-community' has been successfully enabled.

 

# sudo zypper refresh

>Repository 'SLES12-12-0' is up to date.

>Retrieving repository 'MySQL Connectors Community' metadata ----------------------------------------------------[\]

>File 'repomd.xml' from repository 'MySQL Connectors Community' is signed with an unknown key '8C718D3B5072E1F5'. >>Continue? [yes/no] (no): yes

>Retrieving repository 'MySQL Connectors Community' metadata .................................................[done]

>Building repository 'MySQL Connectors Community' cache ......................................................[done]

>Retrieving repository 'MySQL Tools Community' metadata ---------------------------------------------------------[/]

>File 'repomd.xml' from repository 'MySQL Tools Community' is signed with an unknown key '8C718D3B5072E1F5'. Continue? [yes/no] (no): yes

>Retrieving repository 'MySQL Tools Community' metadata ......................................................[done]

>Building repository 'MySQL Tools Community' cache ...........................................................[done]

>Retrieving repository 'MySQL 5.7 Community Server' metadata ----------------------------------------------------[/]

>File 'repomd.xml' from repository 'MySQL 5.7 Community Server' is signed with an unknown key '8C718D3B5072E1F5'. Continue? [yes/no] (no): yes

>Retrieving repository 'MySQL 5.7 Community Server' metadata .................................................[done]

>Building repository 'MySQL 5.7 Community Server' cache ......................................................[done]

>All repositories have been refreshed.

 

4、安装MySQL 5.7 Server (Installing MySQL with Zypper)

# sudo zypper install mysql-community-server

>Loading repository data...

>Reading installed packages...

>Resolving package dependencies...

>

>The following 4 NEW packages are going to be installed:

>  mysql-community-client mysql-community-common mysql-community-libs mysql-community-server

>

>4 new packages to install.

>Overall download size: 148.6 MiB. Already cached: 227.1 KiB  After the operation, additional 801.7 MiB will be

used.

>Continue? [y/n/? shows all options] (y): y

>In cache mysql-community-common-5.7.12-1.sles12.x86_64.rpm                    (1/4), 227.1 KiB (  2.5 MiB unpacked)

>Retrieving package mysql-community-libs-5.7.12-1.sles12.x86_64                     (2/4),   1.9 MiB (  9.4 MiB unpacked)

>Retrieving: mysql-community-libs-5.7.12-1.sles12.x86_64.rpm .....................................[done (9.0 KiB/s)]

>Retrieving package mysql-community-client-5.7.12-1.sles12.x86_64                  (3/4),  21.3 MiB (105.3 MiB unpacked)

>Retrieving: mysql-community-client-5.7.12-1.sles12.x86_64.rpm ..................................[done (45.8 KiB/s)]

>Retrieving package mysql-community-server-5.7.12-1.sles12.x86_64                (4/4), 125.4 MiB (684.5 MiB unpacked)

>Retrieving: mysql-community-server-5.7.12-1.sles12.x86_64.rpm ..................................[done (23.9 KiB/s)]

>Checking for file conflicts: ................................................................................[done]

>(1/4) Installing: mysql-community-common-5.7.12-1.sles12 ....................................................[done]

>Additional rpm output:

>warning: /var/cache/zypp/packages/mysql57-community/mysql-community-common-5.7.12-1.sles12.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

>

>

>(2/4) Installing: mysql-community-libs-5.7.12-1.sles12 ......................................................[done]

>Additional rpm output:

>warning: /var/cache/zypp/packages/mysql57-community/mysql-community-libs-5.7.12-1.sles12.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

>

>

>(3/4) Installing: mysql-community-client-5.7.12-1.sles12 ....................................................[done]

>Additional rpm output:

>warning: /var/cache/zypp/packages/mysql57-community/mysql-community-client-5.7.12-1.sles12.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

>

>

>(4/4) Installing: mysql-community-server-5.7.12-1.sles12 ....................................................[done]

>Additional rpm output:

>warning: /var/cache/zypp/packages/mysql57-community/mysql-community-server-5.7.12-1.sles12.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

 

5、初始化配置MySQL 5.7 (Starting the MySQL Server)

# sudo service mysql stop

# sudo service mysql start

 

*查询安装系统时所生成的随机密码

# grep "password" /var/log/mysql/mysqld.log

2016-05-12T15:35:31.600553Z 1 [Note] A temporary password is generated for root@localhost : tcODfg>mw2qm

 

# mysql -uroot -p                             --密码为所查询到的随机密码

>Enter password:

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

>Your MySQL connection id is 7

>Server version: 5.7.12

>

>Copyright (c) 2000, 2016, 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.

 

 *测试一下,报错ERROR 1820 (HY000)

mysql> select 1;                                                                                                                         

>ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

 

*初始化密码,密码复杂性报错

mysql> set password=PASSWORD('root123');                                                             

>ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

 

这个其实与validate_password_policy的值有关。

validate_password_policy有以下取值:

Policy

Tests Performed

0 or LOW

Length

1 or MEDIUM

Length; numeric, lowercase/uppercase, and special characters

2 or STRONG

Length; numeric, lowercase/uppercase, and special characters; dictionary file

默认为:1 or MEDIUM

 

*修改密码复杂性值:0 or LOW

mysql> set global validate_password_policy=0;

> Query OK, 0 rows affected (0.00 sec)

*以下命令在未进行root密码初始化的情况下,未必会执行成功,只需明白已将密码复杂性改为必须为8位以上的密码

mysql> select @@validate_password_length;

>+----------------------------+

>| @@validate_password_length |

>+----------------------------+

>|                          8 |

>+----------------------------+

>1 row in set (0.00 sec)

 

*修改初始密码;

mysql> SET PASSWORD = PASSWORD('root123456');

>Query OK, 0 rows affected, 1 warning (0.01 sec)

 

 *再次测试,结果如下

mysql> select 1;

> +---+

>| 1 |

>+---+

>| 1 |

>+---+

>1 row in set (0.00 sec)

 

mysql> show databases;

>+--------------------+

>| Database           |

>+--------------------+

>| information_schema |

>| mysql              |

>| performance_schema |

>| sys                |

>+--------------------+

>4 rows in set (0.00 sec)

 

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> show tables;

>+---------------------------+

>| Tables_in_mysql           |

>+---------------------------+

>| columns_priv              |

>| db                        |

>| engine_cost               |

>| event                     |

>| func                      |

>| general_log               |

>| gtid_executed             |

>| help_category             |

>| help_keyword              |

>| help_relation             |

>| help_topic                |

>| innodb_index_stats        |

>| innodb_table_stats        |

>| ndb_binlog_index          |

>| plugin                    |

>| proc                      |

>| procs_priv                |

>| proxies_priv              |

>| server_cost               |

>| servers                   |

>| slave_master_info         |

>| slave_relay_log_info      |

>| slave_worker_info         |

>| slow_log                  |

>| tables_priv               |

>| time_zone                 |

>| time_zone_leap_second     |

>| time_zone_name            |

>| time_zone_transition      |

>| time_zone_transition_type |

>| user                      |

>+---------------------------+

>31 rows in set (0.00 sec)

 

mysql> quit

>Bye

© 著作权归作者所有

共有 人打赏支持
m
粉丝 0
博文 1
码字总数 1247
作品 0
杭州
ubuntu安装msyql

在线下载各种包 1, 保证系统在线,可以访问互联网,有域名服务器 2, Sudo vi /etc/resolv.conf,在最后一行加nameserver8.8.8.8(或者电脑所在局域网的域名服务器) 3, Sudo apt-get upd...

清城北苑
2017/03/10
0
0
centos7 安装MySQL报错No package mysql-server available

在CentOS7上安装mysql时,如果出现了以下截图的提示: 排错方案有三种:(当前截图属于第三种由于系统原因) 1、没有在线源或者未连接外网2、本地光盘未挂载或者光盘内置包不全3、系统升级是...

留言非雨
01/03
0
0
centos6、7在线升级mysql到mysql5.7

centos7对mysql进行在线升级: ①下载mysql源 wget http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm ②安装mysql5.7源 yum localinstall -y mysql57-community-releas......

LUksl
06/26
0
0
ubuntu服务器mysql管理 第一弹

第一弹、在Ubuntu服务器上安装MySQL 注:服务器管理通过SecureCRT来管理操作。 由于Linux的强大,对于大多数的应用都可以通过命令来安装、升级、卸载等操作。MySQL当然也支持在线安装。 在命...

FrendLin
2016/06/22
7
0
搭建Tigase jaxmpp使用

假设本机已经成功安装了MySQL数据库 A:搭建Tigase 官方安装文档:http://www.tigase.org/content/manual-installation-console-mode 1:下载架包并解压缩 /usr/local/tigase-server-5.1.4-b...

丁佳辉
2016/06/08
79
0
CentOS-7下安装MySQL5.6.22

一 安装环境 (1)CentOS版本:CentOS-7 查看方法: [root@bogon 桌面]# cat /etc/redhat-release CentOS Linux release 7.0.1406 (Core) 来源:官网下载 下载地址:http://www.centos.org/ ......

ffredy
2015/06/18
0
0
虚拟主机面板 easypanel 1.9.0 发布

easypanel 是一款免费的集开通虚拟主机,ftp空间,数据库等功能为一体的虚拟主机控制面板 , 具备跨平台(windows,linux),安全稳定、操作简便等特点。支持php(windows版本还支持asp,asp.net),支持...

keengo
2012/02/16
1K
1
CentOS6.8下快速安装Discuz3.2,速成!!

一、安装需要工具:Centos6.8(64bit)+nginx+php+php-fpm(php与nginx对接服务,也叫CGI)+php-mysql+mysql 二、安装相关服务 1、源码安装nginx,一般安装流程为./configure(检查配置) -->make(编译...

icestick8586
2017/03/14
0
0
Cloudera Manager5.8.1安装

环境准备 1. 要求主服务器内存在10G以上(如果没有10g,可能后续会出错); 2. 关闭防火墙 service iptables stop chkconfig iptables off 3. 修改/etc/selinux/config 文件 将SELINUX=enforcing...

sinama
2016/09/20
44
0
FastDFS 5.5 安装与配置

FastDFS功能简介: FastDFS是一个开源的轻量级分布式文件系统,它对文件进行管理,功能包括:文件存储、文件同步、文件访问(文件上传、文件下载)等,解决了大容量存储和负载均衡的问题。特...

sxguop
2016/04/19
0
0

没有更多内容

加载失败,请刷新页面

加载更多

下一页

python上传文件

//注意 <form action="/login/" method="post" enctype="multipart/form-data"> f=request.FILES.get('fafa') ff=open(f.name,mode='wb') for i in f.chunks(): ff.write(i) ff.close()......

南桥北木
7分钟前
0
0
CISCO VPN Client Reason 442 WIN8/10错误解决方案

http://jdkleo.iteye.com/blog/2163493 引用 http://my.oschina.net/cloudcoder/blog/220391?p={{currentPage 1}} 在使用cisco VPN 客户端登录时,产生Reason 442:Failedto enable Virtual......

chenfj_fer
10分钟前
0
0
信号量有没有容量限制?

之前一直误以为信号量初始化的时候那个初始化的值是信号量的“容量”,昨天同事指出了我的错误,最初我是不相信的,经过以下代码实践,证明了我的错误: Java版: import java.util.concurr...

锟斤拷烫烫烫
14分钟前
0
0
【RocketMQ】Message存储笔记

概述 消息中间件存储分为三种,一是保存在内存中,速度快但会因为系统宕机等因素造成消息丢失;二是保存在内存中,同时定时将消息写入DB中,好处是持久化消息,如何读写DB是MQ的瓶颈;三是内...

SaintTinyBoy
25分钟前
0
0
Android应用Context详解及源码解析

Android应用Context详解及源码解析 本文定位:优质文章收集 本文转载 1 背景 今天突然想起之前在上家公司(做TV与BOX盒子)时有好几个人问过我关于Android的Context到底是啥的问题,所以就马...

lichuangnk
56分钟前
0
0
PostgreSQL的昨天今天和明天

PostgreSQL 是一种非常复杂的对象-关系型数据库管理系统(ORDBMS), 也是目前功能最强大,特性最丰富和最复杂的自由软件数据库系统。有些特性甚至连商业数据库都不具备。 这个起源于伯克利(...

闻术苑
今天
1
0
Mysql对自增主键ID进行重新排序

1,删除原有主键: ALTER TABLE `table_name` DROP `id`; 2,添加新主键字段: ALTER TABLE `table_name` ADD `id` MEDIUMINT( 8 ) NOT NULL FIRST; 3,设置新主键: ALTER TABLE `table_nam......

niithub
今天
0
0
福利篇:免费csdn vip账号分享

分享一个发布免费csdn vip账号的网站:啰嗦vip www.lostvip.com , 各种软件开发类的视频教程:慕课网、动脑学院、黑马各大培训机构VIP视频教程,非常不错!

在水一方发盐人
今天
0
0
Nginx+Tomcat搭建高性能负载均衡集群

一、 工具   nginx-1.8.0   apache-tomcat-6.0.33 二、 目标   实现高性能负载均衡的Tomcat集群:    三、 步骤   1、首先下载Nginx,要下载稳定版:      2、然后解压两个Tom...

码代码的小司机
今天
0
0
Centos7编译安装ntp-4.2.8p11

Centos7编译安装ntp-4.2.8p11 背景 因公司做等保评级,在进行安全漏洞检测时发现ntp需要升级到ntp-4.2.7p25以上版本,经过一番搜索,没有该版本及新版本ntp的yum安装包,所以只能编译安装了,...

阿dai
今天
0
0

没有更多内容

加载失败,请刷新页面

加载更多

下一页

返回顶部
顶部