Help with Mysql

One common problem I have noticed is that people don't realise that all cPanel databases are prefixed with there user name and that they have to assign the rights for a user in MySQL to have access to a database they have made. brief description on making a database and allowing access to a user name first for this example the name of the domain that I am setting a database up on is "mydomain.com" go to your MySQL part of your controller and in the box that says "Create MySQL database" put the name of the database you require to make, I will use database1 as an example press the "Create MySQL database" button and that's it made Now goto "Create MySQL user" and put into the usernames box the username name you require to use and the password for that username in the second box, now press the button called "Create MySQL user" and that's a user name and password made. As an example I have made user1 and password 1 Now go down the page to find "Grant all permissions on a MySQL database to a MySQL user" there are two boxes called user and MySQL_Database with pull down tabs In my example I would need to select in user name "mydomain_user1" in the username box and "mydomain_database1" in the MySQL_Database box. Notice that I have had to select the boxes with my database and username with a prefix attached to it. Now this is important you must press the button called "Grant permissions" this is what people don't do Now look up the page until you come to the top top of the form called "Existing MySQL databases" and look down till as in my example you would find a database called "mydomain_database1" in bold on the left of the window and look directly below it and "Users in mydomain_database1" and and just below that there should be not in bold the user name that has the permission to access the database , in my example "mydomain_user1" and after it a little red X in a box that is used to delete the users permissions from that database if you want. right that's it you have your database and your user name and your password so in my example you would have these details for the database you have made $dbhost = 'localhost'; $dbname = 'mydomain_database1'; $dbuser = 'mydomain_user1'; $dbpasswd = 'password1';
  • 75 Users Found This Useful
Was this answer helpful?

Related Articles

Help with Myphpadmin

Everyone has there own way of working with phpMyAdmin, I find my way easy so I'll explain my way...

Apache suEXEC Support

CGI Scripting Notes We use the suEXEC wrapper that comes with Apache. This "wrapper" is a...

Do you support PHP?

Yes, our servers supports PHP scripts. File extension of PHP scripts should be ".php".

Powered by WHMCompleteSolution