yum -y install libaio* ncurses*
tar zxf mysql-5.1.62.tar.gz
cd mysql-5.1.62
a) useradd -g mysql mysqlgame
b) ./configure --prefix=/usr/local/mysqlgame --with-charset=utf8 --with-extra-charsets=all --with-unix-socket-path=/tmp/mysqlgame.sock --with-tcp-port=3309 --with-mysqld-user=mysqlgame --enable-profiling
c) make && make install
d)
cp ./support-files/mysql.server /etc/init.d/mysqld
cp ./support-files/my-medium.cnf /etc/my.cnf
e) cd /usr/local/mysqlgame && chown -R mysqlgame:mysql .
f) vim my.cnf 配置端口号(3309) 和 sock(/tmp/mysqlgame.sock)
g)./bin/mysql_install_db --basedir=/usr/local/mysqlgame --datadir=/usr/local/mysqlgame/data --user=mysqlgame (第一次安装,初始化数据库)
h)./bin/mysqld_safe --defaults-file=/etc/my.cnf --user=mysqlgame & (启动mysql服务,指定配置文件,以用户mysqlgame启动服务 &后台运行)
i) mysql -uroot -p --port=3309 --protocol=TCP (连接mysql,看是否安装成功, 帐号为root,密码为空,进去之后删除空帐号)
好下面做另外的修改,就是当启动 CentOS5 Linux 时候,mysql也自动启动的问题
] su - 我们要用管理员身份才可以 进行下面的操作
]# echo "/usr/local/mysqlgame/bin/mysqld_safe &" >> /etc/rc.local
]# more /etc/rc.local 查看是否添加成功。
]# shutdown -r now 重启Linux 看看 是否成功

本文介绍如何在CentOS系统中安装MySQL 5.1,并通过详细步骤指导完成数据库的初始化配置及设置MySQL随系统启动自动运行。
211

被折叠的 条评论
为什么被折叠?



