|
Joined: Feb 2002
Posts: 91
Journeyman
|
Journeyman
Joined: Feb 2002
Posts: 91 |
I did a mysqldump, so I have all the tables and data. I purged the data from the database. When I try to read the file back into the database, I get an error that the tables already exist. So what is the best way to proceed? Delete every table one by one, or create a new empty database? This is my first time with mysql, it case you had not noticed [] https://www.ubbdev.com/threads/php/images/icons/smile.gif[/]
------------- Youuuuuuuuuuu Rang?
|
|
|
|
Joined: May 1999
Posts: 90
Member
|
Member
Joined: May 1999
Posts: 90 |
You can either delete all tables, modify the dump (insert 'if not exists' after each 'create table' so mysql won't try to create them if they exist) or drop the database and create it again (this is the fastest way):
mysqladmin -u w3tusername -p drop dbname mysqladmin -u w3tusername -p create dbname cat dbdump | mysql -u w3tusername -p dbname
|
|
|
|
Joined: Feb 2002
Posts: 91
Journeyman
|
Journeyman
Joined: Feb 2002
Posts: 91 |
Thanks.
I went ahead and dropped the database.
I then created a new empty database.
Then I repopulated the database from the dump file.
When I go to the main index, I get an error that says "SQL ERROR: Database error only visible to forum administrators".
When I click login I get "We encountered a problem. The reason reported was:
Username/Password not found."
So I can't see whats going on unless I log in, and it won't let me log in.
I thought that after I repopulated from the dump the database would be an exact copy of how it was when I did the dump. I do see all my boards and posts on the index. I can actually go into the boards and read the posts too.
I am using 5.5.1 and cookies if that matters.
tia
------------- Youuuuuuuuuuu Rang?
|
|
|
|
Joined: Feb 2002
Posts: 91
Journeyman
|
Journeyman
Joined: Feb 2002
Posts: 91 |
Wel I fixed it, fort of.
I deleted my cookie, then I was able to log in and all was as it should be.
My concern now is if I have to do this for real, getting thousands of users to delete their cookie would be a nightmare.
------------- Youuuuuuuuuuu Rang?
|
|
|
|
Joined: Feb 2002
Posts: 91
Journeyman
|
Journeyman
Joined: Feb 2002
Posts: 91 |
I was curious since this appeared to be a cookie issue if the fact that I had logged in as various test users was causing the problems.
So I started over.
First I deleted my cookies (I had 2 for some reason), then logged back in.
Next was a mysqldump.
Then create a new empty database.
Then repopulate the database from the dump.
Back to the index, no errors, all was as it should be.
So it looks like the only time users would see the mysql errors and not be able to log in is if they had logged in before as more than one user.
Still a problem, but not as bad.
------------- Youuuuuuuuuuu Rang?
|
|
|
|
Joined: May 1999
Posts: 90
Member
|
Member
Joined: May 1999
Posts: 90 |
For some reason your cookies are not deleted properly (presumably by the setcookie calls in logout.php). The drop/create/restore dump doesn't have anything to do with it.
|
|
|
|
Joined: Feb 2002
Posts: 91
Journeyman
|
Journeyman
Joined: Feb 2002
Posts: 91 |
In reply to:
For some reason your cookies are not deleted properly (presumably by the setcookie calls in logout.php). The drop/create/restore dump doesn't have anything to do with it.
Let me ask you this. I am logged in as user1. I mysql dump. I logout, then log in as user2. I drop the database, the repopulate from the dump. Now the last time the database saw me, I was user1, but my cookie is currently user2. Would that cause a problem?
------------- Youuuuuuuuuuu Rang?
|
|
|
|
Joined: May 1999
Posts: 90
Member
|
Member
Joined: May 1999
Posts: 90 |
> Now the last time the database saw me, I was user1, but my cookie is currently user2. The database does 'not know' who you are. When you visit the forum, your browser either have or doesn't have the (username/pass) cookies. If it doesn't have them, the forum sees you as anonymous. If it has them, they will be sent, the scripts will look up the username/pass combination in the database and will recognise you as that user if there is a matching username/pass record. The database 'knows' your last login time but that is used mostly for informational purposes.
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 5,833
Joined: January 2000
|
|
Forums63
Topics37,573
Posts293,925
Members13,849
|
Most Online5,166 Sep 15th, 2019
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|