网络编程
位置:首页>> 网络编程>> 数据库>> mysql创建master/slave详细步骤

mysql创建master/slave详细步骤

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

标签:mysql,数据库

尝试安装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即可

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com