I have copied database folder from wamp/bin/mysql/data - mysql

I have copied database folder from wamp/bin/mysql/data
As I open the phpMyAdmin, I see the database name, but when I click on them it is empty, as if no table has been created in them.
Where are my tables now? thanks

Copying the MySQL data directory is not a reliable means of backing up or moving your databases. The supported means is to export then import on the new server. There are a number of things that can go wrong, especially if you have InnoDB type tables.
The basic things you can check are file permissions on the new data directory, MySQL-level user permissions (assuming you're not already logged in as an administrative user, try doing so and see if things improve), and looking in the MySQL error log for any hints if there's something obvious, but it's very likely that something didn't transfer well.
I recommend that you go back to the original installation, verify your data, do a complete export (or "dump") to SQL format, then import that file to your new server.

Related

Query on mysqldump

I am trying to use mysqldump for backing up my database and restoring the same in remote a machine for disaster recovery purposes. As I havent used it before, I am having a basic question regarding the same.
Once I dumped and copied over the file,on the target machine, while importing, will it perform the import such a way that it creates new entities while updating any existing ones and deleting any entities deleted in the dump?
Basically, will it keep the target mysql in sync with the dump i.e. the same as on the source?
Thanks
Long story short(ish):
Mysqldump will create an SQL file that, when imported in an empty environment, makes a database that is the same as the one the dump was created from.
So no: it will not "sync" anything (e.g. delete files or update records). You can actually look at the file and you will see statements that first create a database, then create the tables and finally insert your data.
They way it works that you take an empty server, import the database and you have you origional situation back. Nothing less, but definitely nothing more as well.

recovering a mysql database using a copy of the datafiles

The primary HDD drive of my computer died yesterday, I got a new one and restored it but when I went to restore my mysql databases I realize I had no done a proper backup in a while.
Nevertheless, I do have the original database files from my previous installation as the datafiles were in the second HDD.
My question is, can I restore/create a new DB in the new machine using only the files from the previous installation?
Thank,
Ignacio
Yes, you should be able to do this.
I'm a bit unclear: when you say, "I do have the original database files" do you mean as a database? If so, go to phpMySql for the surviving database and choose Export. Export the database as a text file. Open the file with your favorite text editor and change the name of the database to match the name you are importing into.
Create the empty database where you want the new one to be, if it doesn't already exist. Now go to phpMySql for that database and import your text file. This should recreate all the tables and their data in the new location.
If instead, you only have the files that were the source of the data, then you need to use whatever tool was used to create the database in the first place. For example, if the data is in the form on an Excel spreadsheet, you would use MySql for Excel.
Hope this helps!
(after your comment that you have file backups of WordPress site)
In that case, you may not be so lucky. If you used a tool to do your backup, it may have backed up the database, but in general, the database is stored separately from your file system. So if you just copied the files yourself, you won't have the database. But do look for any file with a suffix of .SQL, which would be a database backup.
Next, contact your Internet Service Provider and see if they do periodic database backups. If so, you can recover from them.
For the future, see if your ISP provides automated backups (including database). And read https://codex.wordpress.org/WordPress_Backups.

MS Access Database locked by Unknown user

I have an access database that is on a network drive that multiple users can access. The database corrupted this morning and I am in the process of trying to fix it. The problem I am having is when I attempt to rename the database it says it is currently in use by someone. There is no .ldb file associated with this file so at this point and am dead in the water because I can't rename it, compact it or anything.
Does anyone have any suggestions?
Thanks
Copy the database to another location. The copy wont be locked. Then you can work in ways to save your work until you solve the lock problem in the original file. If your problem is due to VB code file corruption, try to open the database with the "/decompile" option:
Start-Run:
"C:\Program Files\Microsoft Office\Office\msaccess.exe" "C:\example.mdb" /decompile
If you haven't any ldb file associated with the mdb, it will be difficult to discover what user is locking your database. If you have few users, you should restart their machines. It would be prehistoric but should be fastest than trying to unlock the file through other ways.
Just had to do this, Try "F11" then select "tables", select topic and click open, from there it a simple C&P into excel sheet.
Hope this helps
Dave Pragnell
ldb file is automatically created when first user opens the DB, it tracks the number of users who have opened the DB and locking status of every object
so if one user is open in read only then 2nd user can edit db
this file automatically deleted when last user close connection to the db file.
You dont manually delete/modify this file, as it may result into inconsistent state of DB
You can open this file in Notepad and check how many users have opened this file, But DONT change anything.

link access 2007 into mysql

I have an Access file on a server which my colleagues will update regularly and sometimes I need to analyze the data by the following method:
download the Access file to my local drive
export the table to MySQL
open the MySQL table through R to do the analysis
This workflow is OK if I only have to do it once, but it's getting more often that I find data is missing inside the dataset, I asked the colleagues to fix it, and then I need to go over step 1-3 again, and I feel it is kinda dumb to do the 1-3 steps over and over again.
Since the Access file on server is password protected and I don't want the mess with that file, I wonder if I can created another Access file, that acts as a link between my local MySQL server and that Access file. When I launch R, data will be extracted from the MySQL server, go to my "link" Access file, and go to the Access file on server, and everytime the data I get from R is the latest version.
I wonder if I have explained it clear enough, and I have no clue how to work this out, can anyone here inspire me? Thanks!
Try:
> install.packages("RODBC")
> vignette("RODBC")

Import MySQL DAtabase from Data Files

I've got the MySQL data files from an old server which has now crashed so I can not login to the server to do mysqldump etc. I am now trying to load the data on a new server. The only option I have is to copy/paste the data files that I have. But when I do so, some of the database tables throw this error "Table does not exist" when I can see it in my Navicat Window. The problem is only with some of the tables, not all.
My question is, how can I fix this error ? Or is there another way to import the data from data files?
The best piece of advice that comes to my mind is running a myisamchk on the respective table(s), paying special attention to the repair options.
Be sure to make backups of the data files beforehand.
Additional thoughts:
Make sure you have restarted the database server after adding the data files.
Are you sure you are addressing the correct table(s)? Note that on most Linux filesystems, the table name is case sensitive (as it's reflected by a file in the filesystem). So tablename != Tablename