文档章节

SLE12 Server 在线安装MySQL Server

m
 muman
发布于 2016/06/07 09:38
字数 1247
阅读 19
收藏 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

没有更多内容

加载失败,请刷新页面

加载更多

阿里面试题

https://yq.aliyun.com/articles/6656 https://yq.aliyun.com/articles/7468

jason_kiss
17分钟前
1
0
阿里云Redis读写分离典型场景:如何轻松搭建电商秒杀系统

背景 秒杀活动是绝大部分电商选择的低价促销,推广品牌的方式。不仅可以给平台带来用户量,还可以提高平台知名度。一个好的秒杀系统,可以提高平台系统的稳定性和公平性,获得更好的用户体验...

别打我会飞
24分钟前
2
0
188. jsp提出公共的资源

平时我们会在一个地方 写一些重复的东西,为了便于管理我们需要将它提炼出来 1. 问题现象 2. 解决方式 (1) 提炼出该内容 <script type="text/javascript"> var net ={url: "${pageContext....

Lucky_Me
31分钟前
0
0
集合

集合 集合 集合介绍 前面的学习,我们知道数据多了,使用数组存放。而且数组中存放的都是基本类型的数据,并且数组是定长的。当在程序中创建的对象比较多的时候,需要对这些对象进行统一的管...

码农屌丝
37分钟前
1
0
jsp页面手写翻页小记

<s:if test="totalPage > 1"> <tr align="center"> <td colspan="4" align="center" style="height: 25px; text-align: center;">......

JackChenzp
38分钟前
1
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部