/    Sign up×
Community /Pin to ProfileBookmark

My PHP website cannot open MySQL database using mySQL


————————————————————————–

Warning: mysql_connect() [function.mysql-connect]: Access denied for user ‘ODBC’@’localhost’ (using password: NO) in C:Program FilesApache GroupApache2htdocstest****Boarddbmysql.php on line 25

MySQL says: 1045: Access denied for user ‘ODBC’@’localhost’ (using password: NO)

There has been an error with the database. Please try re-loading the page. Please contact the administrator if the problem is not solved.
————————————————————————–

This is what I.E. shows when i open my website example.
The example has 2 databases .php
They do not work probably because password is not listed in their code. (?)
I tried to type my password in a line:

var $user=” ‘This is where i typed my root password’ “;
var $pass=” ‘This is where i typed my root password’ “;
var $admin=” ‘This is where i typed my root password’ “;

None of these worked.
Also there is nothing on the line 25, which is error line.

to post a comment
PHP

8 Comments(s)

Copy linkTweet thisAlerts:
@NogDogSep 30.2006 — $user is probably supposed to be a database user name, not a password.

$pass should then be the password for that database user name.
Copy linkTweet thisAlerts:
@blazer1Oct 01.2006 — bro it sounds like this is the first time u ever created a conn to a DB.

for starters have u set up a DB user account? If you intend on doing so then using 'root' as the login name, login ... there may be no password so dont enter a password ... unless u have created one.

create a new user name and password and use these login details in your script.

also, its best to keep all user, pass, host **** in a different file ... kind of like modularity.
Copy linkTweet thisAlerts:
@homer_j_simpsonOct 02.2006 — The free hosting service which I'm currently using doesn't allow to create database without username and password. I think urs could be like mine. Create username and password in cpanel and supply those when u make connection. Otherwise u'll get an error message like " Access denied ...using password no".
Copy linkTweet thisAlerts:
@RecoilauthorOct 02.2006 — I solved this problem.

But next one appeared

MYSQL CANNOT RECOGNISE MY DATABASE

IT GIVES ME THE MESSAGE that it cannot find the database

No database selected. :mad:

And i am new to PHP+mySQL
Copy linkTweet thisAlerts:
@RecoilauthorOct 02.2006 — Trying to select database in command prompt did not effect anything.

use [DB name];
Copy linkTweet thisAlerts:
@chazzyOct 02.2006 — in your application, do you call the select db function?

[code=php]mysql_select_db("databasename",[$connection]);[/code]?
Copy linkTweet thisAlerts:
@becker12480Oct 08.2006 — HI I am also new to this and getting just a blank page. how did you get past this.
Copy linkTweet thisAlerts:
@chazzyOct 08.2006 — blank pages typically mean there's a syntax error somewhere and error reporting is too high on the server to send the response.
×

Success!

Help @Recoil spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...