大鸟的学习乐园
路漫漫其修远兮,吾将上下而求索
posts - 26,comments - 27,trackbacks - 0

h1. MySQL5.1.53编译,安装配置

 

Debian4下安装MySql5.1.53

 

h2. 编译

 

<pre>

./configure  '--prefix=/usr/local/mysql5.1.53' '--with-mysqld-user=mysql' '--with-extra-charsets=all' '--with-unix-socket-path=/usr/local/mysql5.1.53/var/mysql.sock' '--with-named-curses-libs=/lib/libncurses.so.5' '--enable-assembler'

</pre>

 

h2. 安装

 

<pre>

make && make install

</pre>

 

h2. 初始化数据

 

刚刚编译安装完成的mysql中没有任何数据,包括默mysql数据个需要初始化安装。

命令如下

<pre>

/usr/local/mysql5.1.53/bin/mysql_install_db

</pre>

 

h2. 配置

 

h3. 建配置文件

 

/usr/local/mysql5.1.53/share/mysql个目下的my-medium.cnfmy.cnfmysql安装目

做如下修改

[mysqld] 配置中加入

skip-name-resolve #取消DNS反向解析,提高访问速度

_详细内容,参考57上的my.cnf_

 

h3. &停止

 

*

<pre>

/usr/local/mysql5.1.53/bin/mysqld_safe --user=root &

</pre>

* 停止

<pre>

/usr/local/mysql5.1.53/share/mysql/mysql.server stop

</pre>

 

h3. mysql命令行

 

<pre>

/usr/local/mysql5.1.53/bin/mysql -uroot

</pre>

 

h3. 访问

 

# 配置cnf文件

找到你的my.cnf文件(如果用debian提供的mysql,在/etc/mysql/my.cnf

bind-address,等号后serverIP地址

# mysql命令行行下列命令

<pre>

GRANT ALL PRIVILEGES ON *.* TO 'depman'@'%' IDENTIFIED BY 'depman' WITH GRANT OPTION;

</pre>

添加depman,密码为depman,可以在任何程机器访问数据有全部

 

h3. 添加InnoDB支持

 

# mysql命令行

# mysql> show plugin;

看是否有InnoDB的支持,没有的

# mysql> install plugin innodb soname "ha_innodb.so";

# 再次mysql> show plugin;发现InnoDB,安装成功

 

h3. 数据移植

 

* 57上的kebin数据sql文件)

<pre>

/usr/local/mysql5.1.53/bin/mysqldump --skip-lock-tables -h192.168.12.57 -uroot -proot kebin > kebin.sql

</pre>

* 才生成的sql文件到kebin数据

<pre>

/usr/local/mysql5.1.53/bin/mysql kebin < kebin.sql

</pre>

* ServerAServerB迁移数据

<pre>

/usr/local/mysql5.1.53/bin/mysqldump --skip-lock-tables -uroot -proot kebin | /usr/local/mysql5.1.53/bin/mysql -h192.168.12.58 -udepman -pdepman kebin

</pre>

posted on 2012-01-18 21:46 大鸟 阅读(167) 评论(0)  编辑  收藏 所属分类: linux

只有注册用户登录后才能发表评论。


网站导航: