redhat6.3安装MySQL-server-5.6.13-1.el6.x86_64.rpm

 

首先下载下面三个文件:

 

[plain] 

MySQL-client-5.6.13-1.el6.x86_64.rpm  

MySQL-devel-5.6.13-1.el6.x86_64.rpm  

MySQL-server-5.6.13-1.el6.x86_64.rpm  

然后使用root账号登陆,进行安装:

1. 安装server、devel、client:1. 安装server、devel、client:

 

rpm -ivh --replacefiles MySQL-s*.rpm 

rpm -ivh --replacefiles MySQL-d*.rpm

 

rpm -ivh --replacefiles MySQL-c*.rpm

 

 

[root@localhost download]# rpm -ivh --replacefiles MySQL-server-5.6.13-1.el6.x86_64.rpm   

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

   1:MySQL-server           ########################################### [100%]  

[root@localhost download]# rpm -ivh --replacefiles MySQL-client-5.6.13-1.el6.x86_64.rpm   

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

   1:MySQL-client           ########################################### [100%]  

[root@localhost download]# rpm -ivh --replacefiles MySQL-devel-5.6.13-1.el6.x86_64.rpm   

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

   1:MySQL-devel            ########################################### [100%]

要移除安装可以使用 rpm -e MySQL-server  、 rpm -e MySQL-devel、MySQL-client即可;

2. 初始化数据库: 

 

/usr/bin/mysql_install_db 

 

3. 启动mysql服务:

 

service mysql start

 

使用命令ps -ef | grep mysql 查看mysql进程:

 

 

[root@localhost ~]# ps -ef | grep mysql  

root     26047     1  0 18:14 pts/12   00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/localhost.localdomain.pid  

mysql    26227 26047  0 18:14 pts/12   00:00:01 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/log/mysqld.log --pid-file=/var/lib/mysql/localhost.localdomain.pid --socket=/var/lib/mysql/mysql.sock  

root     26545 24726  0 18:27 pts/8    00:00:00 grep mysql

4.第一次登陆设置root密码:

首先查看 cat /root/.mysql_secret

 

 

root@localhost ~]# cat /root/.mysql_secret   

# The random password set for the root user at Fri Aug 30 15:57:18 2013 (local time): fMYcarvB

然后命令行:mysql -u root -p ,然后输入上面的密码即可:

 

[root@localhost ~]# mysql -u root -p  

Enter password:   

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

Your MySQL connection id is 5  

Server version: 5.6.13 MySQL Community Server (GPL)  

  

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

设置root密码: 

 

mysql> use mysql  

Database changed  

mysql> update user set password=password('root') where user='root';  

Query OK, 0 rows affected (0.15 sec)  

Rows matched: 5  Changed: 0  Warnings: 0  

  

mysql> flush privileges;  

Query OK, 0 rows affected (0.00 sec)

退出,重新登陆即可使用新的密码登陆;

5. 设置远程登陆:

 

使用root登陆到mysql后

 

 

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

ERROR 1062 (23000): Duplicate entry '%-root' for key 'PRIMARY'  

mysql> select host,user from user;  

+-----------------------+------+  

| host                  | user |  

+-----------------------+------+  

| %                     | root |  

| 127.0.0.1             | root |  

| 192.168.128.142       | root |  

| ::1                   | root |  

| localhost.localdomain | root |  

+-----------------------+------+  

5 rows in set (0.00 sec)

然后:  

 

mysql> grant all privileges on *.* to 'root'@'%' with grant option;  

Query OK, 0 rows affected (0.08 sec)  

  

mysql> exit  

Bye  

[root@localhost ~]# service mysql restart  

Shutting down MySQL.. SUCCESS!   

Starting MySQL.. SUCCESS!   

重启mysql即可远程登陆。

service mysql start出错,mysql启动不了,解决mysql: unrecognized service错误

service mysql start出错,mysql启动不了,解决mysql: unrecognized service错误的方法如下:

[root@ctohome.com ~]# service mysql start
mysql: unrecognized service
[root@ctohome.com ~]# service mysql restart
mysql: unrecognized service [root@ctohome.com ~]# rpm -q mysql 查询发现mysql已经正常安装
mysql-5.1.-jason. [root@ctohome.com ~]# /etc/rc.d/init.d/mysqld start 直接启动没问题
Starting mysqld: [ OK ] [root@ctohome.com ~]# ls /etc/rc.d/init.d/mysqld -l
-rwxr-xr-x root root Dec : /etc/rc.d/init.d/mysqld [root@ctohome.com ~]# chkconfig mysqld on 设置mysql开机启动 [root@ctohome.com ~]# chmod /etc/rc.d/init.d/mysqld 修改mysqld执行权限 [root@ctohome.com ~]# service mysqld start 搞定
Starting mysqld: [ OK ]
[root@ctohome.com ~]# service mysqld start
Starting mysqld: [ OK ]
[root@ctohome.com ~]# service mysqld status
mysqld (pid ) is running...

redhat6.3安装MySQL-server-5.6.13-1.el6.x86_64.rpm的更多相关文章

  1. 安装mysql警告 warning: mysql-community-server-5.7.19-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

    摘自:https://www.cnblogs.com/royfans/p/7243641.html 红帽安装rpm安装MySQL时爆出警告: 警告:MySQL-server-5.5.46-1.linu ...

  2. ubuntu 14.04 安装mysql server初级教程

    序,mysql数据库是开源的,被大多数企业所使用 目录 一.apt-get install 软件安装原理剖析二.安装mysql server三.配置和管理msyql 一.apt-get install ...

  3. 在centos中php 在连接mysql的时候,出现Can't connect to MySQL server on 'XXX' (13)

    原文连接:http://hi.baidu.com/zwfec/item/64ef5ed9bf1cb3feca0c397c 红色的是命令 SQLSTATE[HY000] [2003] Can't con ...

  4. SQLSTATE[HY000] [2003] Can't connect to MySQL server on 'XXX' (13)

    SQLSTATE[HY000] [2003] Can't connect to MySQL server on 'XXX' (13) 我可以真见识了 SELinux 的利害了, 这个问题让我找了好长时 ...

  5. CentOS 7 安装MySql Server 5.6

    1. 安装MySql Server 在/etc/yum.repos.d/目录下添加以下文件mysql-community.repo文件,内容如下: [mysql56-community] name=M ...

  6. Centos 7 官网下载安装mysql server 5.6

    Centos 7 官网下载安装 mysql server # wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rp ...

  7. 安装MySQL Server

    之前安装了MySQL Workbench 8.0 CE,现在来安装MySQL Server. 点击 add next next next     完成 MySQL安装包地址: 链接:https://p ...

  8. RedHat 6.3安装MySQL-server-5.6.13-1.el6.x86_64.rpm

     在RedHat 6.3下安装MySQL-server-5.6.13-1.el6.x86_64.rpm 首先下载下面三个文件: MySQL-client-5.6.13-1.el6.x86_64.rpm ...

  9. hive0.13.1安装-mysql server作为hive的metastore

    hive0.13.1在hadoop2.4.1伪分布式部署上安装过程 环境:redhat enterprice 6.5 +hadoop2.4.1+hive0.13.1+mysql单节点伪分布式部署 相关 ...

随机推荐

  1. profile

    项目开发中,使用git最为版本控制工具,往往会建立开发分支.测试分支和生产分支. 各个分支的数据库url,所依赖的接口url可能不同,直接配置的话,在合并分支时往往出现冲突.使用profile可以有效 ...

  2. 打包成zip

    protected void btnExportZip_Click(object sender,EventArgs e) { string archiveName=String.Format(&quo ...

  3. 奥迪--A6L

    -型号:A6L -价格:42-75W -动力:1.8T/2.5L/3T -变速箱:7挡双离合/CVT无级变速/7挡双离合 -长宽高:5.04,1.87,1.47 -油箱:75L -发动机:EA888 ...

  4. 验证一个字符串是否由数字组成(Java)

    public class StringDemo{ public static void main(String args[]){ String str ="12343264sd6223&qu ...

  5. EntityFramework 实体拆分与表拆分

    摘录自https://msdn.microsoft.com/zh-cn/data/jj591617 * 将实体类型的 CLR 属性映射到数据库中的多个表(实体拆分) 实体拆分允许一个实体类型的属性分散 ...

  6. spring 以Ant Build方式运行build.xml文件,报warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds 的解决办法

    Buildfile: F:\experience\spring_pdf\sourcecode\example1\build.xml compile: [javac] F:\experience\spr ...

  7. HttpURLConnection请求

    方法调用: //测试 public static void main(String[] args) { Map map = new HashMap(); map.put("type" ...

  8. mac上卸载oracle jdk 1.8.0_31

    mac上卸载oracle jdk 1.8.0_31版本,因为版本太高了.得安装旧版本才行.卸载的顺序是:进入finder,然后点应用程序,按command+向上箭头键,分别进入根目录的系统与资源库找到 ...

  9. Centos7安装配置NFS服务和挂载

    现在有3台服务器 s1(主),s2(从), s3(从)需要实现文件实时同步,我们可以安装Nfs服务端和客户端来实现! 一.安装 NFS 服务器所需的软件包:   1 yum install -y nf ...

  10. MetInfo数据库结构表

    met_admin_table 表 Key 字段名称 数据类型 不为空 默认值 说明 PK id INT(11) Yes   编号   admin_type TEXT Yes   管理员类型   ad ...