CentOS7.5安装Mysql5.5.6

环境

centos 7.5
MySQL-server-5.6.24-1.el6.x86_64.rpm

卸载

rpm -qa|grep -i mysql 查找mysql 是否已经安装
rpm -ev 卸载查询到的软件包名

重新安装操作
find / -name mysql
rm -rf 删除所有搜索到的mysql文件

依赖

需要安装 perl依赖,否则安装完成无法自动部署
yum -y install autoconf

安装mysql

出现以下提示 安装成功

[root@dw-node02 mysql-libs]# rpm -ivh MySQL-server-5.6.24-1.el6.x86_64.rpm 


...   ..... 
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.

See the manual for more instructions.

Please report any problems at http://bugs.mysql.com/

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

安装成功查看自动生成的密码

cat /root/.mysql_secret

服务相关

systemctl status mysql
systemctl start mysql
systemctl stop mysql

安装客户端

[root@dw-node02 mysql-libs]# rpm -ivh MySQL-client-5.6.24-1.el6.x86_64.rpm

修改密码等信息

[root@dw-node02 mysql-libs]# mysql -uroot -pT1prxVZGq3I0wEMP
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 1
Server version: 5.6.24

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('000000');

mysql>update user set host='%' where host='localhost';

mysql>desc user;

mysql>delete from user where Host='dw-node01';
mysql>delete from user where Host='127.0.0.1';
mysql>delete from user where Host='::1';

mysql>flush privileges;

mysql>quit;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值