News
: October 6, 2008 -
Submit Your Site for the October 2008 Site of the Month!
Home
Help
Search
Calendar
Login
Register
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
October 13, 2008, 03:11:53 AM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Web Hosting Forum | Lunarpages
>
Lunarpages Web Hosting - Advanced Assistance
>
Lunarpages - VPS Hosting
>
Problems connecting to mysql database on my server
Pages: [
1
]
Go Down
« previous
next »
Print
Author
Topic: Problems connecting to mysql database on my server (Read 670 times)
quentiz
Newbie
Offline
Posts: 1
Problems connecting to mysql database on my server
«
on:
May 24, 2007, 08:00:48 AM »
I have tried to connect to the mysql database that is on my server through a php script connection and dreamweaver, but I continuous get this error.
Mysql Error#: 1045
Access denied for user ‘admin’@localhost (using password: YES)
However, I can connect to the mysql database through shell and phpmyadmin that plesk provides. I know that I am using the correct username and password because I created them. I have actually created several different usernames and passwords and they all have failed to connect through the php scripts.
In addition, when I create a user with shell this user does not show up in the plesk interface under users of a particular database.
Furthermore, when I first attempted to use the phpmyadmin through plesk it asked me to update my priviledges table with this command: “mysql_fix_privilege_tables”. Which I did.
Here is the script I am using
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname = "localhost";
$database = "cn";
$username = "admin";
$password = "mypassword";
$connection = mysql_connect($hostname, $username, $password) or trigger_error(mysql_error(),E_USER_ERROR);
?>
Simply put, can someone offer any advice on how I can connect to the mysql database on my server?
Logged
perestrelka
Administrator
Master Jedi
Offline
Posts: 1058
Re: Problems connecting to mysql database on my server
«
Reply #1 on:
May 24, 2007, 10:14:20 PM »
Hello,
I would not recommend to use login 'admin' for your MySQL user because such user is used by Plesk to manage MySQL server. This means that you added a duplicate user with such name and more than likely this is causing the access denied error.
To get a database user listed under a specific database in Plesk, you need to create the user via Plesk. If a database login was created via shell, Plesk has no idea which database it should show the user under.
Please try to use a user created via Plesk to connect to MySQL through PHP and Dreamweaver and let me know about the result.
I hope this is helpful.
Logged
Kind Regards,
Vlad Artamonov
Pages: [
1
]
Go Up
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Lunarpages Web Hosting - Information & Opportunities
-----------------------------
=> Lunarpages Web Hosting - Announcements
=> Lunarpages Web Hosting - Hosting Plans & Site Information
=> Job Opportunities at Lunarpages Web Hosting
=> Lunarpages Web Hosting - Network Information
=> Lunarpages Web Hosting - Server Information
-----------------------------
Lunarpages Web Hosting - Before Signing Up
-----------------------------
=> Lunarpages Web Hosting Plans - Pre-Sales Questions
-----------------------------
Lunarpages Web Hosting - Online Help Desk
-----------------------------
=> Lunarpages - Webhosting Help
=> Lunarpages - Beginner Assistance
=> Lunarpages - How to's
=> E-mail with your Lunarpages Hosting Plan
=> Lunarpages - CPanel Help
=> Lunarpages - LPCP Beta
=> Lunarpages - Ecommerce Hosting
=> Lunarpages - FrontPage
=> Lunarpages - DreamWeaver
=> Lunarpages - Message Boards-Forums-Fantastico Scripts
===> Lunarpages - Joomla / Mambo
-----------------------------
Lunarpages Web Hosting - Advanced Assistance
-----------------------------
=> Web Management
=> Lunarpages - Webdesign and HTML
=> Lunarpages - Search Engine Optimization
=> Lunarpages - Animation & Flash
=> Lunarpages - Graphics
=> Lunarpages - Web Hosting, Email & PC Security
=> Lunarpages - Dedicated Web Hosting
===> Lunarpages - cPanel & WHM
===> Lunarpages - General
===> Lunarpages - Plesk
===> Lunarpages - Security
===> Lunarpages - Tutorials
===> Lunarpages - Webmin
=> Lunarpages - Reseller Web Hosting
===> Lunarpages - WHM
=> Lunarpages - VPS Hosting
=> Lunarpages - SharePoint Services (Beta)
-----------------------------
Lunarpages Web Hosting - Coding
-----------------------------
=> Lunarpages - ASP
=> Lunarpages - C++ / PERL / CGI
=> Lunarpages - PHP & MySQL
=> Lunarpages - Java Applets & Javascript
=> Lunarpages - JSP & Servlets
=> Lunarpages - Ruby Hosting
=> Lunarpages - Windows Development & Hosting
-----------------------------
Lunarpages Web Hosting - Entertainment
-----------------------------
=> Lunarpages - Chat & Stuff!
=> Lunarpages - Contests
=> Fun at Lunarpages!!
=> Lunarpages - Online Gaming
-----------------------------
Lunarpages Web Hosting - General
-----------------------------
=> Social Networking
=> Lunarpages Free Web Hosting - Education Program
=> Lunarpages - Affiliate Program
=> Introduce Yourself to the Lunarpages Forum Community!
=> Your Websites & Creations at Lunarpages!
=> Lunarpages Website of the Month
=> Lunarpages - Service and Trade
Loading...