Connection to mysql DB

Avatar
  • updated
  • Answered

I have created a mysql DB and a user for that DB.


soloar5_art is the DB


soloar5_user is the user.


When I try to install the web site, I have to insert the parameters to connect the db.


I inserted:


host: localhost


database name : soloar5_artz


database user : soloar5_user


password : the password (if you need it, I can give you).


when I try to connect, I get this message:


The connection to the database server was established successfully.


Error: Could not connect to the database soloar5_artz.


I tried to install the web site on a my Virtual machine and I didn't get any problem.


Do you know what happen?


Thank


Francesco

Avatar
JacobIMH
Hello Francesco, and thank you very much for your question. It looks like you've already created your database, and the database user that you mentioned. However the database user was not assigned any permissions to the database, so that's why it's not allowing you to connect. I went ahead and did this for you, but for future reference you might want to try using the MySQL Database Wizard as it walks you through this step at the end after creating your database and database user. Alternatively after you log into cPanel, under the Databases section click on MySQL Databases. Then at the bottom of that page under the Add User To Database section, simply select the user and database you'd like to assign them to from the drop-downs and click on Add. Here you'll be presented a list of permissions you can give the database user, and in just about every case you'll just want to click on ALL PRIVILEGES, and then click on Make Changes. Now that your database user that you specified in your config.php script, has database permissions to the database you specified as well, it will be able to successfully connect. However now it looks like you're getting an error about a sessions table not existing. It looks like you still need to actually run the install process of your application in order to get it to populate your database with data now that it can connect. I hope this information was helpful to you, if you have any further follow up questions at all, please don't hesitate to ask. - Jacob