Home Backend Development PHP Tutorial 创设了两个Mysql数据库,php里却只能连接到一个

创设了两个Mysql数据库,php里却只能连接到一个

Jun 13, 2016 pm 01:15 PM
bbs db developer quot return

创建了两个Mysql数据库,php里却只能连接到一个
我在本地服务器创建了两个数据库,test 和 bbs
使用的时候只有test 可以连接上,bbs 连接不了

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->function db_connect()
{
   $db = @new mysqli("127.0.0.1", "developer", "123456", "test");
   if (!$db)
      return false;
   return $db;
}
Copy after login

上边这个可以连接到,下边这个却不可以
PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->function db_connect()
{
   $db = @new mysqli("127.0.0.1", "developer", "123456", "bbs");
   if (!$db)
      return false;
   return $db;
}
Copy after login



------解决方案--------------------
貌似是用户没权限。。
------解决方案--------------------
developer 用户没有操作 bbs 的权限,你应给给足权限。
Statement of this Website
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Comparative analysis of Oracle and DB2 database technology Comparative analysis of Oracle and DB2 database technology Mar 11, 2024 am 09:54 AM

Oracle and DB2 are two well-known relational database management systems (RDBMS) that are widely used in enterprise applications. In this article, we will compare the two database technologies of Oracle and DB2 and analyze them in detail, including analysis of their characteristics, performance, functions and usage examples. 1. Overview of Oracle database technology Oracle is a relational database management system developed by Oracle Corporation of the United States. It is widely used in enterprise-level applications and has strong performance and stability.

Detailed explanation of the usage of return in C language Detailed explanation of the usage of return in C language Oct 07, 2023 am 10:58 AM

The usage of return in C language is: 1. For functions whose return value type is void, you can use the return statement to end the execution of the function early; 2. For functions whose return value type is not void, the function of the return statement is to end the execution of the function. The result is returned to the caller; 3. End the execution of the function early. Inside the function, we can use the return statement to end the execution of the function early, even if the function does not return a value.

Comparison and differences of SQL syntax between Oracle and DB2 Comparison and differences of SQL syntax between Oracle and DB2 Mar 11, 2024 pm 12:09 PM

Oracle and DB2 are two commonly used relational database management systems, each of which has its own unique SQL syntax and characteristics. This article will compare and differ between the SQL syntax of Oracle and DB2, and provide specific code examples. Database connection In Oracle, use the following statement to connect to the database: CONNECTusername/password@database. In DB2, the statement to connect to the database is as follows: CONNECTTOdataba

What does bbs mean? What does bbs mean? Jan 04, 2024 am 10:56 AM

The full English name of BBS is "Bulletin Board System", and the Chinese name is "Electronic Bulletin Board System". In China, it is generally called an Internet forum. In its early days, it had the same nature as bulletin boards on the streets and on campus, except that it was used to spread or obtain information through computers. It was not until personal computers began to become popular that someone tried to transfer the BBS on Apple computers to personal computers, and BBS began to gradually become popular.

What is the execution order of return and finally statements in Java? What is the execution order of return and finally statements in Java? Apr 25, 2023 pm 07:55 PM

Source code: publicclassReturnFinallyDemo{publicstaticvoidmain(String[]args){System.out.println(case1());}publicstaticintcase1(){intx;try{x=1;returnx;}finally{x=3;}}}#Output The output of the above code can simply conclude: return is executed before finally. Let's take a look at what happens at the bytecode level. The following intercepts part of the bytecode of the case1 method, and compares the source code to annotate the meaning of each instruction in

What file format is db? What file format is db? May 19, 2021 am 11:56 AM

db is the abbreviation of "datebase", which is a format of "database file". It is a file used by software to store data, which is equivalent to a database. Each software has its own storage format. For example, "Thumbs.db" under Win7 system is a thumbnail data file, so the db file is not a specific file format.

what does bbs mean what does bbs mean Jan 14, 2021 pm 05:52 PM

The full name of bbs is Bulletin Board System, which means "electronic bulletin board system" in Chinese. It generally refers to an online forum and is an online communication place related to network technology; BBS generally refers to an online forum or online community. The characteristics of BBS: large amount of information, fast information update, and strong interactivity.

Comparative analysis of Oracle and DB2 database performance Comparative analysis of Oracle and DB2 database performance Mar 09, 2024 pm 10:00 PM

Oracle and DB2 databases are two leading relational database management systems that are widely used in enterprise-level applications. In practical applications, database performance is often one of the important indicators for evaluating the quality of a database system. This article will conduct a comparative analysis of the performance of Oracle and DB2 databases, and use specific code examples to demonstrate the differences between them. 1. Oracle database performance analysis Oracle database is a powerful database management system with good scalability and stability.

See all articles