Import multiple MySQL stored procedures to PHPmyAdmin - mysql

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:

Related

MySQL compare newly created dump file to database

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.

Automated export of CSV from mySQL using phpMyAdmin

I am currently working on a project that requires an automated export of a CSV file from mySQL. I am using Cpanel with phpMyAdmin.
This is not an export of the entire database so I am unable to simply set a CRON task to do a mySQLDump. I have a procedure in place that links together the tables I need and a way to run that procedure as a scheduled task, but I now need a way to actually export the CSV with the data in that procedure creates and save the CSV file on the server.
Any ideas how to do this please?
I think you will need to write a script to do the custom export.
If you are familiar with PHP, you can use the MySQLi library to connect to the database: http://php.net/manual/en/book.mysqli.php
Once you have the rows to export, you can write them to a CSV file using: http://php.net/manual/en/function.fputcsv.php
Finally, setup a cron to run the script as frequently as needed.
For example:
* * * * * /usr/bin/php my_export_script.php

How to migrate daily data from Oracle table to MySQL table using Shell script?

I needed to insert data to a MySQL table. The data usually comes from the Oracle database by a SQL file which has some query to get data from Oracle database table.
So i needed to automate this process on a daily basis using Shell script. So it will run the SQL file (Oracle) and get data. The data has to be moved to a specific MySQL table.
So the operation like,
Connecting to Oracle server.
Executing SQL in that server.
Move collected data to the MySQL table.
I want to run that operation as a cron on daily basis.
I am working on LAMPP environment.
Here are my questions,
Is there any standard tools available to do that?
Can we achieve this using shell script? If so, Please suggest me the steps.
Or It would be great if you suggest me your own optimized way.
Thanks,
Raja.
You can achieve this using a cron job,
Write a sql file which exports a data from Oracle DB i.e. sql file containing export table command with appropriate where clause
Write a sql file which imports data into Mysql DB i.e. similar import file command in Mysql
Write a shell file which run both these sql files and verifies the data in Mysql table
Schedule a cron job to run this shell script daily at a specific hr.
Please check import/export file formats on Oracle and Mysql which can be different as one is freeware and other is commercial. If there are differences then you will need some data/file modification otherwise this should be enough.

Downgrade mdf file from 661 to 655

I created and database in sql server 2008. I took the mdf and ldf files to Visual Studio 2010 project and tried to connect to that db with entity-framework. and got the following message:
I cannot reinstall or upgrade the software on the specific computer.
So is there any way to downgrade the version of the mdf and ldf files?
No, you cannot downgrade, you will need to move the schema and data another way if you can't install the right version. This recent question is essentially the same:
Failure attaching SQL Server 2008 database to SQL Server 2005
Essentially you can use the Generate Scripts tool or the Export Data wizard to get your destination database to look like the source. You will not be able attach your MDF file.
And this blog post shows some 3rd party tools that can help with this:
http://bertrandaaron.wordpress.com/2012/04/20/re-blog-the-cost-of-reinventing-the-wheel/
No, you need to install the same or newer version of SqlServer.
There is no known way to downgrade an MDF file.
Links
http://blog.sqlauthority.com/2008/10/16/sql-server-downgrade-database-to-previous-version/
Perhaps, if you have access to the SqlServer 2008, you could use the command
"Tasks" -> "Create Scripts" to start the wizard to create a script with schema and data.
On the options page there is the button 'Advanced' where you can select the syntax version of SqlServer
The way that I found that worked was to export the database and stored procedures from the original database. Then upload them into the second database(second computer).
Firstly export the DB content (data) - I used SQL server export data wizard. on the database you wish to export from right click then choose tasks, then export data. Follow the instructions and save in whichever format is best for you - I used excel for the data.
then to export the stored procedures rightclick the database name again. choose tasks and this time choose generate scripts. again follow the instructions of the wizard.
To import the data simply go to the second computer and right click the database you wish to import the data into. again tasks > import data. Follow the instructions to import all of the data from the database.
Finally to import the stored procedures, I opened up a new stored procedures command and dragged and dropped the script file that I had previously saved them in and dropped it into this window. The new stored procedure window filled with the entire list of my stored procedures.
Finally change the name of the database name that will be used by the SP ( if this is different from the original DB name). (This is the first line USE [DBName].
then simply execute and the SP's will be fully restored.
This has helped me get my entire database up and running again very quickly.
Hope this helps.
U can open it on another pic and then publish it to sql script with or without data then create database on target PC using sqlcmd or anything. Then run sql script...

How to import a MS SQL server table into mysql?

I need to export about 300,000 rows from a table on MS SQL server and import into mysql on a different server (non windows).
There is some text stored in some fields and commas in the text will mess up the format if I export into txt format.
I can't install any software on the server.
You may have several options:
use SSIS or DTS Wizard on another host to interconnect MSSQL and MySQL
write your own small app to move the data
script the MSSQL DB's DATA into script file with SSMS' scripting features, adopt the script manually to mysql and run it
I'm pretty sure you can connect to MySQL from SSIS. I'd go down that route.