Compressed GNU TAR archive (tar.gz) 6.0.10-alpha 34.3M Download | Pick a mirrorMD5: ebcefbaca78299f5820794350d0025d5 |
作為服務(wù)器,或者個(gè)人學(xué)習(xí)編程設(shè)計(jì),數(shù)據(jù)庫(kù)是少不了的,
而且如果免費(fèi)的數(shù)據(jù)庫(kù),功能也不差的,建議大家選擇MySQL數(shù)據(jù)庫(kù),
對(duì)于中小型網(wǎng)站,或者個(gè)人學(xué)習(xí)數(shù)據(jù)庫(kù)編程 已經(jīng)夠了。呵呵。
你可以到 找到mysql相關(guān)信息,和下載,mysql現(xiàn)在已經(jīng)屬于sun的啦,
而 sun 最近又被 Oracle 收購(gòu)了。。。。
Source downloads (源代碼下載) 下載源代碼就可以,因?yàn)槲覀兪褂镁幾g方式來(lái)安裝。
Compressed GNU TAR archive (tar.gz)? 6.0.10-alpha 34.3M Download | Pick a mirror
MD5: ebcefbaca78299f5820794350d0025d5 | Signature
下面進(jìn)行 編譯安裝 mysql 數(shù)據(jù)庫(kù)
把 mysql-6.0.10-alpha.tar.gz 下載到 CentOS 5.3 系統(tǒng)中去,,
1, 下載mysql數(shù)據(jù)庫(kù) 源代碼 : mysql-6.0.10-alpha.tar.gz
2, 解壓? 文件比較多,解壓也一段時(shí)間。
?src]# tar vxzf mysql-6.0.10-alpha.tar.gz
3, 進(jìn)入目錄進(jìn)行 -> 配置,編譯,安裝
?]# cd mysql-6.0.10-alpha
?配置生成 makefile 文件
?]# ./configure --sysconfdir=/etc
checking for termcap functions library... configure: error: No curses/termcap library found
出現(xiàn)錯(cuò)誤,也就是生成 makefile 文件出錯(cuò)了。
[root@localhost mysql-6.0.10-alpha]# make
make: *** No targets specified and no makefile found.? Stop.
如果你硬要輸入 make 命令是不行的,因?yàn)?makefile 根本沒(méi)有生成成功。
解決辦法:
我們加入 --with-named-curses-libs=/usr/lib/libncursesw.so.5 進(jìn)行生成 makefile
?./configure --sysconfdir=/etc --with-named-curses-libs=/usr/lib/libncursesw.so.5
Thank you for choosing MySQL!
看到這句話,生成 makefile 成功了。
下面進(jìn)行make編譯: 需要的時(shí)間比較長(zhǎng)。
]# make
編譯安裝雖然花費(fèi)的時(shí)間比較長(zhǎng),但是它應(yīng)該可以適合任何一個(gè)發(fā)行版本的
Linux,編譯的中途過(guò)程我就不播放視頻出來(lái)了,截?cái)嘁徊糠?。我現(xiàn)在已經(jīng)編譯完成。
make[1]: Leaving directory `/opt/mysql-6.0.10-alpha/sql-bench'
Making all in win
make[1]: Entering directory `/opt/mysql-6.0.10-alpha/win'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/opt/mysql-6.0.10-alpha/win'
最后進(jìn)行安裝
]# make install
編譯安裝完畢,有時(shí)候需要很長(zhǎng)時(shí)間,如何判斷是否死機(jī)?
注意觀察主機(jī)的硬盤(pán)燈,編譯安裝時(shí)候 硬盤(pán)燈是一閃一閃的,有數(shù)據(jù)讀取。
下面拷貝配置文件
]# cp /usr/local/share/mysql/my-large.cnf /etc/my.cnf
以后配置mysql ,就修改 /etc/my.cnf 即可
4, 初始化數(shù)據(jù)庫(kù)
?# useradd -d /usr/local/var mysql
?# su - mysql
?$ /usr/local/bin/mysql_install_db
?
初始化出現(xiàn)錯(cuò)誤。
Installing MySQL system tables...
090518? 7:16:41 [ERROR] /usr/local/libexec/mysqld: unknown option '--skip-federated'
090518? 7:16:41 [ERROR] Aborting
090518? 7:16:41 [Note] /usr/local/libexec/mysqld: Shutdown complete
我們解決辦法是,先 刪掉 /usr/local/var 下的 mysql 文件夾
rm -rf /usr/local/var/mysql
然后修改 vi /etc/my.cnf
找到 skip-federated? 注釋掉 ,也就是改成 ####skip-federated? 然后保存退出
su - mysql?? 用會(huì) mysql 身份, 來(lái)重新初始化
/usr/local/bin/mysql_install_db
這次成功了吧,沒(méi)有出現(xiàn)錯(cuò)誤信息。
5, 啟動(dòng)服務(wù)器
?[mysql@localhost var]$ /usr/local/bin/mysqld_safe &
?? 現(xiàn)在成功了, 用 netstat -tnl 看到 3306 熟悉的 mysql默認(rèn)端口
6, 登陸測(cè)試
?[mysql@localhost local]$ mysql -u root
?成功的話, 出現(xiàn)
?mysql>
?mysql>\s
?mysql>\q
可以使用 show databases;
一般,如果你是編譯安裝mysql ,建議你像我下面的做法
提升為 root 用戶, su -
cp /usr/local/share/mysql/mysql.server /etc/init.d/mysqld
mysql 關(guān)閉的命令為:/etc/init.d/mysqld stop
[root@localhost ~]# /etc/init.d/mysqld stop
Shutting down MySQL.090518 07:26:41 mysqld_safe mysqld from
?pid file /usr/local/var/localhost.localdomain.pid ended SUCCESS!
就會(huì)顯示 關(guān)閉成功。
mysql 啟動(dòng)的命令為:/etc/init.d/mysqld start
[root@localhost ~]# /etc/init.d/mysqld start
Starting MySQL. SUCCESS!
下面修改 服務(wù)器啟動(dòng)時(shí)候,就自動(dòng)運(yùn)行 mysql 6.0
vi /etc/rc.d/rc.local
我把它運(yùn)行在 tomcat 前面, 然后保存退出。
每個(gè)人都需要一臺(tái)速度更快、更穩(wěn)定的 PC。隨著時(shí)間的推移,垃圾文件、舊注冊(cè)表數(shù)據(jù)和不必要的后臺(tái)進(jìn)程會(huì)占用資源并降低性能。幸運(yùn)的是,許多工具可以讓 Windows 保持平穩(wěn)運(yùn)行。
微信掃碼
關(guān)注PHP中文網(wǎng)服務(wù)號(hào)
QQ掃碼
加入技術(shù)交流群
Copyright 2014-2025 http://www.miracleart.cn/ All Rights Reserved | php.cn | 湘ICP備2023035733號(hào)