分类: LINUX
2011-05-10 10:34:32
MySQL安装的一般步骤如下:
shell> groupadd mysql //增加组
shell> useradd -g mysql mysql //增加mysql用户
shell> tar zxvf mysql-VERSION.tar.gz //解压源码
shell> cd mysql-VERSION
shell> ./configure --prefix=/usr/local/mysql //编译参数
shell> make && make install //编译、安装(可能要自己创建/usr/local/mysql/var)
shell> cp xxx/my.cnf /etc/my.cnf //把配置文件复制到全局位置,或者 mysql/etc/下 (有可能是cp support-files/my-medium.cnf /etc/my.cnf)
shell> cd /usr/local/mysql
shell> bin/mysql_install_db --user=mysql //创建系统数据库、表
shell> chown -R root . //权限设置
shell> chown -R mysql var
shell> chgrp -R mysql .
shell> bin/mysqld_safe --user=mysql &
shell>cd /bin
shell> sudo ln -s /usr/local/mysql/bin/mysql mysql
http://blog.sina.com.cn/s/blog_643fbeef0100kkeh.html