mysql的源碼安裝

mysql
         源碼包:mysql-5.5.15-linux2.6-i686.tar
         tar  xf  mysql-5.5.15-linux2.6-i686.tar -C /usr/local
         cd  /usr/local  ll
         ln -sv /usr/local/mysql-5.5.15-linux2.6-i686  /usr/local/mysql
         cd mysql
         ls
         創建一個LVM  /dev/myvg/mydata
         mke2fs -j -L MYDATA   /dev/myvg/mydata
         mkdir /mydata
         mount  /dev/myvg/mydata   /mydata
         修改/etc/fstab
         groupadd   -g 3306 mysql
         useradd     -g mysql  -u 3306
         cd /mydata
         mkdir data
         chown -R mysql:mysql  /mydata
         cd /usr/local/mysql
         chown -R mysql:mysql .
  數據庫初始化       scripts/mysql_install_db –user=mysql  –datadir=/mydata/data
        chown -R  root .改變屬主
        ls /etc/init.d
        ls support-files/
        cp support-files/mysql.server  /etc/init.d/mysqld
        chkconfig –add mysql
   配置文件:
          
         cp support-files/my-large.cnf  /etc/my.cnf
         vi /etc/my.cnf –datadir = /mydata/data
  啟動:service mysqld start
  沒有mysql命令:
                 PATH=$PATH:/usr/local/mysql/bin
  庫文件 必須加載(ldconfig) 重新加載所有的庫文件
        vi /etc/ld.so.conf.d/mysql.conf –/usr/local/mysql/lib
  頭文件 ln -sv /usr/local/mysql/include   /usr/include/mysql
  手冊頁 vi /etc/man.config –MANPATH=/usr/local/mysql/man
本文出自 “linux” 博客

You May Also Like