Change the user name of a database

Started by madman71, April 13, 2011, 04:00:01 PM

Previous topic - Next topic

madman71

im gonna try to make this as clear as possible  ;D



I have 2 separate servers

Server 1 and Server 2 (2 separate hosting companies)

Im moving a forum from server 2 to server 1 (just condensing hosting costs).



Server 1 has a user "madman71"  that has a website running under this user name.


Server 2 has a user name "madman71"  also that has a website running under this user name.  Im moving madman71 to server 1.

Since i cant have 2 users named "madman71" in my directadmin control panel, I have created a new user on server 1 to run this transferred site.  We'll call the user "marko".

I got the forum moved over running under the "marko" account.  Now my issue.  I can not get the database to move over because  i can not get the server to allow database "madman71_data" to insert into my newly created database "marko_data".

i always run into this prob:

Unable to restore database marko_cover : ERROR 1044 (42000): Access denied for user 'madman71'@'localhost' to database 'marko_cover' gunzip: stdout: Broken pipe


I hope this is clear. 



sawz

look at the very beginning of your database, specifically the sql file. you'll see mention of the old db user name there and that block at the very start of the database can be removed i believe.
keep smiling, they'll always wonder what your up too.....


sawz

open it in notepad if it isn't too large and you'll see what i mean at the top.

anything before Table structure for table `smf_admin_info_files` can be removed i believe.
keep smiling, they'll always wonder what your up too.....

madman71

gottach!

Here's the first few lines.

-- ==========================================================
--
-- Database dump of tables in `madman71_cover`
-- April 13, 2011, 03:53:24 AM
--
-- ==========================================================


--
-- Table structure for table `smf_covadmin_info_files`




However, this didnt work, unless i did something wrong when uploading the database. 

Anyway, i ran Repair_settings.php again, and  just out of curiosity, i change the username to what it needs to be and now my forum loads.

Hopefully nothing is broken.

I'll give an update soon after i run some tests.

madman71

just an update. After  restoring my board completely, simply changing the user name of the database  with the repair_settings.php script  did the job.

Advertisement: