Home  >  Article  >  Backend Development  >  数据库联接如何写

数据库联接如何写

WBOY
WBOYOriginal
2016-06-13 10:00:30859browse

数据库联接怎么写?
Mysql的数据库默认连接端口3306,现在服务器上的端口被修改为3308了,要怎么修改那个数据库联接里面的$server啊?
谢谢

------解决方案--------------------
一般是这样
$server = "localhost:3308 ";
------解决方案--------------------
你用MYSQL还是MYSQLI接口:
MYSQL:
localhost:3308
MYSQLI:
localhost, '3308 '
------解决方案--------------------
localhost:3308

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn