Jump to content

Recommended Posts

Posted

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?

Posted

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

Posted

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? <_<

Posted (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 by TCH-Don

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...