初学MySQL,在FreeBSD下安装
步骤如下:
1、下载MySQL安装包:mysql-5.0.27.tar.gz,并将其传到FreeBSD系统上
2、解压源代码
// 进入压缩包所在文件目录,并确认压缩包确实在这
#cd install
#ls
mysql-5.0.27.tar.gz// 解压
#tar zxvf mysql-5.0.27.tar.gz
#ls 
mysql-5.0.27            mysql-5.0.27.tar.gz
// 进入解压候的目录
#cd mysql-5.0.27
// 设置安装选项(把mysql安装在/usr/local/mysql)
#./configure --prefix=/usr/local/mysql
...(设置过程的结果显示)
// 编译源码
#make
...(漫长的编译过程)
// 安装
#make insall
...(漫长的安装过程)
ok
// 运行一下初始化脚本
#scripts//mysql_install_db// 在后台启动服务,这里就开始有错误了
# /usr/local/mysql/bin/mysqld_safe &
[1] 20624
# Starting mysqld daemon with databases from /usr/local/mysql/var
STOPPING server from pid file /usr/local/mysql/var/192.168.2.150.pid
070112 12:17:38  mysqld ended
[1]    Done                          /usr/local/mysql/bin/mysqld_safe// 查看错误日值
#more /usr/local/mysql/var/192.168.2.150.err
070112 12:17:37  mysqld started
070112 12:17:38  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'create'.
InnoDB: Cannot continue operation.
070112 12:17:38  mysqld ended郁闷啊,谁能告诉我错在那里了,是不是还有什么东西需要设置?

解决方案 »

  1.   

    shell> groupadd mysql
    shell> useradd -g mysql mysql
    shell> gunzip < mysql-VERSION.tar.gz | tar -xvf -
    shell> cd mysql-VERSION
    shell> ./configure --prefix=/usr/local/mysql
    shell> make
    shell> make install
    shell> 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 &你自己对照一下,还漏了后面几步,就是文件目录权限
      

  2.   

    貌似这是linux下的方式吧,FreeBSD有些命令和这个不大一样