自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

MySQL SUSE SLES11安裝與配置筆記實(shí)操

數(shù)據(jù)庫 MySQL
我們今天主要向大家研討的是如何正確對MySQL SUSE SLES11進(jìn)行安裝與配置筆記的實(shí)際操作步驟,以下就是文章的具體操作內(nèi)容。

以下的文章主要介紹的是MySQL SUSE SLES11安裝與配置筆記的實(shí)際操作過程,我們是在Linux下兩個不同的版本MySQL安裝實(shí)戰(zhàn)(MySQL5和MySQL4)演示,以下就是文章的而具體內(nèi)容描述。

Redhat9.2 安裝MySQL5.0

fedora7安裝MySQL

(1) 下載

從MySQL官網(wǎng) 下載到***的發(fā)行版本5.1.45,簡單起見,直接下載SLES11的RPM版本:

 

  1. MySQL-server-community-5.1.45-1.sles11.i586.rpm  
  2. MySQL-client-community-5.1.45-1.sles11.i586.rpm  
  3. MySQL-shared-community-5.1.45-1.sles11.i586.rpm 

對MySQL版本的選擇,個人意見,如果是作為產(chǎn)品首先考慮穩(wěn)定性和性能,功能夠用即可,版本上謹(jǐn)慎保守一些,但是作為一般開發(fā)用用,追追新也無所謂。

(2) MySQL SUSE SLES11 安裝

1. rpm安裝

 

  1. 執(zhí)行:rpm -ivh MySQL-server-community-5.1.45-1.sles11.i586.rpm  
  2. Preparing... ########################################### [100%]  
  3. 1:MySQL-server-community ########################################### [100%]  
  4. MySQL 0:off 1:off 2:on 3:on 4:on 5:on 6:off  
  5. PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !  
  6. To do so, start the server, then issue the following commands:  
  7. /usr/bin/MySQLadmin -u root password 'new-password'  
  8. /usr/bin/MySQLadmin -u root -h ss-server password 'new-password'  
  9. Alternatively you can run:  
  10. /usr/bin/MySQL_secure_installation  
  11. which will also give you the option of removing the test  
  12. databases and anonymous user created by default. This is  
  13. strongly recommended for production servers.  
  14. See the manual for more instructions.  
  15. Please report any problems with the /usr/bin/MySQLbug script!  
  16. Starting MySQL. done  
  17. Giving MySQLd 2 seconds to start   

 

使用ps -ef | grep MySQL 可以看到msyqld進(jìn)行已經(jīng)啟動。netstat -nat 可以看到默認(rèn)的3306端口已經(jīng)在監(jiān)聽。rpm的安裝的確是夠簡單。

tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN

但是這樣的默認(rèn)安裝,是沒有指定安裝路徑的,因此MySQL不會MySQL SUSE SLES11 安裝到我們期望的地點(diǎn)。因此只好重新來過,先卸載吧:

rpm -e MySQL-server-community-5.1.45-1.sles11

使用--prefix選項(xiàng)重新安裝:

rpm -ivh --prefix=/work/soft/database/MySQL/ MySQL-server-community-5.1.45-1.sles11.i586.rpm

結(jié)果發(fā)生錯誤:

 

  1. error: package MySQL-server-community is not relocatable  

居然不能重新定位MySQL SUSE SLES11 安裝路徑,這個就麻煩了。只好重新下載tarbell的版本MySQL-5.1.45.tar.gz,自己動手編譯。

2. 編譯

./configure --prefix=/work/soft/database/MySQL/MySQL5.1 --localstatedir=/work/soft/database/MySQL/MySQLdata --with-charset=utf8 --with-extra-charsets=all --with-client-ldflags=-all-static --with-MySQLd-ldflags=-all-static --with-unix-socket-path=/work/soft/database/MySQL/tmp/MySQL.sock

configure的過程中出現(xiàn)錯誤而中斷:

 

  1. checking for termcap functions library... configure: error: No curses/termcap library found 

先把這個東西裝好

 

  1. gunzip ncurses-5.7.tar.gz  
  2. tar xvf ncurses-5.7.tar  
  3. cd ncurses-5.7/  
  4. ./configure  
  5. make  
  6. make install 

安裝ncurses之后,重新configure成功,繼續(xù)make,make install完成編譯MySQL SUSE SLES11 安裝。

然后執(zhí)行scripts/MySQL_install_db.

  1. Installing MySQL system tables...  
  2. OK  
  3. Filling help tables...  
  4. OK  
  5. To start MySQLd at boot time you have to copy  
  6. support-files/MySQL.server to the right place for your system  
  7. PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !  
  8. To do so, start the server, then issue the following commands:  
  9. /work/soft/database/MySQL/MySQL5.1/bin/MySQLadmin -u root password 'new-password'  
  10. /work/soft/database/MySQL/MySQL5.1/bin/MySQLadmin -u root -h ss-server password 'new-password'  
  11. Alternatively you can run:  
  12. /work/soft/database/MySQL/MySQL5.1/bin/MySQL_secure_installation  
  13. which will also give you the option of removing the test  
  14. databases and anonymous user created by default. This is  
  15. strongly recommended for production servers.  
  16. See the manual for more instructions.  
  17. You can start the MySQL daemon with:  
  18. cd /work/soft/database/MySQL/MySQL5.1 ; /work/soft/database/MySQL/MySQL5.1/bin/MySQLd_safe &  
  19. You can test the MySQL daemon with MySQL-test-run.pl  
  20. cd /work/soft/database/MySQL/MySQL5.1/MySQL-test ; perl MySQL-test-run.pl  
  21. Please report any problems with the /work/soft/database/MySQL/MySQL5.1/bin/MySQLbug script!   

 

接著很重要的事情,設(shè)置MySQLd的開機(jī)啟動:

 

  1. cp support-files/MySQL.server /etc/init.d/MySQL  
  2. chkconfig MySQL on  

為了方便,將MySQL 的bin目錄加到PATH中,在/etc/profile中加入myslq/bin,順便增加兩個別名方便操作:

 

  1. export PATH=$JAVA_HOME/bin:$SOFT_ROOT/database/MySQL/MySQL5.1/bin:$PATH  
  2. alias MySQL_start="MySQLd_safe&" 
  3. alias MySQL_stop="MySQLadmin -uroot -p shutdown" 

3. 配置

按照普遍推薦的標(biāo)準(zhǔn)設(shè)置,需要增加MySQL的user和group:不過上面的MySQL SUSE SLES11 安裝過程結(jié)束后,發(fā)現(xiàn)已經(jīng)存在名為MySQL的user和group了:

 

  1. ss-server:/etc # groupadd MySQL  
  2. groupadd: Group `MySQL' already exists.  
  3. ss-server:/etc # useradd MySQL -g MySQL  
  4. useradd: Account `MySQL' already exists.  

用ps命令可以看到

  1. ss-server:/etc # ps -ef | grep MySQL  
  2. root 3743 1 0 18:58 ? 00:00:00 /bin/sh 
    /work/soft/database/
    MySQL/MySQL5.1/bin/MySQLd_safe --datadir=
    /work/soft/database/
    MySQL/MySQLdata --pid-file=/
    work/soft/database/
    MySQL/MySQLdata/ss-server.pid  
  3. MySQL 3799 3743 0 18:58 ? 00:00:00 /work/soft/database/MySQL/MySQL5.1
    /libexec/
    MySQL--basedir=/work/soft/database/MySQL/MySQL5.1 
    --datadir=/work/soft/database/MySQL/MySQLdata --user=MySQL --log-error
    =/work/soft/database/MySQL/MySQLdata/ss-server.err --pid-file=/work/soft
    /database/
    MySQL/MySQLdata/ss-server.pid  

這里MySQLd是以MySQL用戶的身份啟動的。

以下是標(biāo)準(zhǔn)的MySQL SUSE SLES11 安裝設(shè)置了

1. 設(shè)置root帳戶的密碼

 

  1. MySQLadmin -u root password 'yourpassword'  

2. 本機(jī)登錄MySQL, 需要做的事情有: 刪除本機(jī)匿名連接的空密碼帳號;容許root用戶是不允許遠(yuǎn)程登錄。

  1. MySQL -uroot -p 

然后輸入上面設(shè)置的密碼,登錄后在MySQL的命令行中執(zhí)行:

  1. MySQL>use MySQL;  
  2. MySQL>delete from user where password="";  
  3. MySQL>update user set host = '%' where user = 'root';  
  4. MySQL>flush privileges;  
  5. MySQL>quit  

對于root賬號,如果考慮安全應(yīng)該新建其他賬號用于遠(yuǎn)程登錄,root賬號可以不必開啟遠(yuǎn)程登錄。不過對于一般使用,沒有太多安全需求,允許root用戶遠(yuǎn)程登錄可以方便管理,畢竟使用專用管理軟件的圖形界面在操作方面要方便的多。


 

責(zé)任編輯:佚名 來源: 博客園
相關(guān)推薦

2009-11-26 15:12:44

Suse SLES11

2012-02-28 09:26:58

SLES 11 SP1SUSE Linux

2009-11-30 13:05:00

Suse防火墻

2009-12-01 11:21:28

Suse安裝gcc

2010-05-20 15:53:15

配置MySQL

2010-05-04 17:49:39

Oracle安裝

2009-11-25 10:13:30

SUSE Linux配

2009-07-27 17:57:51

NovellSLESWindows

2009-11-25 10:28:33

Open SUSE11

2011-08-19 11:10:31

iPhone應(yīng)用

2009-11-26 16:43:05

SUSE Linux

2009-11-30 08:56:44

配置Linux服務(wù)器

2010-08-09 15:15:48

DB2管理表空間

2009-12-02 18:15:49

Open SUSE

2010-10-26 10:20:31

SUSE 11XenWindows虛擬機(jī)

2009-03-24 17:22:36

NehalemNovell服務(wù)器

2021-05-21 18:49:57

AI

2009-11-24 10:06:21

SUSE enterp

2010-05-31 10:47:08

WindowsSVN服

2010-01-07 17:16:19

Ubuntu MySQ
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號