How to export MySQL 5.5 DB to 5.1 compatible - mysql

I have MySQL 5.6.11 Installed on localhost and i exported a DB to upload on a server that has MySQL 5.1 installed. I get error when i upload
SQL query:
--
-- Database: `trintest`
--
-- --------------------------------------------------------
--
-- Table structure for table `tr_options`
--
CREATE TABLE IF NOT EXISTS `tr_options` (
`option_id` bigint( 20 ) unsigned NOT NULL AUTO_INCREMENT ,
`option_name` varchar( 64 ) NOT NULL DEFAULT '',
`option_value` longtext NOT NULL ,
`autoload` varchar( 20 ) NOT NULL DEFAULT 'yes',
PRIMARY KEY ( `option_id` ) ,
UNIQUE KEY `option_name` ( `option_name` ) ,
FULLTEXT KEY `option_value` ( `option_value` )
) ENGINE = InnoDB DEFAULT CHARSET = utf8 AUTO_INCREMENT =693;
MySQL said: Documentation
#1214 - The used table type doesn't support FULLTEXT indexes
but when i import it to MySQL version 5.6.11 it works, but on MySQL 5.1 it shows error above. How can i fix this?

Try one of the following from MySQL 5.6.11
mysqldump -u username -p --compatible=mysql40 databasename > outputfile.sql
or
mysqldump -u username -p --compatible=mysql323 databasename > outputfile.sql
and load outputfile.sql into MySQL 5.1

Mysql 5.1 doesn't support full text index for InnoDB tables, so either change your table to MyISAM or stick with Mysql version 5.6
for more information:
http://dev.mysql.com/doc/refman/5.1/en/fulltext-search.html

Related

Export database from MySQL v5.5 to MySQL 5.7

My old database is deployed using MySQL v5.5, however when I export/dump to data using:
mysqldump -u root -p database_name > database_name.sql
Then import that data into my new database using MySQL v5.7, using:
source database_name.sql;
There are then tables missing. There are hundreds of tables so I can't check the reason for all of them. However, for one of them the reason is:
ROW_FORMAT=FIXED is no longer an option for the InnoDB Storage Engine in v5.7
With the relevant SQL statment from database_name.sql being:
CREATE TABLE IF NOT EXISTS `catalog_product_website` (
`product_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Product ID',
`website_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Website ID',
PRIMARY KEY (`product_id`,`website_id`),
KEY `IDX_CATALOG_PRODUCT_WEBSITE_WEBSITE_ID` (`website_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Catalog Product To Website Linkage Table';
My main question is, is there a way to export/dump the data so that I can know it'll be full compatible with MySQL v5.7?
Is this the only compatibilty issue that could exist, if so is it safe to just grep these statments?

1046 No database selected mysql cpanel

how to fix this error when i import database into phpmyadmin cpanel:
SQL query:
--
-- Database: `news_letter`
--
-- --------------------------------------------------------
--
-- Table structure for table `banner_tbl`
--
CREATE TABLE IF NOT EXISTS `banner_tbl` (
`ban_id` INT( 11 ) NOT NULL ,
`banner_img` VARCHAR( 255 ) NOT NULL ,
`date` VARCHAR( 255 ) NOT NULL
) ENGINE = INNODB AUTO_INCREMENT =158 DEFAULT CHARSET = latin1;
MySQL said: Documentation
#1046 - No database selected
add the following lines on top of your .sql file
CREATE DATABASE IF NOT EXISTS `news_letter`;
USE `news_letter`;

phpmyadmin import database error

I try to import a MySQL database on the localhost through phpmyadmin and i receive this error. what it means? and how can i solve it? any ideas?
SQL query:
--
-- Database: `casasdl_mag`
--
--
-- Database: `casasdl`
--
-- --------------------------------------------------------
--
-- Table structure for table `admin_assert`
--
CREATE TABLE IF NOT EXISTS `admin_assert` (
`assert_id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Assert ID',
`assert_type` VARCHAR( 20 ) DEFAULT NULL COMMENT 'Assert Type',
`assert_data` TEXT COMMENT 'Assert Data',
PRIMARY KEY ( `assert_id` )
) ENGINE = INNODB DEFAULT CHARSET = utf8 COMMENT = 'Admin Assert Table' AUTO_INCREMENT =1;
MySQL said: Documentation
#1046 - No database selected
When you create a table you need to select a database for that table to insert into
USE databaseName;
run this before your script
USE casasdl;
CREATE TABLE IF NOT EXISTS `admin_assert` (
`assert_id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Assert ID',
`assert_type` VARCHAR( 20 ) DEFAULT NULL COMMENT 'Assert Type',
`assert_data` TEXT COMMENT 'Assert Data',
PRIMARY KEY ( `assert_id` )
) ENGINE = INNODB DEFAULT CHARSET = utf8 COMMENT = 'Admin Assert Table' AUTO_INCREMENT =1;
Like you can read in error, you have to select your database.
Add USE yourDatabase; at the beginning of the code.
mysql or each db backend should import your tables into a Database , so it needs you introduce a db name , indeed you should tell to mysql :
use mydbname;
you can create it from :
mysqladmin -uroot -p create mydbname
mysql -uroot -p mydbname < mysqlfile.sql
if you are using external php, then do not use use database syntax or mysql-select_db("database"); syntax. Instead use mysqli_connect which accept database name.
The USE db_name statement tells MySQL to use the db_name database as the default (current) database for subsequent statements. The database remains the default until the end of the session or another USE statement is issued.
Refer: http://dev.mysql.com/doc/refman/5.6/en/use.html
Another option is within phpmyadmin Select DB from the left sidebar and inside it import will work.

Error in importing database in MySQL

I'm trying to import the database in MySQL but it kept on showing this error saying that 'no database selected'. Is there something wrong with my xampp? I've installed xampp v3.0.12.. Does anyone know how to solve this problem? I don't know what to do. :( I need to import this badly.This is the reason why I can't log in to wordpress. dAny help would be very much appreciated! Thanks!
Error
SQL query:
--
-- Database: eucincor_psuccessdb.sql
-- --------------------------------------------------------
-- Table structure for table wp_additional_attendees
CREATE TABLE IF NOT EXISTS `wp_additional_attendees` (
`id` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT ,
`attendee_id` INT( 11 ) NOT NULL DEFAULT '0',
`x_attedee_name` VARCHAR( 45 ) DEFAULT NULL ,
`x_attendee_email` VARCHAR( 45 ) DEFAULT NULL ,
PRIMARY KEY ( `id` )
) ENGINE = MYISAM DEFAULT CHARSET = latin1 AUTO_INCREMENT =1;
MySQL said:
1046 - No database selected
you might would have forgotten to use database.
the dump file does not contain the
create database eucincor_psuccessdb
use eucincor_psuccessdb
either add manually this in the eucincor_psuccessdb.sql file or just type these commands before importing your database.
hope it worked!

Error #1046 - No database selected SQL import on XAMPP

I am trying to import the SQL database from my Drupal production site into a sandbox testing site on my local machine. I currently use XAMPP on my machine here at work.
I have downloaded my db aipiadxxm_if9DHdr.sql and then I go to the phpMyAdmin on http://localhost/phpmyadmin/index.php then to -> Import.
After I import the db I get this Error:
SQL query:
--
-- Database: `aipiadxxm_if9DHdr.sql`
--
-- --------------------------------------------------------
--
-- Table structure for table `if9d_access`
--
CREATE TABLE IF NOT EXISTS `if9d_access` (
`aid` int( 11 ) NOT NULL AUTO_INCREMENT ,
`mask` varchar( 255 ) NOT NULL default '',
`type` varchar( 255 ) NOT NULL default '',
`status` tinyint( 4 ) NOT NULL default '0',
PRIMARY KEY ( `aid` )
) ENGINE = MYISAM DEFAULT CHARSET = utf8 AUTO_INCREMENT =1;
MySQL said: Documentation
#1046 - No database selected
What is causing this error message: #1046 - No database selected ?
You need to create and/or select the database on your sandbox machine before importing the SQL for the table structure and data.
In phpMyAdmin, this means choosing a database from the sidebar and then using its import tab. If the database you want to fill doesn't exist, you have to create it first using the Create new database form.
After import, you should confirm that the export-import process hasn't affected the anonymous user record (uid 0).