12-27-2010
Make sure you have the correct username and password, if you are sure you have the correct login and pasword, then you need to check with your administrator because you seem to have either the wrong login id or password and that's why your script cannot connect to your mysql database.
check these four things to make sure you have them right:
1. your hostname (Make sure your database is on the machine you are trying to run the php from and is configured for"localhost")
2. your database username (not your hosting username, BUT your mysql)
3. Your database password
4. Your database name
5. your port is the same port as used in command line.
10 More Discussions You Might Find Interesting
1. Solaris
Hello,I must share file from Linux machine to Solaris.I've enabled ftp with svcadm enable ftp,when I connect from Linux box I have this
"Name (192.168.1.4:root): anonymous
331 Guest login ok,send your complete e-mail address as password
Password : (I give my e-mail address)
530 Login incorrect... (3 Replies)
Discussion started by: bgf0
3 Replies
2. Solaris
The localhost-access.log has a size 3gb. What can apache2 break log on the parts 300mb, or the other issue, make log every week and index it with prifix current date(localhost-access_date.log)?
Please help. (3 Replies)
Discussion started by: sotich82
3 Replies
3. Red Hat
Hi,
We were just recently given a new VM instance with Red Hat linux.
The only user account that can log in successfully is the root account. I made sure that the user z021407 has access to their directory and the account can read the home directory, but I can't log in with the new account... (2 Replies)
Discussion started by: edrichard
2 Replies
4. SuSE
Guys
i have 2 SUSE Linux Enterprise Server 10 SP1 (i586) boxes.if i take a look into /etc/security/access.conf ,i see following lines at the eof
# All other users should be denied to get access from all sources.
#- : ALL : ALL
- : myID : ALL
now earlier i had written scripts where files... (1 Reply)
Discussion started by: ak835
1 Replies
5. Solaris
Hi,
I have installed solaris 10 on my local system. i want to connect with remotely using putty. it works when i connect remotely with telnet. but when i connect using ssh. it gives access denied error.
i have comment the CONSOLE=/dev/console in /etc/default/login but it still don't work
Plz... (4 Replies)
Discussion started by: malikshahid85
4 Replies
6. AIX
There is one aix server, IP is 152.240.28.14, the user IP is 152.240.88.64, The user is able to get access briefly then all access is denied from the whole subnet 152.240.88.0. a short while later access is granted and the same thing happens all over again.
The customer is able to... (7 Replies)
Discussion started by: rainbow_bean
7 Replies
7. Red Hat
hi,
I have a problem with any user i created on a linux server RH.
With the user root i did:
adduser toto
passwd toto (to give it a password - message : "all authentication tokens updated successfully")
I can do a "su - toto", but when I try to connect it directly by ssh i have the message... (3 Replies)
Discussion started by: Castelior
3 Replies
8. Solaris
Hi All,
I have a root access for one of the server. But, when i try to cd one particular directory i will get the access denied message. Even though that particular directory is created under root. What would be the cause for this? I really wonder if any one have answer for my... (20 Replies)
Discussion started by: Sricharan21
20 Replies
9. UNIX for Dummies Questions & Answers
I login to a server and get a Access Denied Prompt but I clearly lets me into the prompt with Putty.
I do a sudo -s enter my password tells me Access Denied but I am clearly now Root
Just wondering why this is so? what is misconfigured? I mean its not prohibiting me from anything, this is more... (3 Replies)
Discussion started by: gkelly1117
3 Replies
10. UNIX for Advanced & Expert Users
The situation is: I have a RHEL 7.3 VM that I am able to access via both ssh and VM console. I am able to run all of the standard commands for verifying that X11 forwarding/xhost permissions are working (xclock, nautilus, firefox, etc.) i can also run the runInstaller for Oracle client, No problems... (1 Reply)
Discussion started by: melghaze
1 Replies
LEARN ABOUT PHP
mysql_list_dbs
MYSQL_LIST_DBS(3) 1 MYSQL_LIST_DBS(3)
mysql_list_dbs - List databases available on a MySQL server
SYNOPSIS
Warning
This function was deprecated in PHP 5.4.0, and will be removed in the future, along with the entirety of the original MySQL exten-
sion. Instead, the MySQLi or PDO_MySQL extension should be used. See also MySQL: choosing an API guide and related FAQ for more
information. Alternatives to this function include:
oSQL Query:
SHOW DATABASES
resource mysql_list_dbs ([resource $link_identifier = NULL])
DESCRIPTION
Returns a result pointer containing the databases available from the current mysql daemon.
o $
link_identifier -The MySQL connection. If the link identifier is not specified, the last link opened by mysql_connect(3) is
assumed. If no such link is found, it will try to create one as if mysql_connect(3) was called with no arguments. If no connection
is found or established, an E_WARNING level error is generated.
Returns a result pointer resource on success, or FALSE on failure. Use the mysql_tablename(3) function to traverse this result pointer, or
any function for result tables, such as mysql_fetch_array(3).
Example #1
mysql_list_dbs(3) example
<?php
// Usage without mysql_list_dbs()
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
$res = mysql_query("SHOW DATABASES");
while ($row = mysql_fetch_assoc($res)) {
echo $row['Database'] . "
";
}
// Deprecated as of PHP 5.4.0
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
$db_list = mysql_list_dbs($link);
while ($row = mysql_fetch_object($db_list)) {
echo $row->Database . "
";
}
?>
The above example will output something similar to:
database1
database2
database3
Note
For backward compatibility, the following deprecated alias may be used: mysql_listdbs(3)
mysql_db_name(3), mysql_select_db(3).
PHP Documentation Group MYSQL_LIST_DBS(3)