歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Unix知識 >> 關於Unix >> 在solrais下編譯安裝MySQL

在solrais下編譯安裝MySQL

日期:2017/2/28 11:28:18   编辑:關於Unix


很多朋友在sun下編譯mysql都會有些問題,現在我把編譯過程整理如下,希望對大家有所幫助。
環境:
sun250+solaris8
過程:
1.autoconf-2.13-sol8-sparc-local.gz
2.automake-1.4-sol8-sparc-local.gz
3.bison-1.28-sol8-sparc-local.gz
4.gcc-2.95.3-sol8-sparc-local.gz
5.gzip-1.3-sol8-sparc-local
6.make-3.79.1-sol8-sparc-local.gz
設置環境變量,編譯過程需要用到sun的一些命令,但是這些命令默認是不在你的PATH裡的所以需要我們手工添加,我用的是bash所以修改root用戶的.bash_profile中的PATH為
PATH=/usr/local/sbin:/usr/local/bin:/usr/ccs/bin:/usr/sbin:/sbin:?$PATH:?$HOME/bin:/usr/local/mysql/bin:
退出重新登錄使變量生效,按照下列步驟安裝軟件:
1.pkgadd -d gzip-1.3-sol8-sparc-local
2.gunzip autoconf-2.13-sol8-sparc-local.gz
3.gunzip automake-1.4-sol8-sparc-local.gz
4.gunzip gcc-2.95.3-sol8-sparc-local.gz
5 gunzip bison-1.28-sol8-sparc-local.gz
6.pkgadd -d autoconf-2.13-sol8-sparc-local
7.pkgadd -d automake-1.4-sol8-sparc-local
8.pkgadd -d gcc-2.95.3-sol8-sparc-local
9.pkgadd -d make-3.79.1-sol8-sparc-local
10.gunzip tar-1.13.tar.gz
11.tar xvf tar-1.13.tar
12.cd tar-1.13
13../configure --prefix=/usr/local/gnu_tar
14. make
15. make install
16. vi ~/.bashrc添加
alias tar='/usr/local/gnu_tar/bin/tar'
17.alias tar='/usr/local/gnu_tar/bin/tar'
18.tar zxvf mysql-3.23.44.tar.gz
19.cd mysql-3.23.44
20.which perl(檢查你系統的perl的位置,sun是在/bin下)
21.cd tests把這個目錄中所有以pl結尾的文件的perl解釋器的位置改為#!/bin/perl
22.cd ..(返回上一級目錄)
23. CC=gcc CFLAGS="-O6" CXX=gcc CXXFLAGS="-O6 -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --with-mysqld-user=mysql --with-charset=gbk --with-extra-charsets=all
24.make
25.make install
26.cd support-files
29.修改.bash_profile把mysql的路徑添進去,上面我加過了,所以這部就免了。
30.useradd -d /usr/local/mysql/var -s /bin/false mysql(創建MySQL運行用戶)
31.mysql_install_db(初始話數據庫)
32.chown -R mysql /usr/local/mysql/var
33./etc/rc2.d/S90MySQL start(啟動數據庫)
34.mysql(連接測試)
[root@mailtest support-files]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 3.23.44
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
35.安裝完畢
Copyright © Linux教程網 All Rights Reserved