SQL access denied (#1044) importing database

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
mjboardman
New Member
New Member
Posts: 2
Joined: Mon Jan 17, 2011 11:55 pm

SQL access denied (#1044) importing database

Post by mjboardman »

I am trying to upload a new site that a friend has developed using CMSMS v1.9.2. I've tested it locally on my PC (XAMPP), and have uploaded the CMS folder to the site. I've also exported the local SQL database to an SQL file, ready to upload/import to the site.

I've updated config.php to point to what I believe are all the correct places (changed from C:\XAMPP... etc. to the public_htlml/CMS etc. locations).
When I run the import, I get "#1044 - Access denied for user 'mornstar'@'localhost' to database 'mstar'".
The database was created on a development system where the prefix and credentials are different than the settings on the site, and I suspect this is where my problem lies. What do I need to do to get the database imported?

At present, I have no database present on the site at all. Thanks for your help!
M
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

Re: SQL access denied (#1044) importing database

Post by Wishbone »

Are you using the correct username (mornstar), host (localhost), and password? If so, you will have to contact your hosting company.

How are you attempting to import your SQL file?
mjboardman
New Member
New Member
Posts: 2
Joined: Mon Jan 17, 2011 11:55 pm

[Solved] SQL access denied (#1044) importing database

Post by mjboardman »

Host helped me out... I needed to edit the exported SQL database on my PC. Here's the info they provided...

#1044 - Access denied for user 'username1'@'localhost' to database 'user2_wrdp9'
The problem here is your import file contains an SQL query that attempts to create a database for the wrong username. Notice the user2 in 'user2_wrdp9' does not match the username1 in 'username1'@'localhost'. Someone must edit the import file and change the old user2 to your new username1. Here is an example of what it looks like (notice 3 places where the username is outdated):

□□--□-- Database: `user2_wrdp9`□--□CREATE DATABASE `user2_wrdp9` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;□USE `user2_wrdp9`;□□--

#1044 - Access denied for user 'username1'@'localhost' to database 'wrdp9'
Same as the previous issue; the correct username is missing. On a shared sever, your database names must always look like something_something.
Locked

Return to “CMSMS Core”