MySQL compare newly created dump file to database - mysql

I have this task in my work to create a MySQL dump file and i have to review the file before restoring it from a different server.
My problem is how to compare my created dump file to the database where i get it from to make sure that all tables or function and stored proc are included in the dump file.
Is there a way to do it because currently i'm manually reviewing the dump file per table name function and stored proc which is very time consuming.

Related

CSV and Database

Suppose there are changes in the .CSV file which I've used to enter data in the database, how can I reflect those changes in the same database, say using MySQL Workbench or MySQL command line?

Import multiple MySQL stored procedures to PHPmyAdmin

Good day, I've uploaded my web-based system to x10hosting.com and currently using a free subscription. Lately, I've been importing my exported local .sql file that is imported from SQLyog application to PHPmyAdmin.
I have a sample code that is purely modified by me and executes 2 stored procedures.
I need to import my stored procedures to PHPmyAdmin all at once. But there's an error:
1 stored proc 'query' at a time is a accepted. I have a total of 40+ of SPs in my .sql file and most of it are composed of 300 to 1000+ lines. I don't have time to import or query it one by one.
Here's some info of the version of PHPmyAdmin I'm using:

Import from MySql dump to hive

I am facing a problem while importing MySql dump into Hive.
I used sqoop connector to import data from MySql to Hive successfully. However, there are more data dumps to import to Hive. Restoring the database first is not feasible. Since the dump size is of 300G, hence takes 3 days to restore. Also, I can't restore more than two files on MySql because of disk space issue.
As a result, I am looking to import data, which is in MySql dump, directly into hive without restoring into MySql.
There is one more problem with the MySql dump is that there are multiple insert statements (around 1 billion). So will it creates multiple files for each insert? In that case, how to merge them?
You can use the "load" command provided by Hive to load data present in the your local directory.
Example: This will load the data present in the file fileName.csv into your hive table tableName.
load data local inpath '/tmp/fileName.csv' overwrite into table tableName;
In case your data is present in the HDFS.Use the same load command without local option.
Example:Here /tmp/DataDirectory is a HDFS directory and all the files present in that directory will be loaded into Hive.
load data inpath '/tmp/DataDirectory/*' overwrite into table tableName;
Caution: As Hive is schema on read make sure to take care of your line delimiter and field delimiter are same in both the file and the Hive table you are loading into.

Imported data are missing in Mysql

I had copyed the data folder under wamp/bin/mysql/mysql(v)/data befor formate my computer, then after installing new os and then wamp I replace the data folder.
Now when I opening phpmyadmin the list of databases are showing but under the data base the tables are not shownig.
When I am using the myadminer it shows the lisst of table but not the tables data.
when I am using sqlbuddy one warning is showing in the place of listing tables. warning is like
Warning: array_key_exists() expects parameter 2 to be array, boolean given in E:\wamp\apps\sqlbuddy1.3.3\dboverview.php on line 215
you should have taken a proper backups - using mysqldump. if you used innodb storage engin and it was configured to keep log files or tablespace files somewhere else - i'm afraid you've lost your data.
I'm sorry, you have lost your data. In the future create backups frequently and create MySQL dump whenever you want to migrate your database.

mysqlimport - where is the imported data stored?

Huge mysql noob. Sorry in advance if this is dumb but I have searched around before posting.
I use mysqlimport on a local file to a mysql database that's running on my computer. If I delete the original file that was imported, can I still access the data? If so, where is the data being stored? On some Oracle server?
If it's stored locally, is it stored in a compressed version that takes up less space on my harddrive?
Thanks,
fertileneutrino
if you import a file to a database, it is going to store an instance of that data in the database, so yes, you should still be able to access the data, but why would you want to delete it?
It is being stored in a pool of database files in mySQL, they are referenced when you start mysql...yes the imported doc, is just a .dat file in most cases, as your database file.
When you import the data it is stored in database files on your local machine, using the mysql client program or something like phpmyadmin you should be able to view your imported data.
It's no longer stored in the same format as it was when you first imported it.
you can use something like mysqldump to get the data back out.
http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html