zoukankan      html  css  js  c++  java
  • mysql复制学习二 安装及首次复制配置

    1. 安装

      下载rpm版本 server

      安装  rpm -ivh MySQL-server-5.5.24-1.linux2.6.i386.rpm 

      出错1

      error: Failed dependencies:
      MySQL conflicts with mysql-5.0.77-4.el5_4.2.x86_64
      MySQL conflicts with mysql-5.0.77-4.el5_4.2.i386

      [root@vm10100030 ~]# rpm -e mysql-5.0.77-4.el5_4.2.x86_64 --nodeps
      [root@vm10100030 ~]# rpm -e mysql-5.0.77-4.el5_4.2.i386 --nodeps

      卸载之,安装ok

      出错2

      找不到mysqladmin命命设置密码,用

      usr/bin/mysql_secure_installation 安装出现错误 

      ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

      是因为没有启动mysql  /etc/init.d/mysql start

      仍然出现无法连接问题

      安装客户端 rpm -ivh MySQL-client-5.5.24-1.linux2.6.i386.rpm 

    2. 设置root密码
      设置: /usr/bin/mysqladmin -u root password root

      更改密码方法1: /usr/bin/mysqladmin -u root -ppassword password newpassword

      方法2:

      mysql> use mysql; mysql> update user set password=PASSWORD("NEWPASSWORD") where User='vivek'; mysql> flush privileges; mysql> quit

      方法3 不知道旧密码重设mysql密码

      http://www.cyberciti.biz/tips/recover-mysql-root-password.html

      测试时出现了个很诡异的现象 在旧的ssh 终端始终无法登陆    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

      新开终端则可以登录上,没弄清原因。
      远程登录权限 grant select,update,insert,delete,create on *.* to root@ip identified by "root";

      http://www.sar4.com/2011/09/16/MYSQL%E5%AE%89%E5%85%A8%E8%AE%BE%E7%BD%AE.html  mysql安全设置

    3. 复制
      问题:找不到my.cnf的位置。
      MySQL 的复制(Replication),实际上就是通过将Master 端的Binlog 通过利用IO 线 程通过网络复制到Slave 端,然后再通过SQL 线程解析Binlog 中的日志再应用到数据库中来实现的

       

    mac 下 安装 mysql5.5 tar文件

    http://dev.mysql.com/doc/refman/5.5/en/binary-installation.html

    解压

    scripts/mysql_install_db --user=mysql

    shell> cp support-files/my-medium.cnf /etc/my.cnf

    shell> bin/mysqld_safe --user=mysql &

    # Next command is optional 

    cp support-files/mysql.server /etc/init.d/mysql.server

    cp bin/mysql /user/sbin/.

    设置密码 删掉旧用户即可

  • 相关阅读:
    Problem 3
    Problem 2
    Problem 1
    Python基础 装饰器
    算法——狄克斯特拉算法
    A Knight's Journey POJ 2488
    多校10 1007 CRB and Queries
    多校9 1007 Travelling Salesman Problem
    多校8 1008 Clock
    多校7 1005 The shortest problem
  • 原文地址:https://www.cnblogs.com/shenguanpu/p/2501012.html
Copyright © 2011-2022 走看看