mysql服务器端口号 [英] mysql server port number

查看:339
本文介绍了mysql服务器端口号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在我的服务器上建立了一个mysql数据库。我想通过我的网站使用PHP连接到这个。这是我的连接文件的内容:

I've just made a database on mysql on my server. I want to connect to this via my website using php. This is the contents of my connections file:

$dbhost = 'localhost';
$dbuser = 'root';
$dbpass = 'password';

$conn = mysql_connect($dbhost, $dbuser, $dbpass)
    or die('Error connecting to mysql');

$dbname = 'epub';
mysql_select_db($dbname);



我知道用户名/密码是什么,我知道服务器的IP地址。

I know what the username/passwords are, and I know the IP address of the server. What I'm just wondering is how do I know which port to use?

推荐答案

如果您的MySQL服务器运行默认设置,你不需要指定。

If your MySQL server runs on default settings, you don't need to specify that.

默认的MySQL端口是3306。

Default MySQL port is 3306.

[更新显示mysql_error ()用法]

[updated to show mysql_error() usage]

$conn = mysql_connect($dbhost, $dbuser, $dbpass)
    or die('Error connecting to mysql: '.mysql_error());

这篇关于mysql服务器端口号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆