SQL error after transfering to live site

Permalink
After a long time hesitating I decided to upload my website to my live site. Everything works on my test site, but when I uploaded it to the live site I am getting this error, SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES), I did copy my site to a sub folder of my live site to test just in case there was a problem. Could this be causing this error? I was hoping I could test it before moving it to the Public folder. Any help would be appreciated.

Thanks
Phil

tambopc
 
jordif replied on at Permalink Reply
jordif
Hi Phil,

probably you need to update your database configuration (i.e. edit your application/config/database.php file and make sure the database credentials are ok)
tambopc replied on at Permalink Reply
tambopc
Hi Jordif
I have listed the code below and I think it looks ok to me. I have removed the user name and password. I have read CamelCase can be an issue when transferring to a domain server. Could this be my problem? Also does it make any difference having my website in a subfolder.

Phil

<?php
return array(
    'default-connection' => 'concrete',
    'connections' => array(
        'concrete' => array(
            'driver' => 'c5_pdo_mysql',
            'server' => 'localhost',
            'database' => 'tambopcdb',
            'username' => '     ',
            'password' => '           ',
            'charset' => 'utf8'
        )
    )
);
jordif replied on at Permalink Reply
jordif
Hi,

so when you uploaded the website files to a sub folder of your server, did you also create a new database and imported your local data? Did you follow these steps:

http://documentation.concrete5.org/developers/installation/moving-a...

You should have two databases in your live server: the original database for your live site, and the new database for the test webiste that you uploaded to a subdirectory.

According to the error you get, the concrete5 website in your directory cannot connect to the database (so it has nothing to do with CamelCase table names or with having your webiste in a subfolder).

So I'd double check you have a new database in your server for your test site and that the credentials in application/config/database.php are correct.

Jordi
tambopc replied on at Permalink Reply
tambopc
Hi Jordif
My current site does not use a database so I only have the new one I created through cpanel using the MySQL database wizard. I called it the same name, username and password as the database on my home computer then imported the database. I double checked the database.php file information was the same but I still get the same error. This is the link to my sitehttp://tambopc.org.au/C57/ . I don't where to go from here.

Phil
mesuva replied on at Permalink Reply
mesuva
From your site's error message it's going to be:

- you've not updated your /application/config/database.php file with the live database's username and password (and maybe database name). This is my first guess as it still looks like it's trying to login as 'root'.

- you need to give the user you created for your new database permissions to access the new database. In cPanel there is a section 'Add User to Database' where you can pick the database, pick then user and then assign a whole bunch of permissions (a page with lots of checkboxes).