網(wǎng)友評分:
5分
mysql for linux是一款功能十分強大的數(shù)據(jù)庫管理軟件,該軟件專門針對使用linux操作系統(tǒng)的用戶量身定制,支持跨平臺使用,提供了豐富的數(shù)據(jù)庫編輯接口,為建立基于數(shù)據(jù)庫的動態(tài)網(wǎng)站提供了強大動力,滿足用戶的數(shù)據(jù)庫管理需求,提高用戶的工作效率,喜歡的小伙伴千萬不要錯過哦。
1.使用C和C++編寫,并使用了多種編譯器進行測試,保證源代碼的可移植性。
2.支持AIX、FreeBSD、HP-UX、Linux、Mac OS、NovellNetware、OpenBSD、OS/2 Wrap、Solaris、Windows等多種操作系統(tǒng)。
3.為多種編程語言提供了API。這些編程語言包括C、C++、Python、Java、Perl、PHP、Eiffel、Ruby和Tcl等。
4.支持多線程,充分利用CPU資源。
5.優(yōu)化的SQL查詢算法,有效地提高查詢速度。
6.既能夠作為一個單獨的應用程序應用在客戶端服務器網(wǎng)絡環(huán)境中,也能夠作為一個庫而嵌入到其他的軟件中。
7.提供多語言支持,常見的編碼如中文的GB 2312、BIG5,日文的Shift_JIS等都可以用作數(shù)據(jù)表名和數(shù)據(jù)列名。
8.提供TCP/IP、ODBC和JDBC等多種數(shù)據(jù)庫連接途徑。
9.提供用于管理、檢查、優(yōu)化數(shù)據(jù)庫操作的管理工具。
10.支持大型的數(shù)據(jù)庫??梢蕴幚頁碛猩锨f條記錄的大型數(shù)據(jù)庫。
11.支持多種存儲引擎。
12.Mysql是開源的,所以你不需要支付額外的費用。
13.MySQL使用標準的SQL數(shù)據(jù)語言形式。
14.Mysql對PHP有很好的支持,PHP是目前最流行的Web開發(fā)語言。
15.Mysql是可以定制的,采用了GPL協(xié)議,你可以修改源碼來開發(fā)自己的Mysql系統(tǒng)。
安裝源代碼版本的MySQL(mysql-5.1.40-linux-i686-glibc23.tar.gz安裝筆記)
1.首先添加mysql用戶組
shell> groupadd mysql
2.添加mysql用戶,并指定到mysql用戶組
shell> useradd -g mysql mysql
3.解壓縮mysql-version.tar.gz
shell> gunzip < mysql-VERSION.tar.gz | tar -xvf -
4.安裝mysql
shell> cd mysql-VERSION
shell> ./configure --prefix=/usr/local/mysql --with-charset=gbk --with-extra-charsets=armscii8,ascii,big5,cp1250,cp1251,cp1256,cp1257,cp850,cp852,cp866,cp932,dec8,eucjpms,euckr,gb2312,gbk,geostd8,greek,hebrew,hp8,keybcs2,koi8r,koi8u,latin1,latin2,latin5,latin7,macce,macroman,sjis,swe7,tis620,ucs2,ujis,utf8 --with-plugins=innodb_plugin
shell> make
shell> make install
5.復制配置文件
shell> cp support-files/my-medium.cnf /etc/my.cnf
6.執(zhí)行mysql系統(tǒng)數(shù)據(jù)庫初始化腳本
shell> cd /usr/local/mysql
shell> bin/mysql_install_db --user=mysql
7.設定mysql安裝目錄權限,設置owner為mysql
shell> chown -R mysql var
shell> chgrp -R mysql .
8.啟動mysql應用
shell> /usr/local/mysql/bin/mysqld_safe --user=mysql &
9.設置root密碼(數(shù)據(jù)庫的DBA)
shell> bin/mysqladmin -u root password ‘123456’
10.登錄mysql
shell> bin/mysql -u root -p
Enter password:
登錄成功會看到:
這時mysql已經(jīng)裝好了,可以查看數(shù)據(jù)庫了,但在正式使用數(shù)據(jù)庫開發(fā)與部署的時候還需要做一些工作:
1.設定配置文件my.cnf
按照需求copy my-***.cnf到/etc/my.cnf
2.修改默認字符集utf8
(1).[client]下加入default-character-set=utf8
(2).[mysqld]下加入default-character-set=utf8
#不改動存儲引擎的話,3、4步可以略過
3.啟動InnoDB引擎的方法如下:
1)關閉mysql的服務
2)修改my.ini
將default-storage-engine=INNODB前的注釋(#)去掉
將skip-innodb這行注釋(加上#)
4.配置innodb參數(shù)
1).找到# Uncomment the following if you are using InnoDB tables
去掉innodb_*下的所有#
2).如果安裝mysql的目錄不是默認的,則需要修改
# mysql 默認安裝目錄為 /usr/local/mysql/
# mysql 默認表空間目錄安裝目錄為 /usr/local/mysql/var/
innodb_data_home_dir=/usr/local/database/mysql/var/
innodb_log_group_home_dir=/usr/local/database/mysql/var/
3).保存后重啟mysql服務。
5.設置系統(tǒng)服務
讓linux啟動的時候就啟動mysql服務
shell> cd /usr/local/mysql/
shell> cp support-files/mysql.server /etc/init.d/mysql
shell> chmod 777 /etc/init.d/mysql
shell> chkconfig --add mysql
shell> chkconfig --level 35 mysql on
6.重啟MySQL服務
shell> service mysql restart
備注:
Add a login user and group for ‘mysqld’ to run as:為‘mysqld’增添一個登陸用戶和組
shell> groupadd mysql
shell> useradd -g mysql mysql
Configure the release and compile everything:配置和編譯
shell> ./configure --prefix=/usr/local/mysql
--prefix后面指示了默認安裝路徑
shell> make
如果還想知道更詳細的configure命令,請查閱manual for configure
If you want to set up an option file, use one of those present in
the ‘support-files’ directory as a template. For example:如果你想安裝選項文件,使用當前存在的‘support-files’ 文件夾下的作為模板,例如:
shell> cp support-files/my-medium.cnf /etc/my.cnf
If you haven`t installed MySQL before, you must create the MySQL
grant tables:如果你以前沒有安裝過MySQL,你必須創(chuàng)建一個MySQL準許的表
shell> bin/mysql_install_db --user=mysql
Change the ownership of program binaries to ‘root’ and ownership
of the data directory to the user that you will run ‘mysqld’ as.
Assuming that you are located in the installation directory
(‘/usr/local/mysql’), the commands look like this:將程序的所有權限給‘root’ ,并且把數(shù)據(jù)目錄的所有權給可以運行‘mysqld’的用戶。假設MySQL的安裝目錄是(‘/usr/local/mysql’),命令如下所示:
shell> chown -R mysql var
shell> chgrp -R mysql .
The first command changes the owner attribute of the files to the ‘root’ user. 第一行命令把文件擁有權給‘root’。The second changes the owner attribute of the data directory to the ‘mysql’ user. 第二行把數(shù)據(jù)目錄擁護權給‘mysql’用戶。The third changes the group attribute to the ‘mysql’ group.第三行把組的權限給‘mysql’組。
After everything has been installed, you should initialize and test your distribution using this command:萬事具備后,你就可以按照下面的命令測試并運行你的MySQL了:
shell> /usr/local/mysql/bin/mysqld_safe --user=mysql &
注意:文件中的單引號全應該是英文狀態(tài)下輸入的,這里小編為了美觀改成中文狀態(tài)下輸入的單引號了。
關于本站|下載幫助|下載聲明|軟件發(fā)布|聯(lián)系我們
Copyright ? 2005-2024 m.daaijiaoyu.cn.All rights reserved.
浙ICP備2024132706號-1 浙公網(wǎng)安備33038102330474號