抓原始碼安裝 MySQL 的隨手記錄

o 正式 build MySQL 之前先跑 configure shell 取得 build 資訊:
./configure –prefix=/usr/local/mysql –with-charset=utf8 –with-collation=utf8_unicode_ci

o Build 並且安裝 MySQL:
make; make install

o 安裝基礎的 MySQL database
[root@www mysql]# bin/mysql_install_db –user=mysql
Installing all prepared tables
Fill help tables

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:
/usr/local/mysql/bin/mysqladmin -u root password ‘new-password’
/usr/local/mysql/bin/mysqladmin -u root -h www.chihchia.com password ‘new-password’
See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr/local/mysql ; /usr/local/mysql/bin/mysqld_safe &

You can test the MySQL daemon with the benchmarks in the ‘sql-bench’ directory:
cd sql-bench ; perl run-all-tests

Please report any problems with the /usr/local/mysql/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

o 設定 MySQL db 所屬目錄擁有者,並且跑起 MySQL 來測試看看:
shell> chown -R root .
shell> chown -R mysql var
shell> chgrp -R mysql .
shell> bin/mysqld_safe –user=mysql &

注意:
安裝好基礎的 MySQL database 後,mysql_install_db 也會順道建立幾個 root 名稱的使用者,這些使用者的帳號之密碼都沒設定,如之前資訊所示,跑起 MySQL darmon 以後請用 /usr/local/mysql/bin/mysqladmin 去幫那些帳號設定密碼:

/usr/local/mysql/bin/mysqladmin -u root password ‘new-password
/usr/local/mysql/bin/mysqladmin -u root -h www.zhupiter.com password ‘new-password

用 /usr/local/mysql/bin/mysql_secure_installation 問答介面方式設定。

你喜歡這篇文章嗎? 馬上分享它:

相關文章:

  1. 安裝 PHP 時出現error: Cannot find MySQL header files under yes的錯誤訊息
  2. 將MySQL升級成4.1版遇到 ‘Warning: mysql_connect() [function.mysql-connect]: Client does not support authentication protocol requested by server; consider upgrading MySQL client in …..’ 錯誤訊息要如何解?
  3. 關於修正 PHP 與 MySQL 間的字集校對問題
  4. [Apache][MySQL] error_log: [crit] (70023)This function has not been implemented on this platform: DBD: driver for [DBDriver unset] not available
  5. 隨記: MySQL 語法中比較數字
This entry was posted in MySQL, 架站, 隨記 and tagged , . Bookmark the permalink.

Leave a Reply