Linux下安裝mysql 5.0.56

 
1. 下載並解包
將網絡下載的mysql-5.0.56.tar.gz文件放在/usr/local/src目錄並解包
#cd /usr/local/src
#tar xzvf mysql-5.0.56.tar.gz
#cd mysql-5.0.56
2. 編譯安裝
#./configure
--prefix=/usr/local/mysql
--localstatedir=/var/lib/mysql
--with-comment=Source
--with-server-suffix=-enterprise-gpl
--with-mysqld-user=mysql
--without-debug
--with-big-tables
--with-charset=utf8
--with-collation=utf8_general_ci
--with-extra-charsets=all
--with-pthread
--enable-static
--enable-thread-safe-client
--with-client-ldflags=-all-static
--with-mysqld-ldflags=-all-static
--enable-assembler
--without-innodb
--without-ndb-debug
--without-isam
--enable-local-infile
--with-readline
--with-raid
如果編譯成功,你會看到:Thank you for choosing MySQL!

#make
在此過程中遇到"/usr/bin/ld: cannot find -lncurses"錯誤,安裝libncurses5-dev包後再次編譯正常。
#make install
安裝完成
3. MYSQL配置
#groupadd mysql
#useradd -g mysql -s /bin/false -M mysql
#cd /usr/local/mysql
#bin/mysql_install_db --user=mysql
安裝MYSQL系統表
Installing MySQL system tables...
OK
Filling help tables...
OK
......
設置目錄文件權限
#chown -R root:mysql .
#chown -R mysql /var/lib/mysql
#chgrp -R mysql .
#cp share/mysql/my-medium.cnf /etc/my.cnf
#cp share/mysql/mysql.server /etc/rc.d/init.d/mysqld
#chmod 755 /etc/rc.d/init.d/mysqld
加入自動啓動服務隊列
# chkconfig --add mysqld
配置庫文件搜索路徑
#echo "/usr/local/mysql/lib" >> /etc/ld.so.conf && ldconfig
開啓或關閉mysqld服務
/etc/rc.d/init.d/mysqld start/stop
service mysqld start/stop
修改root初始密碼
bin/mysqladmin -u root password "your password"
4. 安裝完成
發佈了6 篇原創文章 · 獲贊 9 · 訪問量 15萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章