centos6.5安装mysql5.6

1.先下载mysql5.6的rpm 

链接:https://pan.baidu.com/s/1atBhYURE_EPOVgS6TGEnXQ 密码:8nzq

2.将mysql文件上传至虚拟机

3. 查看centos安装的mysql

[root@localhost local]# rpm -qa|grep mysql
mysql-libs-5.1.71-1.el6.x86_64

4.卸载mysql

[root@localhost local]# rpm -e --nodeps mysql-libs-5.1.71-1.el6.x86_64

5.解压mysql

[root@localhost mysql]# tar -xvf MySQL-5.6.39-1.el6.x86_64.rpm-bundle.tar 
MySQL-embedded-5.6.39-1.el6.x86_64.rpm
MySQL-test-5.6.39-1.el6.x86_64.rpm
MySQL-shared-5.6.39-1.el6.x86_64.rpm
MySQL-server-5.6.39-1.el6.x86_64.rpm
MySQL-devel-5.6.39-1.el6.x86_64.rpm
MySQL-client-5.6.39-1.el6.x86_64.rpm
MySQL-shared-compat-5.6.39-1.el6.x86_64.rpm

6.通过rpm -ivh安装(按照顺序)

[root@localhost mysql]# rpm -ivh MySQL-client-5.6.39-1.el6.x86_64.rpm 

[root@localhost mysql]# rpm -ivh MySQL-devel-5.6.39-1.el6.x86_64.rpm 

[root@localhost mysql]# rpm -ivh MySQL-server-5.6.39-1.el6.x86_64.rpm 

[root@localhost mysql]# rpm -ivh MySQL-shared-5.6.39-1.el6.x86_64.rpm 

7. mysql5.6数据库会自动生成随机密码, 通过安装的日志查询到密码在 /root/.mysql_secret  文件里

.

8. 复制生成的随机密码

[root@localhost ~]# cat .mysql_secret 
# The random password set for the root user at Sat Sep 15 11:25:09 2018 (local time): 0NHZ5NAnEpBNDBBT

9.启动mysql 

[root@localhost ~]# service mysql start

10.第一次密码就使用刚拷贝.mysql_secret文件里的随机密码:0NHZ5NAnEpBNDBBT

[root@localhost ~]# mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.39

Copyright (c) 2000, 2018, 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> exit
Bye

11.设置密码

mysql> set password = password('123456');

Query OK, 0 rows affected (0.01 sec)

mysql> exit
Bye

12.添加服务 和开机自启

[root@localhost ~]# chkconfig --add mysql
[root@localhost ~]# chkconfig mysql on

13. 这时候通过navicat 链接数据库还是链接不了 ,进入mysql设置连接用户

mysql> grant all privileges on *.* to 'root' @'%' identified by '123456';
Query OK, 0 rows affected (0.01 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> exit
Bye

14.开放系统端口

[root@localhost ~]# /sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
[root@localhost ~]# /etc/rc.d/init.d/iptables save
iptables: Saving firewall rules to /etc/sysconfig/iptables:[  OK  ]

完成 !

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
在Linux CentOS 6.5上安装.rpm文件的步骤如下: 1. 首先,下载.rpm文件。可以使用wget命令从指定的URL下载.rpm文件。例如,使用以下命令下载mysql-community-release-el6-5.noarch.rpm文件: ``` wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm ``` 2. 下载完成后,使用rpm命令安装.rpm文件。执行以下命令: ``` rpm -ivh mysql-community-release-el6-5.noarch.rpm ``` 3. 这个命令将在/etc/yum.repos.d/目录下创建两个yum源文件:mysql-community-source.repo和mysql-community.repo。这些文件将用于安装MySQL。 4. 安装完成后,可以使用rpm -qa命令来验证安装是否成功。例如,执行以下命令来查找已安装MySQL相关软件包: ``` rpm -qa | grep mysql ``` 以上是在CentOS 6.5上安装.rpm文件的步骤。请注意,下载速度可能会受到网络连接的影响,因为MySQL的yum源服务器位于国外。\[1\]\[2\]\[3\] #### 引用[.reference_title] - *1* *3* [linux CentOS6.5 yum安装mysql 5.6](https://blog.csdn.net/yaca/article/details/78295691)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [安装Centos6.5 安装Oracle 11g详细过程](https://blog.csdn.net/weixin_32161697/article/details/116442491)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值