DB export problem on XAMPP

Problems with the Windows version of XAMPP, questions, comments, and anything related.

DB export problem on XAMPP

Postby ekkelon » 06. May 2022 15:10

Hi,
I try to export the DB from PHPMyAdmin, I select the correct DB, select quickly export option but error message appear "operation failed"
If now I press resume download from browse, it seem that the download working but final DB-sql is only 58Kb.
Do you think the export DB is not complete?
Thnx.
ekkelon
 
Posts: 7
Joined: 04. May 2022 10:06
XAMPP version: 3.3.0
Operating System: Windows11

Re: DB export problem on XAMPP

Postby ekkelon » 06. May 2022 15:14

If I can't export the DB ... the data/myDB (for example) folder in XAMPP/mysql folder is the complete DB? Can I use use to insert in online hosting?
Thnx.
ekkelon
 
Posts: 7
Joined: 04. May 2022 10:06
XAMPP version: 3.3.0
Operating System: Windows11

Re: DB export problem on XAMPP

Postby Nobbie » 06. May 2022 15:57

ekkelon wrote:Do you think the export DB is not complete?


I dont know. Simply use an editor and look into the file. If it is a zipped file, unzip it first and then edit.

Instead of PhpMyadmin you can use the powerfull terminal tool "mysqldump.exe", which is delivered with Xampp in c:/xampp/bin/mysqldump.exe

Open a terminal and enter

Code: Select all
c:/xampp/bin/mysqldump.exe DATABASENAME  >myfile.sql


where DATABASENAME is ths name of the database you want to export. You will find the exported data in myfile.sql. You may use any other name for the export file instead. This usually runs much faster and better than PhpMyadmin. There are also plenty of runtime options for mysqldump, enter

Code: Select all
c:/xampp/bin/mysqldump.exe --help


for help.
Nobbie
 
Posts: 13177
Joined: 09. March 2008 13:04

Re: DB export problem on XAMPP

Postby Nobbie » 06. May 2022 16:01

ekkelon wrote:If I can't export the DB ... the data/myDB (for example) folder in XAMPP/mysql folder is the complete DB? Can I use use to insert in online hosting?
Thnx.


Yes and no. It may work, but it depends on releases and configuration of MySQL / MariaDB. If they have same configuration and more or less same release, you can use the whole mysql/data folder (not the mysql folder, thats too much) also Online. But this requires the possibility to access the MySQL installation Online, that usually is not possible with basic webhosting. You need to run your own server.

Instead you also may use the exported file which you created with mysqldump. If you want to import the database, run this command on the target machine (you have to upload and / or copy the export file to the server before):

Code: Select all
c:/xampp/bin/mysql -u USER -pPASSWORD DATABASENAME <myfile.sql


where USER is to replace by the admin user of MySQL ("root" in case of Xampp), PASSWORD is the password (Xampp comes without a password, you may leave out that parameter for Xampp) and DATABASENAME is the name of the database (i.e. wordpress or so). ATTENTION: there MUST be a space between "-u" and USER, but MUST NOT be between "-p" and PASSWORD.

If the target machine is not a Windows Xampp installation, you have to replace c:/xampp/bin/mysql by a proper command, i.e. only "mysql" or "/usr/bin/mysql" or similar. That depends on your installation and operating system.
Nobbie
 
Posts: 13177
Joined: 09. March 2008 13:04

Re: DB export problem on XAMPP

Postby ekkelon » 06. May 2022 16:14

Hi.
I follow your instructions but this error message appear

"C:\xampp\mysql\bin>c:/xampp/bin/mysqldump.exe eleni22new >myfile.sql
Impossibile trovare il percorso specificato."

Why?
Thnx.
ekkelon
 
Posts: 7
Joined: 04. May 2022 10:06
XAMPP version: 3.3.0
Operating System: Windows11

Re: DB export problem on XAMPP

Postby Nobbie » 06. May 2022 17:11

ekkelon wrote:Hi.
I follow your instructions but this error message appear

"C:\xampp\mysql\bin>c:/xampp/bin/mysqldump.exe eleni22new >myfile.sql
Impossibile trovare il percorso specificato."

Why?
Thnx.


Oups - its the wrong path, its "C:/xampp/mysql/bin/mysqldump.exe".

You really need to learn to be more independent. You can easily find out such simple things yourself with Google. If you want to operate an Apache server, you have to bring along much more initiative.
If you simply search for "mysqldump.exe" in Google, you will find thousands of usefull hints. So next time look for yourself before you ask without even thinking for a second yourself?! Ok?
Nobbie
 
Posts: 13177
Joined: 09. March 2008 13:04

Re: DB export problem on XAMPP

Postby frankge » 24. June 2022 17:21

Nobbie wrote:
ekkelon wrote:If I can't export the DB ... the data/myDB (for example) folder in XAMPP/mysql folder is the complete DB? Can I use use to insert in online hosting?
Thnx.


Yes and no. It may work, but it depends on releases and configuration of MySQL / MariaDB. If they have same configuration and more or less same release, you can use the whole mysql/data folder (not the mysql folder, thats too much) also Online. But this requires the possibility to access the MySQL installation Online, that usually is not possible with basic webhosting. You need to run your own server.

Instead you also may use the exported file which you created with mysqldump. If you want to import the database, run this command on the target machine (you have to upload and / or copy the export file to the server before):

Code: Select all
c:/xampp/bin/mysql -u USER -pPASSWORD DATABASENAME <myfile.sql


where USER is to replace by the admin user of MySQL ("root" in case of Xampp), PASSWORD is the password (Xampp comes without a password, you may leave out that parameter for Xampp) and DATABASENAME is the name of the database (i.e. wordpress or so). ATTENTION: there MUST be a space between "-u" and USER, but MUST NOT be between "-p" and PASSWORD.

If the target machine is not a Windows Xampp installation, you have to replace c:/xampp/bin/mysql by a proper command, i.e. only "mysql" or "/usr/bin/mysql" or similar. That depends on your installation and operating system.


hello,
I tried leaving out -pPassword and it did not work, I even tried -p and no password thinking maybe it needs -p but that also didn't work.
frankge
 
Posts: 1
Joined: 24. June 2022 17:18
XAMPP version: 8.1.6
Operating System: Windows 11 Pro

Re: DB export problem on XAMPP

Postby Froosh » 25. June 2022 19:28

Not sure if this fits your situation, but a release back (8.1.4 and .5 for the 8.1 line) there was an issue with exporting from phpMyAdmin. I did successfully use the mysqldump command. I am currently using 8.1.6, and phpMyAdmin is again able to export databases.
User avatar
Froosh
 
Posts: 138
Joined: 27. March 2022 17:56
XAMPP version: 8.2.0
Operating System: Windows 11 Pro


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 100 guests