weberatiadmin Posted October 8, 2004 Posted October 8, 2004 I was setting up a database and then.... I got this. DBI connect('mysql:localhost','root',...) failed: Access denied for user: 'root@localhost' (Using password: YES) at /usr/local/cpanel/Cpanel/Mysql.pm line 42 So of course nothing works now - What could I Have Done Wrong? Quote
TCH-Don Posted October 8, 2004 Posted October 8, 2004 After you create the database, you need to create a user and then add that user to the database. All in mysql in cpanel. Then look at the sample connect strings that shows what goes in the config part of your script. like cpanelname_databasename and cpanelname_username Quote
TCH-Don Posted October 8, 2004 Posted October 8, 2004 Oh yes, Welcome to the Family and your new home! We really are like family here. So if you need anything, just ask your new family! We love to help Quote
TCH-Bruce Posted October 8, 2004 Posted October 8, 2004 Welcome to the family! Glad to have you here. Quote
TCH-Rob Posted October 8, 2004 Posted October 8, 2004 Welcome to the forums and welcome home. Thumbs Up Quote
Hazel Posted October 12, 2004 Posted October 12, 2004 Hello,, I have the same problem... Well, I created a database. then ,I created a user. then (again) I made the user be connected to the database... But, when I connect PHPmyadmin, the default user is cpanel_name@localhost ... How can I change the user? (the problem is that I have an error, and the default user has NOT privileges) Please, Could someone explain slowly the steps I should follow in order to change the privilages of the default user and how to change user? Quote
TCH-Don Posted October 12, 2004 Posted October 12, 2004 (edited) First in cpanel goto MySQL Databases you should see MySQL Account Maintenance (and the databases listed below like this with the user shown right below the database, and the sample connection strings that can be used in a config file or to connect to the database, in this case for a guestbook.) Databases: cpanelname_agbook1 Users in agbook1 cpanelname_username (Privileges: ALL PRIVILEGES) Connection Strings Perl $dbh = DBI->connect("DBI:mysql:cpanelname_agbook1:localhost", "cpanelname_username","<PASSWORD HERE>"); PHP $dbh=mysql_connect ("localhost", "cpanelname_username", "<PASSWORD HERE>") or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db ("cpanelname_agbook1"); if you do not see the user with the privileges look father down to the two drop boxes to select user and database and select the user you created and the database and click on Add user to database then you should see the above. and then in phpMyAdmin you should see Server: localhostlocalhost Database: cpanelname_agbook1 does that help? Edited October 12, 2004 by TCH-Don Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.