Error when importing database with nine version WAMP SERVER 64 BITS (X64) 3.2.0
Posted by: Teixeira (---.virtua.com.br)
Date: March 22, 2020 11:58PM

Hello,
I had an old version of Wampserver. With that I backed up all databases in this way: I clicked on the database, then on "Export". I left it marked "Fast - displays the minimum of options". I also backed up my www folder.
Then I went to [www.wampserver.com] and downloaded WAMP SERVER 64 BITS (X64) 3.2.0. I noticed the need to install some files at that time indicated in the installation.
With that, I clicked on phpMyAdmin 4.9.2. Then opened the home screen "Welcome to phpMyAdmin" and in "User:" I indicated "root", as I always did. In "Server choice:" it shows "MariaDB" and before I entered MySQL. I couldn't find where to mark it so I can enter it with "MySQL".
As I always used MySQL I left MySQL checked and opened "phpmyadmin" at http: //localhost/phpmyadmin/index.php? Server = 2.
To do the import I clicked on the "import" tab, then went to "Search your computer:" "Brawse" and pointed to my file that I want to import.
It turns out that it only shows error according to this example:
File name in the backup folder: banco_teste.sql
After pointing to the file and clicking "Run" it shows the following result:
1) "Import finished successfully, 18 queries executed. (Banco_teste.sql)";
2) below it shows the following message:
"Mistake
SQL command:
-
- Database: `banco_teste`
-
- ------------------------------------------------ --------
-
- Structure of the `registration` table
-
DROP TABLE IF EXISTS `registration`
MySQL Messages: Documentation
# 1046 - No database was selected "

I clarify that the database is not imported.
I've been trying for two days and I can't solve it.
Please help me.

Options: ReplyQuote
Re: Error when importing database with nine version WAMP SERVER 64 BITS (X64) 3.2.0
Posted by: Otomatic (Moderator)
Date: March 23, 2020 08:58AM

Hi,

Read Right-Click -> Help -> MySQL -MariaDB

------------------------------------------------------------------------------------------------------------
Wampserver 3.2.0 32 bit - Apache 2.4.43 - PHP 7.4.4/7.3.16/..../5.6.40 - MySQL 5.7.29 - MariaDB 10.4.12
Wampserver 3.2.0 64 bit - Apache 2.4.43 - PHP 7.4.4/7.3.16/..../5.6.40 - MySQL 5.7.29/8.0.19 - MariaDB 10.4.12
PhPMyadmin 5.0.2 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote
Re: Error when importing database with nine version WAMP SERVER 64 BITS (X64) 3.2.0
Posted by: RiggsFolly (Moderator)
Date: March 23, 2020 01:00PM

Hi,

Depending on the options selected in your EXPORT there may not be a create Database command in the backup file.

So, first manually create the database using phpMyAdmin that is easy.

Then edit your .sql file and find this line

- Database: `banco_teste`

And add a `use` like this

- Database: `banco_teste`
use `banco_teste`;

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.2.0 32bit & 64bit)
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.19>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your MySQL databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-



Edited 1 time(s). Last edit at 03/23/2020 04:58PM by RiggsFolly.

Options: ReplyQuote
Re: Error when importing database with nine version WAMP SERVER 64 BITS (X64) 3.2.0
Posted by: Teixeira (---.virtua.com.br)
Date: March 23, 2020 04:56PM

Hello Dear RiggsFolly (Moderator),
First I would like to thank you for your attention to my case.
Sorry for the English because I'm translating.

1) The database I created with a new version of phpMyAdmin editing in Notepad ++:

- phpMyAdmin SQL Dump
- version 4.9.2
- [www.phpmyadmin.net]
-
- Host: 127.0.0.1:3308
- Generation time: 23-Mar-2020 at 13:30
- Server version: 8.0.18
- PHP version: 7.2.25

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00: 00";


/ *! 40101 SET @OLD_CHARACTER_SET_CLIENT = @@ CHARACTER_SET_CLIENT * /;
/ *! 40101 SET @OLD_CHARACTER_SET_RESULTS = @@ CHARACTER_SET_RESULTS * /;
/ *! 40101 SET @OLD_COLLATION_CONNECTION = @@ COLLATION_CONNECTION * /;
/ *! 40101 SET NAMES utf8mb4 * /;

-
- Database: `banco_teste`
-

- ------------------------------------------------ --------

-
- Structure of the table `tb_banco_teste`
-

DROP TABLE IF EXISTS `tb_banco_teste`;
CREATE TABLE IF NOT EXISTS `tb_banco_teste` (
`banco_teste_id` int (11) NOT NULL AUTO_INCREMENT,
`test_name_b_test` varchar (250) NOT NULL,
PRIMARY KEY (`bank_test_id`)
) ENGINE = InnoDB AUTO_INCREMENT = 3 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci;

-
- Extracting data from the `tb_banco_teste` table
-

INSERT INTO `tb_banco_teste` (` banco_teste_id`, `nome_teste_b_teste`) VALUES
(1, 'I am testing a bank created manually in the new version'),
(2, 'Another record created for testing');
COMMIT;

/ *! 40101 SET CHARACTER_SET_CLIENT = @ OLD_CHARACTER_SET_CLIENT * /;
/ *! 40101 SET CHARACTER_SET_RESULTS = @ OLD_CHARACTER_SET_RESULTS * /;
/ *! 40101 SET COLLATION_CONNECTION = @ OLD_COLLATION_CONNECTION * /;

I found it strange that on the line where it says:
What was imported - - Database: `banco_teste`
In what I created manually there is: - -- Banco de dados: `banco_teste` (in Portuguese)


2) The database I imported from the previous version of phpMyAdmin is editing in Notepad ++ like this:

- phpMyAdmin SQL Dump
- version 4.7.9
- [www.phpmyadmin.net]
-
- Host: 127.0.0.1:3306
- Generation Time: 21-Mar-2020 at 02:01
- Server version: 5.7.21
- PHP Version: 7.1.16

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00: 00";


/ *! 40101 SET @OLD_CHARACTER_SET_CLIENT = @@ CHARACTER_SET_CLIENT * /;
/ *! 40101 SET @OLD_CHARACTER_SET_RESULTS = @@ CHARACTER_SET_RESULTS * /;
/ *! 40101 SET @OLD_COLLATION_CONNECTION = @@ COLLATION_CONNECTION * /;
/ *! 40101 SET NAMES utf8mb4 * /;

-
- Database: `banco_teste`
-

- ------------------------------------------------ --------

-
- Structure of the `registration` table
-

DROP TABLE IF EXISTS `registration`;
CREATE TABLE IF NOT EXISTS `registration` (
`ClientName` varchar (20) DEFAULT NULL,
`CustomerName` varchar (30) DEFAULT NULL,
`Sex` char (1) DEFAULT NULL
) ENGINE = InnoDB DEFAULT CHARSET = latin1;

-
- Extracting data from the `registration` table
-

INSERT INTO `listas` (`ID_item`, `Item`) VALUES
(1, 'Laranja'),
(2, 'Banana'),
(3, 'Maçã'),
(4, 'Uva'),
(5, 'Caqui'),
(6, 'Caju');
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

I found it strange that on the line where it says:
What was imported - - Database: `banco_teste`
In what I created manually there is: - Database: `banco_teste` (in Portuguese)

Options: ReplyQuote
Re: Error when importing database with nine version WAMP SERVER 64 BITS (X64) 3.2.0
Posted by: RiggsFolly (Moderator)
Date: March 23, 2020 04:59PM

Sorry I made a mistake on my previous suggestion, it should have been `use` and not `user`


- Database: `banco_teste`
use `banco_teste`;

You have to tell MySQL/mariaDB which database to load all this data into

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.2.0 32bit & 64bit)
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.19>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your MySQL databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-



Edited 2 time(s). Last edit at 03/23/2020 05:01PM by RiggsFolly.

Options: ReplyQuote
Re: Error when importing database with nine version WAMP SERVER 64 BITS (X64) 3.2.0
Posted by: Otomatic (Moderator)
Date: March 23, 2020 05:15PM

Hi,

Since at the beginning of the SQL file you don't have:
--
-- Database: `banco_teste`
--
DROP DATABASE IF EXISTS `banco_teste`;
CREATE DATABASE IF NOT EXISTS `banco_teste` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
USE `banco_teste`;
It is imperative that you have first created the `banco_teste` database before you want to import the file.
And it is also imperative, if in the SQL file you do not specify USE `banco_teste` to first select the database in PhpMyAdmin before requesting the import.

> What was imported - - Database: `banco_teste`
> In what I created manually there is: - Database: `banco_teste` (in Portuguese)
Nothing is strange !
There is no difference.

------------------------------------------------------------------------------------------------------------
Wampserver 3.2.0 32 bit - Apache 2.4.43 - PHP 7.4.4/7.3.16/..../5.6.40 - MySQL 5.7.29 - MariaDB 10.4.12
Wampserver 3.2.0 64 bit - Apache 2.4.43 - PHP 7.4.4/7.3.16/..../5.6.40 - MySQL 5.7.29/8.0.19 - MariaDB 10.4.12
PhPMyadmin 5.0.2 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote
Re: Error when importing database with nine version WAMP SERVER 64 BITS (X64) 3.2.0
Posted by: Teixeira (---.virtua.com.br)
Date: March 23, 2020 05:43PM

Hi Otomatic (Moderator),
I did as your suggestion and the database banco_teste was successfully created.
So, I understood that all my databases I backed up that I did with the previous version should I do like this?

1) In the "Database" tab, I enter the "Create database" field, type the name of my backup database and click "Create";

2) Once created, I click on it and have it imported pointing to the name of the database to be imported. Once this is done, the file is successfully imported. Would this procedure be correct?

I take the opportunity to know how I should configure it so that the homepage opens with MySQL (as in the previous version) and not MariaDB.

Thank you very much for your attention.

Options: ReplyQuote
Re: Error when importing database with nine version WAMP SERVER 64 BITS (X64) 3.2.0
Posted by: Otomatic (Moderator)
Date: March 23, 2020 06:01PM

Hi,

> should I do like this? .... 1).... 2)....
Yes.

> I take the opportunity to know how I should configure it so that the homepage opens
> with MySQL (as in the previous version) and not MariaDB.

I could answer you: Right-Click -> help -> MySQL - MariaDB
but, as RiggsFolly has been so kind to correct my translation of this help file, I give you the first glimpse of what this help file will be for the 3.2.1 update.
------------------------------------------------------------------------

+-------------------------+
+--- MySQL and MariaDB ---+
+-------------------------+

MySQL has been supported since the beginning of Wampserver and MariaDB has been supported since Wampserver 3.0.8.
For SQL connections the default port is and always has been port 3306.
Both MySQL and MariaDB are installed by the full installer.

Depending on the versions of the full installer of Wampserver you used, either MySQL or MariaDB will be the default database manager.
- If MySQL is the default DBMS, it uses port 3306 and therefore MariaDB will use port 3307.
- If MariaDB is the default DBMS, it uses port 3306 and therefore MySQL will use port 3308.
The default database manager is shown in the Left-Click menu of Wampmanager

+----------------------------------------------+
+-- Database connection via MariaDB or MySQL --+
+----------------------------------------------+
The default Database manager port is 3306. Connections that do not specify the port number will always be on the default port.
If the database manager (MySQL or MariaDcool smiley you want to use is not the default one, it is therefore imperative to specify the port number in connection requests since it will not be using the default port 3306. We repeat, without specifying the port, it will be the default port that will be used, so 3306.
Normally, connection scripts do not mention the port to use. For example:
$mysqli = new mysqli('127.0.0.1', 'user', 'password', 'database');
or, in procedural :
$mysqli = mysqli_connect('127.0.0.0.1', 'user', 'password', 'database');

So, to connect with a manager that doesn't use port 3306, you have to specify the port number on the connection request:
$mysqli = new mysqli('127.0.0.1', 'user', 'password', 'database', '3307');
or, procedurally:
$mysqli = mysqli_connect('127.0.0.0.1', 'user', 'password', 'database', '3307');

To check the connections on the MySQL or MariaDB database manager, use the script:
wamp(64)\www\testmysql.php by putting 'http://localhost/testmysql.php' in the browser address bar having first modified the script according to your parameters.

+----------------------------------------------------------------+
+-- Replace the default DBMS MariaDB with MySQL and vice versa --+
+----------------------------------------------------------------+
Important note : If you want to move a database from MySQL to MariaDB or visa versa, it is IMPERATIVE to BACKUP your databases (phpMyAdmin -> EXPORT) in format - SQL before switching DBMS.
This is the only reliable way to transfer a database between MySQL and MariaDB.
- There is a tool to reverse the default DBMS with one click if both are enabled (MySQL AND MariaDcool smiley:
- If MySQL is the default DBMS
Right-click Wampmanager icon -> Tools -> Invert default DBMS MySQL <-> MariaDB
or
- If MariaDB is the default DBMS
Right-click Wampmanager icon -> Tools -> Invert default DBMS MariaDB <-> MySQL
Of course, you still have to import your previously saved databases.

+-------------------------------+
+-- Only one database manager --+
+-- No database manager --+
+-------------------------------+
You don't have to keep both MySQL and MariaDB managers active, you can deactivate the one that you do not require. You can even disable both database managers completely if you wish :
Right-Click Wampmanager Icon -> Wamp Settings -> Allow MariaDB to deactivate - removes the green Tick
Right-Click Wampmanager Icon -> Wamp Settings -> Allow MySQL to deactivate - removes the green Tick

You can reactivate either of both at a leater date if you and when you want to. This does not uninstall the DBMS, it just unregisters the Windows Service for that DBMS.

+----------------+
+-- PhpMyAdmin --+
+----------------+
PhpMyAdmin is configured to allow you access to either MySQL or MariaDB depending on which ones are active.
If both DBMS's are activated, you will see a dropdown on the Login screen, called "Server Choice", the default server will be shown first in the dropdown list. Select the DBMS you want to use here as part of the login process.
REMEMBER, if you have different user accounts you must use the correct one for the selected DBMS.
ALSO: If you have the same account i.e. `root` on both DBMS's, if you have set different passwords, you need to use the right password for the account and DBMS.

------------------------------------------------------------------------------------------------------------
Wampserver 3.2.0 32 bit - Apache 2.4.43 - PHP 7.4.4/7.3.16/..../5.6.40 - MySQL 5.7.29 - MariaDB 10.4.12
Wampserver 3.2.0 64 bit - Apache 2.4.43 - PHP 7.4.4/7.3.16/..../5.6.40 - MySQL 5.7.29/8.0.19 - MariaDB 10.4.12
PhPMyadmin 5.0.2 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote
Re: Error when importing database with nine version WAMP SERVER 64 BITS (X64) 3.2.0
Posted by: Teixeira (---.virtua.com.br)
Date: March 23, 2020 06:32PM

Understand.
I wish you much success and thank you for your attention.
To the next.

Options: ReplyQuote


Sorry, only registered users may post in this forum.