How to import table 180Mb without getting max_questions error - mysql

I have to import a 180Mb table on a shared (which means trouble I know) host and I'm getting the max_questions error. The limit is 75000 and they are not willing to higher the limit for even an hour. The number of queries as about 2000000.
I have been using bigdump to upload the gz file, but the limit is killing me.
Is there a way to split the table and upload it bit by bit or merge it somehow? I have been searching online, but solutions are mostly for people who can access the database settings.

I am assuming that you have phpmyadmin installed in your website directory,
other wise download latest phpmyadmin version from official website.
and unzip it in your website directory
If that's the case then perform below steps.
Access your website directory via sftp or ftp.
If you can not access your website directory via sftp or ftp then you can setup cron jobs for fetching files.
Find the config.inc.php file located in the phpmyadmin directory. In my case it is located here:
\public_html\phpmyadmin3.2.0.1\config.inc.php
Find the line with $cfg[‘UploadDir’] on it and update it to:
$cfg['UploadDir'] = 'upload';
Create a directory called ‘upload’ within the phpmyadmin directory.
**\public_html\phpmyadmin3.2.0.1\upload**
Then place the large sql file that you are trying to import into the new upload directory.
Now when you go onto the db import page within phpmyadmin console
you will notice a drop down present that wasn’t there before
it contains all of the sql files in the upload directory that you have just created.
You can now select this and begin the import.
Reference : http://daipratt.co.uk/importing-large-files-into-mysql-with-phpmyadmin/comment-page-4/

Related

Cant upload MySQL file to cpanel gives contains virus error

I am trying to upload a backup of the MySQL database exported file to the Cpanel public_html folder. upon upload I am getting the following error:
The file you uploaded, MySQL_file_name.zip, contains a virus so the upload was canceled: antispamcloud.score.medium.abusedredirector14.UNOFFICIAL FOUND
I scanned the file with an antivirus online and on my computer but it didn't find any virus on it.
Regards,
have you tried adding .sql as file extension?
You can contact your server provider. permissions may be turned off.
Your .zip file contains, most likely, a single .sql file. Try extracting the .sql file from the .zip file and then upload that to phpmyadmin. If it goes through, you're all set.
If your hosting provider's phpmyadmin also rejects the extracted .sql file there are a couple of possibilities. (It's phpmyadmin that's looking for viruses.)
Some cybercreep successfully attacked the WordPress site you backed up and put some nasty malware in one of your tables. Your hosting provider's phpmyadmin detected it when you uploaded your backup. (That's good, if frustrating.)
Maybe you can scan the WordPress site you backed up in the first place and find the nasty stuff. Sucuri's a plugin for that. Then you'll have to recreate the database backup.
It's a false-positive virus detection. Ask your hosting provider for help.

Database mysql process overloading after cloning

I clone my Wordpress site. I hosted them both in shared hosting. But now my new website always make overloading the sharedhosting server due to database mysql process.
Here are some screenshots:
https://prnt.sc/26lotyb
https://prnt.sc/26loucm
This is what I did to clone my site:
Export database from phpmyadmin
Compress and download files in public_html
Upload, extract files in public_html, import database, connect them.
Run SQL command to replace domain name
Use the plugin Better Search Replace to replace needed things.

How to get MYSQL database from Xamp

I used xampp sometime ago to run mysql server. I forgot to save a copy of my database. Now my hard drive has crashed and I can only use it as external drive. Using it as an external hard drive I can access the xampp installation folder but I can't seem to find copies of mysql databases.
So this is what i tried:
But I found my database names in C:\xampp\mysql\data\voting
directory, where voting is a my database name. Now, in the voting
folder, I can find all my table names but they end in some wierd
extension (.frm or .ibd) that I cannot import to a new xampp that
I have installed. For instance there is a table in the voting
database called candidate .
My problems is that is there a way I can retrieve my database from the xampp installation folder?
If NOT, How can I get mysql database using xampp(Without sql,csv or json files)
NOTICE: The xampp directory is an old one and I cannot run it because it is on a hard drive that is slightly crashed and can be access externally to a computer.
After posting this for 3 days and getting no answer, i toiled and toiled until I got an answer.
What I did was I copied the data folder in C:\xampp\mysql directory where I installed xampp from my old xampp installation folder on my old hard drive.
I pasted the old data folder I copied into C:\xampp\mysql directory of my new hard drive.
NOTICE: there is an already existing data folder there, so I backed up before doing any changes.
Finally, I opened http://localhost/phpmyadmin/ in my browser and I can now see all my old MYSQL databases.

How to manually import database directly into the data folder in phpMyAdmin in XAMPP?

I recently installed a new version of XAMPP. I copied and pasted database folders from the old xampp's mysql/data to the same folder in the newer version. The database names are displayed in phpMyAdmin but it does not show any data.
I know I can do a simple import/export sql to resolve this but I'd like to know why copying and pasting the database folders not working? Do I have to do something else in order to make this work?
I'm going to backup my database regularly using an auto backup tool. Apart from backing up mysql/data folder, do I also need to backup some other folders or files to have a proper database backup?
why copying and pasting the database folders not working? >> as far as I know we need to use import feature, because it will register the database to mysql's infomation_schema.
So even if the database file is stored in the correct folder, it won't show up on the phpmyadmin because it's not registered. And I think mysql didn't do any directory scanning to determine it's database line up.
To back up automatically, there are several ways you can do. Moreover if you use linux OS, you have more freedom to do that, for example create a php script to backup your db and then execute it regulary by using cron job.
hope this can help you.

Where to download AdventureWorks2008.msi?

I'd like to install AdventureWorks2008 (I just install SQL Server 2008 R2 Express).
Each time I download the recommended version from CodePlex, all I get is a AdventureWorks2008.mdf file. Not only I cannot attach the file from SQL Server Management Studio, but I cannot copy/paste the file directly into the the database.
I've read in several places that I need to use AdventureWorks2008.msi, but I cannot find where to download it.
I just cannot figure out how to install AdventureWorks2008
Thanks for helping
There isn't an .msi file for adventureworks, even though you'll find it mentioned in outdated documentation and books. You aren't alone in finding this confusing -- it seems the web site, files and steps Microsoft provides for installing these databases changes every time I need to install them.
You need to create the database and attach the .mdf file, which is the "data file" referred to in the instructions. (.mdf = primary data file, .ldf = log file, .ndf = secondary data file)
In order to attach the file, you need to make sure you carefully follow the steps here: http://social.technet.microsoft.com/wiki/contents/articles/3735.sql-server-samples-readme-en-us.aspx#Readme_for_Adventure_Works_Sample_Databases
Instructions for 2008R2:
To install AdventureWorks2008R2 OLTP database
Download the AdventureWorks2008R2 Data File.
From File Download, click Save and browse to a location on your local
server.
From SQL Server Management Studio, execute the following code:
Case-insensitive Database
CREATE DATABASE AdventureWorks2008R2
ON (FILENAME = '{drive}:\{file path}\AdventureWorks2008R2_Data.mdf')
FOR ATTACH_REBUILD_LOG;
As an alternative to step 3, you can attach the database using the SQL
Server Management Studio user interface. For more detailed
information, see Attach a Database (SQL Server Management Studio).
Note: You must remove the log file from the list of files to attach.
This will cause the operation to rebuild the log.
Headache saving tip from Aaron Bertrand:
You should place the mdf file in your normal data folder - SQL Server
will already have the proper permissions. You can get this path using
SELECT TOP (1) physical_name FROM master.sys.database_files;
You can directly paste that file into your database directory. For more information you can refer http://tryingmicrosoft.com/error-while-attaching-a-database-to-sql-server-2008-r2/.