Ubuntu 11.04 安裝 MySQL 5.5

來源:互聯網
上載者:User

1) 下載Mysql5.5的Linux - Generic包:http://download.softagency.net/mysql/Downloads/MySQL-5.5/我下載的是 mysql-5.5.17-linux2.6-x86_64.tar.gz。
2) 確定已安裝的mysql被徹底卸載了詳見 Ubuntu 11.04 通過 apt 安裝 Mysql 5.1 的全過程記錄 (見  )中關於如何卸載Mysql5.1的詳細說明確認如下目錄和檔案已被刪除$ sudo rm -R /etc/mysql$ sudo rm /etc/my.cnf$ sudo rm /etc/init.d/mysql
3) 安裝$ su -- 切換到root帳號# apt-get install libaio-dev # groupadd mysql -- 添加mysql使用者組# useradd -r -g mysql mysql -- 添加mysql使用者# cd /usr/local# tar zxvf /path/to/mysql-VERSION-OS.tar.gz -- 解壓二進位安裝包# ln -s full-path-to-mysql-VERSION-OS mysql -- 建立軟連結# cd mysql# chown -R mysql . -- 修改目錄所屬的擁有者# chgrp -R mysql . -- 修改目錄所屬的使用者組# scripts/mysql_install_db --user=mysql -- 執行資料庫安裝命令

Installing MySQL system tables...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin -u root -h bcserver4utest password 'new-password'

Alternatively you can run:
./bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd . ; ./bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd ./mysql-test ; perl mysql-test-run.pl

Please report any problems with the ./bin/mysqlbug script!
# chown -R root .# chown -R mysql data# cp support-files/my-medium.cnf /etc/my.cnf -- [可選]複製設定檔
4) 以mysql使用者在後台啟動資料庫 # bin/mysqld_safe --user=mysql & 
預設情況:資料檔案在data目錄下
5) 建立自啟動指令碼# cp support-files/mysql.server /etc/init.d/mysql以後啟動直接輸入 # /etc/init.d/mysql restart|start
進入資料庫管理命令 $ bin/mysql -u -root -p 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.