centos 6.5下 mysql-community-server. 5.7.18-1.el6安装

[root@localhost ~]# rpm -e mysql // 普通删除模式[root@localhost ~]# rpm -e --nodeps mysql // 强力删除模式,如果使用上面命令删除时,提示有依赖的其它文件,则用该命令可以对其进行强力删除

1、例1:连接到本机上的MYSQL

[root@localhost ~]# yum localinstall mysql57-community-release-el6-10.noarch.rpmLoaded plugins: fastestmirror, refresh-packagekit, securitySetting up Local Package ProcessExamining mysql57-community-release-el6-10.noarch.rpm: mysql57-community-release-el6-10.noarchMarking mysql57-community-release-el6-10.noarch.rpm to be installedLoading mirror speeds from cached hostfile * base: mirrors.cn99.com * extras: mirrors.cn99.com * updates: mirrors.cn99.comResolving Dependencies-- Running transaction check--- Package mysql57-community-release.noarch 0:el6-10 will be installed-- Finished Dependency ResolutionDependencies Resolved=============================================================================================================================================================================================== Package Arch Version Repository Size===============================================================================================================================================================================================Installing: mysql57-community-release noarch el6-10 /mysql57-community-release-el6-10.noarch 30 kTransaction Summary===============================================================================================================================================================================================Install 1 Package(s)Total size: 30 kInstalled size: 30 kIs this ok [y/N]: yDownloading Packages:Running rpm_check_debugRunning Transaction TestTransaction Test SucceededRunning Transaction Installing : mysql57-community-release-el6-10.noarch 1/1 Verifying : mysql57-community-release-el6-10.noarch 1/1Installed: mysql57-community-release.noarch 0:el6-10 Complete!

service iptables restart OK,一切铺排完结,你能够访谈你的MySQL了~

Oracle is a registered trademark of Oracle Corporation and/or
itsaffiliates. Other names may be trademarks of their respectiveowners.

-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
mysql -uroot -pEnter password: Welcome to the MySQL monitor. Commands end with ; or g.Your MySQL connection id is 3Server version: 5.7.18 MySQL Community Server (GPL)

Type ‘help;’ or ‘h’ for help. Type ‘c’ to clear the current input
statement.

启动mysql

注意:扩张的吐放3306端口的言语应当要在icmp-host-prohibited此前

在剔除完事后我们能够通过
rpm -qa | grep mysql指令来查看mysql是不是早就卸载成功!!

[root@localhost ~]# yum repolist enabled|grep mysqlmysql-connectors-community MySQL Connectors Community 33mysql-tools-community MySQL Tools Community 47mysql57-community MySQL 5.7 Community Server 183

安装mysql

就算远程主机的IP为:10.0.0.1,客户名字为root,密码为123。则键入以下命令:

步入mysql安全模式

打开/etc/sysconfig/iptables

安装前装gcc全部包,幸免报错[www.6766.com ,Errno -1]centos 6.5下 mysql-community-server. 5.7.18-1.el6安装。 Package does not match intended
download

然后保留,并关闭该文件,在终端内运维上边的吩咐,刷新防火墙配置:

官方网址yum repository 下载安装包

[root@localhost yum.repos.d]# yum install gcc* 
[root@localhost yum.repos.d]# killall -TERM mysqld[root@localhost yum.repos.d]# mysqld_safe --skip-grant-tables &[1] 40422[root@localhost yum.repos.d]# 2017-04-25T07:45:39.222061Z mysqld_safe Logging to '/var/log/mysqld.log'.2017-04-25T07:45:39.246117Z mysqld_safe Starting mysqld daemon with databases from /var/lib/mysqlmysql -uroot -pEnter password:Welcome to the MySQL monitor. Commands end with ; or g.Your MySQL connection id is 3Server version: 5.7.18 MySQL Community Server (GPL)Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or 'h' for help. Type 'c' to clear the current input statement. mysql use mysqlReading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -ADatabase changedmysql select * from users;ERROR 1146 (42S02): Table 'mysql.users' doesn't existmysql select * from user;mysql update user set authentication_string=PASSWORD('mysql') where user='root';Query OK, 1 row affected, 1 warning (0.00 sec)Rows matched: 1 Changed: 1 Warnings: 1mysql quitBye[2]+ Exit 1 mysqld_safe --skip-grant-tables [root@localhost yum.repos.d]# service mysqld startStarting mysqld: [ OK ][root@localhost yum.repos.d]# mysql -uroot -pEnter password:Welcome to the MySQL monitor. Commands end with ; or g.Your MySQL connection id is 5Server version: 5.7.18 MySQL Community Server (GPL)Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
mysql -h10.0.0.1 -uroot -p123

地面安装下载下来的rpm包

以上所述是作者给我们介绍的centos 6.5下 mysql-community-server.
5.7.18-1.el6装置,希望对大家有着帮助,假使大家有任何疑问请给自家留言,我会及时复苏我们的。在这里也极其多谢大家对台本之家网址的支撑!

2、连接到长途主机上的MYSQL

构造防火墙

[root@localhost ~]# wget  --2017-04-24 18:53:49--  dev.mysql.com... 137.254.60.11Connecting to dev.mysql.com|137.254.60.11|:80... connected.HTTP request sent, awaiting response... 301 Moved PermanentlyLocation:  [following]--2017-04-24 18:53:49--  to dev.mysql.com|137.254.60.11|:443... connected.ERROR: certificate common name “” doesn't match requested host name “dev.mysql.com”.To connect to dev.mysql.com insecurely, use ‘--no-check-certificate'

mysql -h主机地址 -u客商名 -p顾客密码

[root@localhost yum.repos.d]# service mysqld start Initializing MySQL database: [ OK ]Installing validate password plugin: [ OK ]Starting mysqld: 
[root@localhost yum.repos.d]# yum install -y mysql-community-server Loaded plugins: fastestmirror, refresh-packagekit, securityLoading mirror speeds from cached hostfile * base: mirrors.cn99.com * extras: mirrors.cn99.com * updates: mirrors.cn99.comSetting up Install ProcessResolving Dependencies-- Running transaction check--- Package mysql-community-server.x86_64 0:5.7.18-1.el6 will be installed-- Processing Dependency: mysql-community-common(x86-64) = 5.7.18-1.el6 for package: mysql-community-server-5.7.18-1.el6.x86_64-- Processing Dependency: mysql-community-client(x86-64) = 5.7.9 for package: mysql-community-server-5.7.18-1.el6.x86_64-- Running transaction check--- Package mysql-community-client.x86_64 0:5.7.18-1.el6 will be installed-- Processing Dependency: mysql-community-libs(x86-64) = 5.7.9 for package: mysql-community-client-5.7.18-1.el6.x86_64--- Package mysql-community-common.x86_64 0:5.7.18-1.el6 will be installed-- Running transaction check--- Package mysql-community-libs.x86_64 0:5.7.18-1.el6 will be obsoleting--- Package mysql-libs.x86_64 0:5.1.71-1.el6 will be obsoleted-- Processing Dependency: libmysqlclient.so.16()(64bit) for package: 2:postfix-2.6.6-2.2.el6_1.x86_64-- Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for package: 2:postfix-2.6.6-2.2.el6_1.x86_64-- Running transaction check--- Package mysql-community-libs-compat.x86_64 0:5.7.18-1.el6 will be obsoleting--- Package postfix.x86_64 2:2.6.6-2.2.el6_1 will be updated--- Package postfix.x86_64 2:2.6.6-8.el6 will be an update-- Finished Dependency ResolutionDependencies Resolved============================================================================================================================= Package Arch Version Repository Size=============================================================================================================================Installing: mysql-community-libs x86_64 5.7.18-1.el6 mysql57-community 2.1 M replacing mysql-libs.x86_64 5.1.71-1.el6 mysql-community-libs-compat x86_64 5.7.18-1.el6 mysql57-community 1.6 M replacing mysql-libs.x86_64 5.1.71-1.el6 mysql-community-server x86_64 5.7.18-1.el6 mysql57-community 152 MInstalling for dependencies: mysql-community-client x86_64 5.7.18-1.el6 mysql57-community 23 M mysql-community-common x86_64 5.7.18-1.el6 mysql57-community 328 kUpdating for dependencies: postfix x86_64 2:2.6.6-8.el6 base 2.0 MTransaction Summary=============================================================================================================================Install 5 Package(s)Upgrade 1 Package(s)Total size: 180 MTotal download size: 152 MDownloading Packages:mysql-community-server-5.7.18-1.el6.x86_64.rpm | 152 MB 01:41 warning: rpmts_HdrFromFdno: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEYRetrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysqlImporting GPG key 0x5072E1F5: Userid : MySQL Release Engineering mysql-build@oss.oracle.com Package: mysql57-community-release-el6-10.noarch (@/mysql57-community-release-el6-10.noarch) From : /etc/pki/rpm-gpg/RPM-GPG-KEY-mysqlRunning rpm_check_debugRunning Transaction TestTransaction Test SucceededRunning Transaction Installing : mysql-community-common-5.7.18-1.el6.x86_64 1/8 Installing : mysql-community-libs-5.7.18-1.el6.x86_64 2/8 Installing : mysql-community-libs-compat-5.7.18-1.el6.x86_64 3/8 Installing : mysql-community-client-5.7.18-1.el6.x86_64 4/8 Installing : mysql-community-server-5.7.18-1.el6.x86_64 5/8 Updating : 2:postfix-2.6.6-8.el6.x86_64 6/8 Cleanup : 2:postfix-2.6.6-2.2.el6_1.x86_64 7/8 Erasing : mysql-libs-5.1.71-1.el6.x86_64 8/8 Verifying : 2:postfix-2.6.6-8.el6.x86_64 1/8 Verifying : mysql-community-libs-compat-5.7.18-1.el6.x86_64 2/8 Verifying : mysql-community-server-5.7.18-1.el6.x86_64 3/8 Verifying : mysql-community-libs-5.7.18-1.el6.x86_64 4/8 Verifying : mysql-community-common-5.7.18-1.el6.x86_64 5/8 Verifying : mysql-community-client-5.7.18-1.el6.x86_64 6/8 Verifying : 2:postfix-2.6.6-2.2.el6_1.x86_64 7/8 Verifying : mysql-libs-5.1.71-1.el6.x86_64 8/8Installed: mysql-community-libs.x86_64 0:5.7.18-1.el6 mysql-community-libs-compat.x86_64 0:5.7.18-1.el6 mysql-community-server.x86_64 0:5.7.18-1.el6 Dependency Installed: mysql-community-client.x86_64 0:5.7.18-1.el6 mysql-community-common.x86_64 0:5.7.18-1.el6 Dependency Updated: postfix.x86_64 2:2.6.6-8.el6 Replaced: mysql-libs.x86_64 0:5.1.71-1.el6 Complete!

找到mysql的装置目录,平日能够一贯键入命令mysql -uroot
-p,回车的前边提示您输密码,如若刚安装好MYSQL,一级客商root是未有密码的,故间接回车就能够踏入到MYSQL中

在“-A INPUT –m state –state NEW –m tcp –p tcp –dport 22 –j
ACCEPT”,下添加:

[root@localhost etc]# rpm -qa | grep mysql // 这个命令就会查看该操作系统上是否已经安装了mysql数据库

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

翻看可用的安装包

了,MYSQL的晋升符是:mysql

有的话,大家就通过rpm -e命令 或者rpm -e --nodeps指令来卸载掉

选取下边包车型地铁通令检查是还是不是安装有MySQL Server

防火墙的3306端口暗中认可未有拉开,若要远程访谈,须要开启这一个端口

相关文章

发表评论

电子邮件地址不会被公开。 必填项已用*标注

网站地图xml地图