mysql创建master/slave详细步骤

来源:站长家园 时间:2011-05-21 15:29:00 

尝试安装server

[justin@xen20-vm04 "]$ rpm -ivh MySQL-server-5.1.51-1.glibc23.x86_64.rpm

error: Failed dependencies:

MySQL conflicts with mysql-5.0.45-7.el5.x86_64

报错冲突

[justin@xen20-vm04 "]$ rpm -qa | grep -i mysql

mysql-5.0.45-7.el5

卸载已有版本

[justin@xen19-vm04 "]$ rpm -e mysql-5.0.45-7.el5

error: package mysql-5.0.45-7.el5 is not installed

进入root用户

[justin@xen19-vm04 "]$ sudo su -

Password:

[root@xen20-vm04 justin]# rpm -e mysql-5.0.45-7.el5

[root@xen20-vm04 justin]# rpm -qa | grep -i mysql

现在重新安装

[root@xen20-vm04 justin]# rpm -ivh MySQL-server-5.1.51-1.glibc23.x86_64.rpm

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

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

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !

To do so, start the server, then issue the following commands:

/usr/bin/mysqladmin -u root password "new-password"

/usr/bin/mysqladmin -u root -h xen20-vm04 password "new-password"

Alternatively you can run:

/usr/bin/mysql_secure_installation

which will also give you the option of removing the test

databases and anonymous user created by default. This is

strongly recommended for production servers.

See the manual for more instructions.

Please report any problems with the /usr/bin/mysqlbug script!

Starting MySQL.[ OK ]

安装完成后找不到/ect/my.cnf文件

Linux下用rpm包安装的MySQL是不会安装/etc/my.cnf文件的,

至于为什么没有这个文件而MySQL却也能正常启动和作用,在点有两个说法,

第一种说法,my.cnf只是MySQL启动时的一个参数文件,可以没有它,这时MySQL会用内置的默认参数启动,

第二种说法,MySQL在启动时自动使用/usr/share/mysql目录下的my-medium.cnf文件,这种说法仅限于rpm包安装的MySQL,

解决方法,只需要复制一个/usr/share/mysql目录下的.cnf文件到/etc目录,并改名为my.cnf即可

标签:mysql,数据库
0
投稿

猜你喜欢

  • 在ASP.NET 2.0中操作数据之四:使用ObjectDataSource展现数据

    2024-05-13 09:15:45
  • Python PyPDF2模块安装使用解析

    2023-02-27 15:13:52
  • js加密页面代码生成器

    2007-10-12 13:40:00
  • python如何实现代码检查

    2022-07-22 18:19:12
  • python项目打包成exe和安装包的方法步骤

    2023-06-29 08:37:21
  • javascript游戏开发之《三国志曹操传》零部件开发(一)让静态人物动起来

    2024-04-10 13:58:29
  • python 绘图模块matplotlib的使用简介

    2023-08-09 19:09:01
  • Golang开发库的集合及作用说明

    2024-02-01 08:03:24
  • SQL Server双服务器架设并数据自动同步教程

    2023-07-03 02:59:53
  • 使用Python制作新型冠状病毒实时疫情图

    2023-03-01 20:17:19
  • volatile保证可见性及重排序方法

    2022-07-22 03:14:59
  • asp函数判断服务器是否安装了某种组件

    2008-10-11 14:45:00
  • 如何利用Python模拟GitHub登录详解

    2023-11-18 11:08:05
  • PHP composer更新指定依赖包过程详细讲解

    2023-05-27 18:05:34
  • Vue 搭建Vuex环境详解

    2024-04-10 13:48:59
  • MySQL数据库优化经验详谈

    2009-12-15 10:34:00
  • Go语言实现遗传算法的实例代码

    2024-02-10 01:04:54
  • 基于Go语言实现选择排序算法及优化

    2024-04-26 17:36:34
  • php字符串截取函数mb_substr用法实例分析

    2024-05-02 17:35:09
  • 用python查找统一局域网下ip对应的mac地址

    2023-01-23 19:10:21
  • asp之家 网络编程 m.aspxhome.com