Linux Mysql知識學習篇

來源:互聯網
上載者:User

1.查看Linux 是否安裝了Mysql

[root@localhost zhoulinghong]# rpm -qa |grep MySQL     

MySQL-server-community-5.1.22-0.rhel4

已經安裝了。

2.Linux 下安裝mysql(rpm)

[root@localhost zhoulinghong]# rpm -ivh MySQL-server-community-5.1.22-0.rhel4.i386.rpm  

warning: MySQL-server-community-5.1.22-0.rhel4.i386.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5

error: Failed dependencies:

        perl(DBI) is needed by MySQL-server-community-5.1.22-0.rhel4.i386

    Suggested resolutions:

        perl-DBI-1.40-5.i386.rpm

呵呵,出錯了。Linux的弊端就出現了。安裝軟體的時候相互依賴太強了。。。看到上面錯誤資訊是缺少perl-DBI-1.40-5.i386.rpm包。沒有辦法只能安裝了

3.安裝依賴包

perl-DBI-1.40-5.i386.rpm 這個包在RedHat的CD2中。不用多想掛載光碟機吧。

[root@localhost mnt]# mount /dev/cdrom /mnt/cdrom

掛載成功以後。轉到 /mnt/cdrom/RedHat/RPMS目錄下面就有perl-DBI-1.40-5.i386.rpm 這個包了。

[root@localhost RPMS]# rpm -ivh perl-DBI-1.40-5.i386.rpm

warning: perl-DBI-1.40-5.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e

Preparing...                ########################################### [100%]

   1:perl-DBI               ########################################### [100%]

安裝成功。

OK,到現在的依賴包也安裝完了,就可以安裝mysql了。(注意:因為大家的環境不一樣,中間可能有其他的依賴包需要安裝,方法照上面就好了。)

4.安裝Mysql

[root@localhost zhoulinghong]# rpm -ihv MySQL-server-community-5.1.22-0.rhel4.i386.rpm

warning: MySQL-server-community-5.1.22-0.rhel4.i386.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5

Preparing...                ########################################### [100%]

   1:MySQL-server-community ########################################### [100%]

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !

To do so, start the server, then issue the following commands:

/usr/bin/mysqladmin -u root password 'new-password'

/usr/bin/mysqladmin -u root -h localhost.localdomain password 'new-password'

See the manual for more instructions.

Please report any problems with the /usr/bin/mysqlbug script!

The latest information about MySQL is available on the web at

http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

Notes regarding SELinux on this platform:

=========================================

The default policy might cause server startup to fail because it is

not allowed to access critical files. In this case, please update

your installation.

The default policy might also cause inavailability of SSL related

features because the server is not allowed to access /dev/random

and /dev/urandom. If this is a problem, please do the following:

1) install selinux-policy-targeted-sources from your OS vendor

  2) add the following two lines to /etc/selinux/targeted/src/policy/domains/program/mysqld.te:

       allow mysqld_t random_device_t:chr_file read;

       allow mysqld_t urandom_device_t:chr_file read;

  3) cd to /etc/selinux/targeted/src/policy and issue the following command:

       make load

Starting MySQL[  OK  ]

Giving mysqld 2 seconds to start

很明顯,安裝成功了。如果安裝失敗了就卸載一次在安裝一下就基本沒有什麼問題了。

  • 1
  • 2
  • 下一頁

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.