在進行本文檔操作前,需要完成如下前期步驟:
1.
備注:RedMine部署在Ubuntu+Mysql環境下
Ubuntu
Mysql版本:5.1.41-3ubuntu12
2.
備注:部署系統中TestLink的Release需為1.8.0後版本。
1.
2.
3.
4.
配置文件包括:
?
?
5.
1.
sudo ufw disable
1.
2.
root@redmine:~# mysql -u root –p
Enter password:
3.
mysql>use mysql;
4.
mysql> GRANT ALL PRIVILEGES ON new_user.* TO remote@"%" IDENTIFIED BY "new_user_password"
說明:其中new_user為遠程登錄用戶名,new_user_password為遠程登錄用戶密碼。其中”%”說明對允許那台主機能夠遠程連接RedMine服務器的數據庫。
以上信息在部署過程中,根據實際情況進行設置,本文檔部署過程中,www.linuxidc.com 遠程登錄用戶名為設為remote,所有主機均可連接至RedMine服務器的數據庫。
5.
root@redmine sudo vi /etc/mysql/my.cnf
在舊版本中找到 skip-networking,把它注釋掉就可以了
#skip-networking
在新版本中:
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address
bind-address
#bind-address
或者把允許訪問的 ip 填上
#bind-address
然後重啟 MySQL
root@redmine sudo /etc/init.d/mysql restart
* Starting MySQL database server mysqld
* Checking for corrupt, not cleanly closed and upgrade needing tables.
andy@ubuntu:~$ sudo /etc/init.d/mysql start
* Starting MySQL database server mysqld
遠程登錄賬戶驗證,有兩種方式。
方式1:
1.
C:\xampp\mysql\bin>mysql -h 10.7.1.88 -u root -p
Enter password: *******
Welcome to the MySQL monitor.
Your MySQL connection id is 377
Server version: 5.1.41-3ubuntu12 (Ubuntu)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
出現mysql>標示測試通過。
方式2:
通過編寫test.php頁面,測試連通性。
<?
$link=mysql_connect('10.7.1.88','remote','******');
if(!$link){
echo "fail";
}
else{
echo "success";
}
mysql_close();
?>
說明:其中'10.7.1.88'為RedMine服務器MySql數據庫的IP地址,'remote','******'為遠程登錄賬號及密碼。
將test.php放在xampp根目錄下,通過http://localhost/test.php進行測試,如通過,則會出現success。
備注:如出現10061錯誤,是無法連接至數據庫的提示信息。