Forums / General Questions / Removed local database from phpmyadmin by mistake

Removed local database from phpmyadmin by mistake

Locked
Results 1 to 20 of 67
This thread is locked. New replies are disabled.
06 Dec 2009, 00:35
#1
soulkreed avatar

soulkreed

Zen Follower

Join Date:
Nov 2009
Posts:
130
Plugin Contributions:
0

Removed local database from phpmyadmin by mistake

Can someone please help me,
I have deleted my local zen cart database tables in the phpmyadmin section and can no longer the tables ( zen cart {--} ) in the database drop down tab in the top left, the actual store ( local ) is all still there i just can't see it in phpmy admin or when i click on the store front link it say's and it also says the same thing in the admin section as well. ( see below )

1146 Table 'zen cart.configuration' doesn't exist
in:
[select configuration_key as cfgkey, configuration_value as cfgvalue from configuration]

It say's zen cart is there but it doesn't have any tables anymore..
Any thoughts?
06 Dec 2009, 01:44
#2
tino_schlegel avatar

tino_schlegel

Totally Zenned

Join Date:
Nov 2007
Posts:
532
Plugin Contributions:
0

Re: Removed local database from phpmyadmin by mistake

Well I you have deleted all tables, its basically all gone. Do you have a backup that you can import? Otherwise you can start from scratch and setup you Zencart again.

No backup, no way to get your data back. There is no undelete in MYSQL.
06 Dec 2009, 07:18
#3
soulkreed avatar

soulkreed

Zen Follower

Join Date:
Nov 2009
Posts:
130
Plugin Contributions:
0

Re: Removed local database from phpmyadmin by mistake

I have back ups but how do i import it back into phpmyadmin, i have tried but to no avail?
06 Dec 2009, 08:06
#4
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Posts:
6,263
Plugin Contributions:
3

Re: Removed local database from phpmyadmin by mistake

Soulkreed:

I have back ups but how do i import it back into phpmyadmin, i have tried but to no avail?


What format are your backup files in? An SQL export, or a local copy of the entire database?

If a local copy of the database you'll first need to export the data as 'SQL' (locally) and then usue the phpMyAdmin 'import' feature at the server.

If your backup is in SQL format on the server, then simply re-import the data.

Cheers
Rod
06 Dec 2009, 23:18
#5
soulkreed avatar

soulkreed

Zen Follower

Join Date:
Nov 2009
Posts:
130
Plugin Contributions:
0

Re: Removed local database from phpmyadmin by mistake

Hi,
can you tell me do i use the phpmyadmin on my local server to import/re-install copy of database/zencart ? ) if it is the phpmyadmin local i cannot find the import button, there is one in the phpmyadmin on my dot easy server though. I am unsure of the process itself, can you please tell me what to do? If i do import using dot easy server, do i just click on import and go find the folder/file and import it, if so how do i get it back onto my local computer if i have uploaded it to my server?

The back up i have is SQL format.

Cheers.
06 Dec 2009, 23:30
#6
koesbong avatar

koesbong

New Zenner

Join Date:
Feb 2009
Posts:
30
Plugin Contributions:
0

Re: Removed local database from phpmyadmin by mistake

in phpmyadmin, re-create the database for your zencart. then on one of the tabs on top, there's a tab called Import. Click that and then select the backup sql file, then import.
07 Dec 2009, 02:40
#7
soulkreed avatar

soulkreed

Zen Follower

Join Date:
Nov 2009
Posts:
130
Plugin Contributions:
0

Re: Removed local database from phpmyadmin by mistake

Hi, I am not sure which phpmyadmin you are refering to here. ( you see i have two of them, a local version and a server version with dot easy )
Let me begin again. The phpmyadmin in my local application no longer has any tables affixed to it ( it basically doesn't exist ), there is still a name in the database drop down tab that say's zen cart however there are no files attached to it. In regards to there being an import ' button up the top of my phpmyadmin ( local version ), there is no such button, yet there is an import button on my dot easy server/host. The problem i'm having is with my local test version of the zen cart store, I have mistakenly deleted the tables for it in my local application ( not my server account - this is working fine ) are you telling me to use the phpmyadmin on my local application ( the one that came with the original zen cart install ) - ( and if that is the case why can't i find the import button ) or are you saying i am to use the phpmyadmin on my dot easy server to import the SQL file? If the later is the case then how do i get it from the dot easy server back to my phpmyadmin on my local installation.
Please understand that i have two phpmyadmin applications, one is for my local ( zen cart store for testing purposes only ) and the other phpmyadmin is associated with my main online/live zen cart store and website that is with dot easy.
I do all my modifications on the local test cart before i upload/overwrite anything on my real site. It is the local zen cart store that i can no longer get into look at as i have deleted the tables/files from my local version of phpmyadmin. ( there is nothing wrong with my real store - well, a few things but not related to this at any rate, lol )
When i am given information on importing files into my phpmyadmin i need to know which one you are refering to ( as I have two of them )
Hope i'm not being to neurotic here but if i don't get specific instructions i may stuff it up even more than i already have.
I don't see how importing something into my dot easy server ( real site/store )has anything to do with my local phpmyadmin zen cart install on my computer, although i cannot find an import tab on it anywhere.
Very confusing, can someone please tell me what to do, is it my local phpmyadmin that i need to be working with ( i would think so, but, i am a newbie so ) if it's the php dot easy myadmin then how do i get it back into my local phpmyadmin application so i can see my store on my local computer.

Cheers.
07 Dec 2009, 04:24
#8
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Posts:
6,263
Plugin Contributions:
3

Re: Removed local database from phpmyadmin by mistake

Soulkreed:


The back up i have is SQL format.


IF your backup is in SQL (text) format you'll only need to go to your dot easy account, start phpmyAdmin. select the 'import' tab, browse to your SQL backup, then press the 'go' button.

Soulkreed:


can you tell me do i use the phpmyadmin on my local server to import/re-install copy of database/zencart ? )


Importing your backup data into your local server isn't going to help you restore the data that you deleted on your dot easy server.

Soulkreed:


If i do import using dot easy server, do i just click on import and go find the folder/file and import it,


Yes.

Soulkreed:


if so how do i get it back onto my local computer if i have uploaded it to my server?


You'd use the same backup file that you plan to use to restore your dot easy server.

I really can't understand why you'd be needing to do this though, unless you managed to delete the data from both servers ?????

Rgds
Rod
07 Dec 2009, 05:25
#9
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Posts:
6,263
Plugin Contributions:
3

Re: Removed local database from phpmyadmin by mistake

Soulkreed:

Hi, I am not sure which phpmyadmin you are refering to here.


Neither are (were) we. :-)

Soulkreed:


( you see i have two of them, a local version and a server version with dot easy )


This is normal/typical if you are doing development locally.

Soulkreed:


Let me begin again. The phpmyadmin in my local application no longer has any tables affixed to it ( it basically doesn't exist ),


My apologies, I was initially under the impression that you'd deleted the tables on your dot easy account (live server).

Soulkreed:


there is still a name in the database drop down tab that say's zen cart however there are no files attached to it. In regards to there being an import ' button up the top of my phpmyadmin ( local version ), there is no such button,


This is *highly* unusual.
Do you have the 'query', 'export', 'operations' and 'privileges' buttons, or are they missing too?


Soulkreed:


are you telling me to use the phpmyadmin on my local application ( the one that came with the original zen cart install )


We aren't really 'telling' you anything - which one you need to use depends on whether you are trying to export or import data and where you wish to export it too and from.

Soulkreed:


- ( and if that is the case why can't i find the import button )


Good question. Did you delete any other tables besides the zencart ones? The 'mysql' data table for instance?

Soulkreed:


or are you saying i am to use the phpmyadmin on my dot easy server to import the SQL file?
If the later is the case then how do i get it from the dot easy server back to my phpmyadmin on my local installation.
Please understand that i have two phpmyadmin applications, one is for my local ( zen cart store for testing purposes only ) and the other phpmyadmin is associated with my main online/live zen cart store and website that is with dot easy.


If you sit down and think about what you are trying to achieve, the answers should be obvious.

import = to bring in.
export = to send out.

Do you want to bring the data into your local server, or do you want to bring it in to your dot easy server?

Soulkreed:


I do all my modifications on the local test cart before i upload/overwrite anything on my real site.


Including the database????? How are you getting the database entries from your local server to the dot easy server?
Other than for an initial installation (and only then, if lots of products have been added) WHY would you even want to copy database changes to the dot easy server? (or vice verci)

I also do all my development on a local server, but I'm quite happy to use the zencart default items in my local database, the products in our live store are totally different. I've never seen any real need to replicate the database in the manner that you are attempting. Not even for backup purposes.


Soulkreed:


It is the local zen cart store that i can no longer get into look at as i have deleted the tables/files from my local version of phpmyadmin.


Small correction. phpMyadmin is simply a *tool* it doesn't store data. The data is stored in MySQL data tables. phpMyAdmin is just one of many tools that allow you to view and manipulate the database.

Soulkreed:


When i am given information on importing files into my phpmyadmin i need to know which one you are refering to


For MOST people, when they are talking about zen-cart issues they are referring to their live store, and this is the assumption I (and probably others) first made, until you came along with more specific information.

Soulkreed:


Hope i'm not being to neurotic here but if i don't get specific instructions i may stuff it up even more than i already have.


The entire point of doing development on a local machine rather than a live server is that it actually allows to to make stuffups and no one will ever need to know about them.

Soulkreed:


I don't see how importing something into my dot easy server ( real site/store )has anything to do with my local phpmyadmin zen cart install on my computer,


It doesn't.

Soulkreed:


although i cannot find an import tab on it anywhere.


This is a mystery unto itself. It raises the question of what else did you delete that we don't know about?

Soulkreed:


Very confusing, can someone please tell me what to do, is it my local phpmyadmin that i need to be working with


It really *shouldn't* be confusing... you export from one, import to the other, depending on which way you wish the data to move.

Soulkreed:


( i would think so, but, i am a newbie so )


Not wishing to offend, but being a 'newbie' is no excuse for not being able to make common sense decisions.

Furthermore, you are also expected to make mistakes. No one learns anything if everything goes right the first time. The learning, or the bit that will advance you to becoming more than a 'newbie' is the ability to fix things when they do go wrong.

Soulkreed:


if it's the php dot easy myadmin then how do i get it back into my local phpmyadmin application so i can see my store on my local computer.
Cheers.


Export from dot easy, import to local.

The question now is, why doesn't your local phpmyAdmin have the import option available?

Cheers
Rod
07 Dec 2009, 06:56
#10
soulkreed avatar

soulkreed

Zen Follower

Join Date:
Nov 2009
Posts:
130
Plugin Contributions:
0

Re: Removed local database from phpmyadmin by mistake

Hi Rod,
thanks for the help, much appreciated.
Below i have answered some of your questions.

This is *highly* unusual.
Do you have the 'query', 'export', 'operations' and 'privileges' buttons, or are they missing too?

I have query, export, operations but no privileges.

Good question. Did you delete any other tables besides the zencart ones? The 'mysql' data table for instance?

No, they are still there as far as I can see.

Including the database????? How are you getting the database entries from your local server to the dot easy server?
Other than for an initial installation (and only then, if lots of products have been added) WHY would you even want to copy database changes to the dot easy server? (or vice verci)

When I am in the filezilla ( ftp ) transfer program the files are all still there on my local and I just transfer them over to my live dot easy account etc. The files are there i just can't access them via my phpmyadmin in my local application or actually see the store or the admin section when i click on there tabs.

I also do all my development on a local server, but I'm quite happy to use the zencart default items in my local database, the products in our live store are totally different. I've never seen any real need to replicate the database in the manner that you are attempting. Not even for backup purposes.

I am not sure about how i am doing it or if it's right or not, i hope the above answers that for you.


This is a mystery unto itself. It raises the question of what else did you delete that we don't know about?

Hopefully nothing..



It really *shouldn't* be confusing... you export from one, import to the other, depending on which way you wish the data to move.

Fair enough..


Export from dot easy, import to local.

OK...

The question now is, why doesn't your local phpmyAdmin have the import option available?

Good question....

Want to ask you how you get all the quotes up and then comment after them, i have tried and can't work it out?

Cheers.
07 Dec 2009, 07:30
#11
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Posts:
6,263
Plugin Contributions:
3

Re: Removed local database from phpmyadmin by mistake

Soulkreed:


Do you have the 'query', 'export', 'operations' and 'privileges' buttons, or are they missing too?

I have query, export, operations but no privileges.


Aha! A clue. Are you logging into phpMyAdmin using the *mysql* administrator password, or the zencart administrator password?

I'm guessing you are using the zencart admin password (which is a 'regular user' as far as MySQL is concerned), therefore there are security restrictions in place.

When you first installed MySQL (which you would have done before it was possible for you to install zencart) you would have had to specify a MySQL 'root' or 'admin' name & password.. These are what you need to use when logging in with phpmyadmin. (There are other methods to gain the required access, but this is the easiest in your case).

Soulkreed:


Re: Database transfers.
When I am in the filezilla ( ftp ) transfer program the files are all still there on my local and I just transfer them over to my live dot easy account etc.


Filezilla will transfer your zencart *files* without problem, but I seriously doubt that you are using it to transfer your *database*.

You *may* be able to transfer the *database* from your local machine to the dot easy server, but I can assure you that you will not have permission to place them where they need to be. Also, it is very unlikely that you'll have enough access rights to even view the 'active' database file on the dot easy server (and even less chance of actually copying it back to your local machine). This is why you need a 'tool' such as phpMyAdmin to act as a 'middleman' in order to store/retreive data from the database itself.

I apologise if this all sounds confusing to you. I'm really not trying to overcomplicate the situation, it is just the way it is.

Cheers
Rod
07 Dec 2009, 07:39
#12
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Posts:
6,263
Plugin Contributions:
3

Re: Removed local database from phpmyadmin by mistake

Soulkreed:


Want to ask you how you get all the quotes up and then comment after them, i have tried and can't work it out?


When you reply to a posting you'll note that the original text starts out with
something like [ quote = username ] and ends like [ / quote ]

All you need do is copy these 'tags' around the individual sections of the message that you wish to quote. (I tend to use a cut 'n' paste) rather than typing them each time.

Cheers
Rod
07 Dec 2009, 09:15
#13
soulkreed avatar

soulkreed

Zen Follower

Join Date:
Nov 2009
Posts:
130
Plugin Contributions:
0

Re: Removed local database from phpmyadmin by mistake

Hi Rod,

RodG:

Aha! A clue. Are you logging into phpMyAdmin using the *mysql* administrator password, or the zencart administrator password?

I'm guessing you are using the zencart admin password (which is a 'regular user' as far as MySQL is concerned), therefore there are security restrictions in place.

Rod


I am just clicking on the saved address/link i have of my local phpmyadmin, not sure if it's my sql or the standard zen cart one ( i have found a tab at the bottom left of the phpmy admin that says ' priviledges )

Rod I am getting this warning/message at the bottom of the phpmyadmin front page


Your configuration file contains settings (root with no password) that correspond to the default MySQL privileged account. Your MySQL server is running with this default, is open to intrusion, and you really should fix this security hole.

Does this help us at all my friend? I looked at trying to put a password on it and fix it up but i can't find anywhere that tells me how to do it.

Cheers.
07 Dec 2009, 09:25
#14
soulkreed avatar

soulkreed

Zen Follower

Join Date:
Nov 2009
Posts:
130
Plugin Contributions:
0

Re: Removed local database from phpmyadmin by mistake

Hi again,
sorry to put this in here, it is from another post but I need to find out if I still need to re-install a new copy of it or not.



Default Re: Remove CC & Cheque from payment screen help


[ quote = Soulkreed]Hi Rod,
I wrote down the wrong names in my last message sorry ( admin/inlcludes/configure.php ) is what i meant to write not ( includes/configuration.php ) ( this is what too many hours on the computer can do to you, lol ) The writing that turned into chinese was from the admin/includes/configure.php file, shall i do as you have suggested and reload an original copy ( checking for any variants and changing them ) and see if this has an effect? or did you mean to only re load it again if the file was the configuration.php one?

There is also no file with the name configuration.php in the directory of admin/includes....., just thought i'd let you know if that makes any kind of difference.
Cheers.
[ / quote ]

Thanks.
07 Dec 2009, 12:43
#15
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Posts:
6,263
Plugin Contributions:
3

Re: Removed local database from phpmyadmin by mistake

Soulkreed:


I am just clicking on the saved address/link i have of my local phpmyadmin, not sure if it's my sql or the standard zen cart one


It's the same phpMyAdmin either way..... Oh, you mean your not sure if it is logging you in as the zencart user or the mysql user, don't you?

Soulkreed:


( i have found a tab at the bottom left of the phpmy admin that says ' priviledges )


This would suggest you are logged in as the mysql 'admin' user.

To confirm this, if you click on the 'home' link at the top of the phpmyadmin screen you should see something like the following near the top of the main panel

  • Server version: 5.0.77-log
  • Protocol version: 10
  • Server: Localhost via UNIX socket
  • User: xxxxxxxxx@localhost

If the 'user' is the same as your zencart username then you will have restricted access.

However.......

Soulkreed:


I am getting this warning/message at the bottom of the phpmyadmin front page

Your configuration file contains settings (root with no password) that correspond to the default MySQL privileged account.


.... this is clear indication that you are logged in as the main mysql user ,,, at least on this occasion ... with this login the 'import' function should almost certainly be available to you.

Soulkreed:


Your MySQL server is running with this default, is open to intrusion, and you really should fix this security hole.


I wholeheartedly agree with this advisory. However, as long as your localhost has a firewall of some sort in place and isn't *directly* connected to the internet the chances of this security hole being exploited are pretty low. Nonetherless, when you gain more experience I do suggest you set a password for this logon as an additional layer of security.

Soulkreed:


I looked at trying to put a password on it and fix it up but i can't find anywhere that tells me how to do it.


This one isn't obvious... it is *usually* set when MySQL is first installed. To set it after the fact you need to select 'priviliges', then identify the name of the master/root user account (you'll probably only have a couple of users listed anyway). The master/root user will (or should) show as having "all priviliges" - next, click on the 'edit' icon on the right hand column, rhen midway down the page there is a 'change password' option.

All of the above is a 'by the way' or a 'while you are at it' suggestion while you are trying to fix your main issue, which is the missing import function.

As previously stated, the 'import' option should be available to you by default while logged in as 'root'.. if not, then the 'all priviliges' probably won't be seen either.. to fix this, you'll still need to identify the root user account, again, select the 'edit' icon on the right hand side of the screen, and then click on the 'check all' link in the 'global privileges' section.

With this done you should then be able to 'import' data into any and all tables in the database.

This however is considered to be bad practice (using the root/admin account needlessly).

What you *really* want is to give the 'zencart' user permission to import data into the zencart tables.

To do this, from the original 'priviliges' link, identify the zencart user, as before, click on the 'edit' icon at the RHS of the screen, and in the 'global priviliges' section located the 'data' block, and tick the 'file' checkbox (and no others). Save the changes, log out of phpmyadmin and re-log in using the zencart user account. The 'import' function should now appear.

Note: for any SQL pedants reading this, I know that even this isn't the most secure method to use, and that it is better to restrict by database and even table level, but do you want to explain it?)

Anyway, by following these instructions you should be able to be in a position to import the backup of your database tables.

I will also suggest that as long as you are logged in with 'root' access you *should* be able to import the data anyway, which means you don't NEED to do any of the above unless you are concerned about the potential security risks, which as I also stated, are pretty minimal in your situation anyway..

The main points to note are that there will (should) be at least two userr accounts, the main/root account, and another account for the zencart user. The root account should give FULL access to everything, the zencart account will have restricted access (no import ability being one such limitation).

<phew> That should keep you busy for a bit :-)

Cheers
Rod
07 Dec 2009, 12:54
#16
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Posts:
6,263
Plugin Contributions:
3

Re: Removed local database from phpmyadmin by mistake

Soulkreed:

The writing that turned into chinese was from the admin/includes/configure.php file, shall i do as you have suggested and reload an original copy ( checking for any variants and changing them ) and see if this has an effect?


Hmmm, yes.. the file "admin/includes/configure.php" should be a regular .php file, in English. Anything else would indicate a corruption of some sort.

Soulkreed:


or did you mean to only re load it again if the file was the configuration.php one?


The configuration.php file is also a regular .php file, in English. This file isn't one that is normally edited, but if it is also 'chinese' then it too needs to be replaced with an original copy.

Soulkreed:


There is also no file with the name configuration.php in the directory of admin/includes....., just thought i'd let you know if that makes any kind of difference.
Cheers.


A file of that name is not supposed to be in that directory, so in this case things can be considered 'normal'. If there WAS a file of that name in that directory it may or may not have adverse effects on the store operation... it would however indicate that there is probably more amiss with your installation than it first appears).

Cheers
Rod
07 Dec 2009, 23:39
#17
soulkreed avatar

soulkreed

Zen Follower

Join Date:
Nov 2009
Posts:
130
Plugin Contributions:
0

Re: Removed local database from phpmyadmin by mistake

Hi Rod,
I have buggered up your instructions below

RodG:



To do this, from the original 'priviliges' link, identify the zencart user, as before, click on the 'edit' icon at the RHS of the screen, and in the 'global priviliges' section located the 'data' block, and tick the 'file' checkbox (and no others). Save the changes, log out of phpmyadmin and re-log in using the zencart user account. The 'import' function should now appear.

Cheers
Rod


Instead of ticking the ' file ' box in the zen cart user edit section i ticked the ' file ' box ( and no others ) in the root account and now have no databases or anything remotely similar to how it used to look ( i think i am screwed )

Any suggestions....
08 Dec 2009, 01:00
#18
vger avatar

vger

Past Contributor

Join Date:
Nov 2004
Posts:
3,189
Plugin Contributions:
0

Re: Removed local database from phpmyadmin by mistake

When, in your local phpMyAdmin, you could not see the 'Import' tab this was not unusual. If you have an older version of phpMyAdmin then what you'll see is an 'SQL' tab, which you click on. Then you see a Browse link, which you click on. Then you locate the backup of your online db which you downloaded - and select that. Then you click 'Go' and it imports the backup.

It's no more complicated than that.

Vger
08 Dec 2009, 02:23
#19
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Posts:
6,263
Plugin Contributions:
3

Re: Removed local database from phpmyadmin by mistake

Soulkreed:

Instead of ticking the ' file ' box in the zen cart user edit section i ticked the ' file ' box ( and no others ) in the root account and now have no databases or anything remotely similar to how it used to look ( i think i am screwed )

Any suggestions....


Yes. Just log back in as the root/admin user, select 'privileges', tick *everything* in the global privileges section (use the 'check all' link)

Save your changes and you should be back where you were before you made the change.

As long as you can get back to this stage, try following vger's instructions .. personally I can't recall the 'import' tab not being visible on the older versions of phpMyAdmin, and knowing that you have a pretty new installation this possibility didn't even occur to me anyway.
(Thanks vger. Something worth remembering).

Anyway Soulkreed, even if you can't restore back to how things were before you can move forward, you still have another option.

As far as I'm aware from our previous discussions, the only thing you are currently using your mySQL database for is Zencart, correct? and since it is the zencart data you wish to restore I can see no reason why you couldn't just delete your current mySQL installation, reinstall it, and start afresh if you need to.

FWIW, when I first starting learning mySQL I probably trashed my databases/installation at least a dozen times (or more) before I came to grips with what I could and should change, and what I should leave alone. I must admit it was very frustrating at the time, but I really did learn a lot more than if I'd just blindly followed instructions and never had a problem. Your early 'screw ups' will eventually turn out to be to your benefit.

Cheers
Rod
08 Dec 2009, 03:20
#20
soulkreed avatar

soulkreed

Zen Follower

Join Date:
Nov 2009
Posts:
130
Plugin Contributions:
0

Re: Removed local database from phpmyadmin by mistake

Hi,
I am unable to log back in, I don't know how to do it, sorry.
I only have one screen ( phpmyadmin-local ) that I go to when i click on the saved url in my favourites. This screen is no longer looking like it used to. Is it possible to show you a picture of the screen i am looking at which may shed some light on this?

In regards to deleting and re-installing a new mysql installation, i wouldn't know where to begin, any clues please?

Cheers