mysql 5.1 for linux_linux下安装mysql5.1.68
Linux下安裝mysql-5.1.68.tar
系統環境是Centos5.8的
因為mysql5.5.*以上版本需要安裝cmakce
現在安裝這個5.1.*版本的數據庫
1.首先創建賬戶和用戶組
groupadd mysql
useradd -g mysql mysql
2.解壓包
tar xvfz mysql-5.1.68.tar.gz
cd mysql-5.1.68
進入mysql-5.1.68目錄,執行configure并執行一些參數
./configure --prefix=/usr/local/mysql/ --with-server-suffix=-
junsansi-edition --enable-assembler --enable-local-infile --
enable-thread-safe-client --with-big-tables --with-charset=utf8
--with-extra-charsets=gbk,gb2312,utf8,ascii --with-readline
--with-ssl --with-embedded-server --with-pthread --with-
mysqld-user=mysql --with-mysqld-ldflags=-all-static --with-
client-ldflags=-all-static --with-
plugins=partition,innobase,innodb_plugin
提示:configure支持的選項非常多,詳細的參數及說明建議參考官方文
檔,也可以通過./configure --help查看,這里僅列出常用及推薦使用
的選項。
--prefix=PREFIX:指定程序安裝路徑;
--enable-assembler:使用匯編模式;
--enable-local-infile:啟用對LOAD DATA LOCAL INFILE語法的支持(
默認不支持);
--enable-profiling:Build a version with query profiling code
(req.community-features)
--enable-thread-safe-client:使用編譯客戶端;
--with-big-tables:啟用32位平臺對4G大表的支持;
--with-charset=CHARSET:指定字符集;
--with-collation=:默認collation;
--with-extra-charsets=CHARSET,CHARSET,...:指定附加的字符集;
--with-fast-mutexes:Compile with fast mutexes
--with-readline:
--with-ssl:啟用SSL的支持;
--with-server-suffix=:添加字符串到版本信息;
--with-embedded-server:編譯embedded-server;
--with-pthread:強制使用pthread類庫;
--with-mysqld-user=:指定mysqld守護進程的用戶;
--with-mysqld-ldflags=:靜態編譯MySQL服務器端;
--with-client-ldflags=:靜態編譯MySQL客戶端;
--with-plugins=PLUGIN,PLUGIN,...:MySQL服務器端支持的組件(默認
為空),可選值較多:
partition:MySQL Partitioning Support;
daemon_example:This is an example plugin daemon;
ftexample:Simple full-text parser plugin;
archive:Archive Storage Engine;
blackhole:Basic Write-only Read-never tables;
csv:Stores tables in text CSV format,強制安裝;
example:Example for Storage Engines for developers;
federated:Connects to tables on remote MySQL servers;
heap:Volatile memory based tables,強制安裝;
ibmdb2i:IBM DB2 for i Storage Engine;
innobase:Transactional Tables using InnoDB;
innodb_plugin:Transactional Tables using InnoDB;
myisam:Traditional non-transactional MySQL tables,強制安裝;
myisammrg:Merge multiple MySQL tables into one,強制安裝;
ndbcluster:High Availability Clustered tables;
--with-plugin-PLUGIN:強制指定的插件鏈接至MySQL服務器;
--with-zlib-dir=:向MySQL提供一個自定義的壓縮類庫地址;
--without-server:僅安裝MySQL客戶端;
--without-query-cache:不要編譯查詢緩存;
--without-geometry:不要編譯geometry-related部分;
--without-debug:編譯為產品版,放棄debugging代碼;
--without-ndb-debug:禁用special ndb debug特性;
安裝完之后出現以下提示信息
/bin/rm: cannot remove `libtoolT': No such file or directory
config.status: executing default commands
Thank you for choosing MySQL!
Remember to check the platform specific part of the reference
manual
for hints about installing MySQL on your platform.
Also have a look at the files in the Docs directory.
1。使用rpm -qa | grep libtool
我的機子已經安裝了
libtool-1.5.22-7.el5_4
如果沒安裝就安裝一下吧
yum install libtool
2 .分別執行以下三條命令:
# autoreconf --force --install
# libtoolize --automake --force
# automake --force --add-missing
再重新編譯安裝,問題解決!
網上遇到的解決辦法
這時直接打開 configure(就在解壓的軟件包里面),把 $RM
“$cfgfile” 那行刪除掉,重新再運行 ./configure 就可以了。
網上所說的那些方法根本不管用,如:
# aclocal
# autoconf
# automake
# libtoolize –force
或者:
# autoreconf –force –install
# libtoolize –automake –force
# automake –force –add-missing
暈死了!網上查的都是一些錯誤信息,害的我浪費很多時間
config.status: executing default commands
Thank you for choosing MySQL!
Remember to check the platform specific part of the reference
manual
for hints about installing MySQL on your platform.
Also have a look at the files in the Docs directory.
我的解決了,網上也有沒解決的,那只能用上面的方法在configure里面
刪除 $RM “$cfgfile”這個了
繼續執行編譯
make & make install
復制配置文件
cp support-files/my-medium.cnf /etc/my.cnf
初始化
./bin/mysql_install_db --user=mysql --datadir=/var/lib/mysql/
--skip-name-resolve --defaults-file=/etc/my.cnf
啟動
/usr/local/mysql/bin/mysqld_safe --defaults-file=/etc/my.cnf &
設置mysql開機自啟動:
# cp /usr/local/src/mysql/support-files/mysql.server
/etc/rc.d/init.d/mysql
#chmod +x /etc/rc.d/init.d/mysql
#chkconfig --add mysql
測試并運行mysql
#/usr/local/mysql/bin/mysqld_safe --user=mysql &
#service mysql start
修改mysql管理員密碼
#/usr/local/mysql/bin/mysqladmin -u root password password
還可以使用這個命令改密碼
grant all privileges on *.* to root@'%' identified by
'malaguan' with grant option;
使用用戶登錄mysql
# /usr/local/mysql/bin/mysql -u root -p
輸入mysql提示
-bash: mysql: command not found
原因:
是因為mysql命令的路徑在/usr/local/mysql/bin下面,所以你直接使用
mysql命令時,系統在/usr/bin下面查此命令,所以找不到了。
解決辦法:做個鏈接即可。
ln -s /usr/local/mysql/bin/mysql /usr/bin
進入mysql
show databases;
發現只有
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test |
+--------------------+
而在5.5.*里面是
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
在5.5.*里面新增添了performance_schema功能
總結
以上是生活随笔為你收集整理的mysql 5.1 for linux_linux下安装mysql5.1.68的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: [云炬创业基础笔记]第七章创业资源测试6
- 下一篇: [云炬创业基础笔记]第七章创业资源测试7