我有兩個服務器名爲server1和server2.both具有不同的靜態IP地址。我想從server1訪問server2數據庫。兩臺服務器我已經安裝了PHPmyadmin.In Server1操作系統是Ubuntu,在server2 fedora12中。我想連接一個服務器數據庫到另一臺服務器
我已經做了this..mysql錯誤13即將
在Server2上的my.cnf包含
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0
# To allow mysqld to connect to a MySQL Cluster management daemon, uncomment
# these lines and adjust the connectstring as needed.
#ndbcluster
#ndb-connectstring="nodeid=4;host=localhost:1186"
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
[ndbd]
# If you are running a MySQL Cluster storage daemon (ndbd) on this machine,
# adjust its connection to the management daemon here.
# Note: ndbd init script requires this to include nodeid!
connect-string="nodeid=2;host=localhost:1186"
[ndb_mgm]
# connection string for MySQL Cluster management tool
connect-string="host=localhost:1186"
我覺得口是在MySQL的情況下,必須數據庫如果沒有錯誤! –
如果未指定,PHP會連接到默認端口(3306)。但你是對的:總是指定端口。 – HBv6