jameskane
asked on
MYSQL Server 5.7 - mysqldump.exe producing error.
I have a coldfusion application running with msql Server 5.7 and windows 7. While the application works correctly, I am unable to backup the database office_18.sql. The error message is shown below.
I have the same application working on two other pcs which run Windows 10. The backup work in these instances
Is there a known window7 problem in this area and if so, a workaround ?
thanks for any help
james
Environment
windows 7
Coldfusion
Mysql Server 5.7
Application works
CODE
error message
Cannot run program "C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqldump.exe": CreateProcess error=2, Le fichier spécifié est introuvable
I have the same application working on two other pcs which run Windows 10. The backup work in these instances
Is there a known window7 problem in this area and if so, a workaround ?
thanks for any help
james
Environment
windows 7
Coldfusion
Mysql Server 5.7
Application works
CODE
<cftry>
<!--- Increase timeout to account for db size. Larger db's require more time for backup --->
<cfexecute name='C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqldump.exe'
arguments=" -uroot -pBuddyholly_69 office_18"
errorVariable="errorMessage"
outputFile="C:\mysql_backups\office_18.sql"
timeout="120" />
<!---errorMessage = <cfoutput>#errorMessage#</cfoutput><br>--->
<cfdump var="#GetFileInfo('C:\mysql_backups\office_18.sql')#">
<strong>Votre sauvegarde 1 a reussi</strong> C:\mysql_backups
<cfcatch type="any">
<span class="style1"><strong>Votre sauvegarde 1 a echoue</strong></span> C:\mysql_backups
<cfdump var="#cfcatch#">
</cfcatch>
</cftry>
error message
Cannot run program "C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqldump.exe": CreateProcess error=2, Le fichier spécifié est introuvable
try running this code in the commad promp before you run it with cfexecute
@james - Have you checked your Windows Event viewer logs - "Application" and "System"?
Review the logs to make sure that whatever account ColdFusion is running under has permissions to execute "mysqldump.exe".
Also have you tested creating a backup to your backup directory manually using MySQL Workbench?
Review the logs to make sure that whatever account ColdFusion is running under has permissions to execute "mysqldump.exe".
Also have you tested creating a backup to your backup directory manually using MySQL Workbench?
ASKER
ASKER
Thanks very much LajuanTaylor for helping me with this. Embarrasingly, I have not checked the logs - could you give me a pointer as to how this is done ? On the other hand, I am able to run the application without any problem. This involves accessing and updating the mysql database, so I assumed that accessing was not an issue
Doing a manual backup on mysql workbench would be great - but I have not figured out how to do this. I attach an image of my current set up. Could you give me a few hints on how to do this ?
thanks James
Doing a manual backup on mysql workbench would be great - but I have not figured out how to do this. I attach an image of my current set up. Could you give me a few hints on how to do this ?
thanks James
@James - To open the Windows Event Viewer:
1. Open the Start Menu, type eventvwr.msc, and press Enter.
2. If you are logged in as an administrator and prompted by UAC, then click on Yes.
3. In the left pane, click on an event log to see it's events listed at the top of the middle pane.
4. If you like, you could also right click on an event log in the left pane for more options to use. For example, to Filter Current Log or Find a specific event ID number listed in the middle pane.
I included a screen shot of what the event viewer looks like.
Regards,
LaJuan
Windows_Event_Viewer.png
1. Open the Start Menu, type eventvwr.msc, and press Enter.
2. If you are logged in as an administrator and prompted by UAC, then click on Yes.
3. In the left pane, click on an event log to see it's events listed at the top of the middle pane.
4. If you like, you could also right click on an event log in the left pane for more options to use. For example, to Filter Current Log or Find a specific event ID number listed in the middle pane.
I included a screen shot of what the event viewer looks like.
Regards,
LaJuan
Windows_Event_Viewer.png
@James - There's several posts on EE regarding using MySQL Workbench for backups. Take a look at the following post:
https://www.experts-exchange.com/questions/28614075/backup-in-mysql-workbench.html
Let me know if this works for you.
Regards,
LaJuan
https://www.experts-exchange.com/questions/28614075/backup-in-mysql-workbench.html
Let me know if this works for you.
Regards,
LaJuan
ASKER
Thanks for you valuable inputs LajuanTaylor !! I checked the events viewer and do not see any problems. This would support the fact that
my application works fine - its just the problem with the backup. I am attaching an image of the information presented as I tried to create a backup. While, I was able to contine and create a backup, I can't given this message, be sure it is good.
The issue is clear from the warning information. The name of the exported file in dumps was dump2070528.sql with a size of 1250 Ko - looks correct.
However, on trying to import this file back to the mysql server, I get an error essage
So, looks like the problem is that the mysqldump.exe I am using is older than the server and I need to update it. I find this confusing because I thought that ysqldump.exe is a part of the server, and not something else on the side.
Not sure how to go about fixing this !!!
my application works fine - its just the problem with the backup. I am attaching an image of the information presented as I tried to create a backup. While, I was able to contine and create a backup, I can't given this message, be sure it is good.
The issue is clear from the warning information. The name of the exported file in dumps was dump2070528.sql with a size of 1250 Ko - looks correct.
However, on trying to import this file back to the mysql server, I get an error essage
So, looks like the problem is that the mysqldump.exe I am using is older than the server and I need to update it. I find this confusing because I thought that ysqldump.exe is a part of the server, and not something else on the side.
Not sure how to go about fixing this !!!
@james - It appears that the "mysqldump" utility is a different version in MySQL Workench than the version that comes with MySQL Server. I have Workbench 6.3 CE installed on my Windows 10 workstation. However, the 6.3 workbench uses the 5.7.17 "mysqldump" utility. See screen shot from my install directory and file properties of the "mysqldump" utility.
Check your workbench install directory to verify the version of your "mysqldump" utility.
I would also check the versions running on your Windows 10 machines as well for comparison.
Regards,
LaJuan
MySQLDump_Utility_Version.png
Check your workbench install directory to verify the version of your "mysqldump" utility.
I would also check the versions running on your Windows 10 machines as well for comparison.
Regards,
LaJuan
MySQLDump_Utility_Version.png
ASKER
Fixed the version problem. The mysqldup.exe had been set to support XP. Changed to to support WIN 7 and with that the version of mysqldump.exe changed from 5.7.12 to 5.7.17. See images below
However, now I get a new error situation when trying to import. No prompt about version problem, just an error as shown in image below.
Thanks for hanging in there with me !!
james
However, now I get a new error situation when trying to import. No prompt about version problem, just an error as shown in image below.
Thanks for hanging in there with me !!
james
@James -
If you look into your SQL dump files Dump20170528.sql, office_188.sql, or officeCOPY.sql using any text editor,
you will see that the files probbaly don't contain commands to create a database or to use an existing db.
If this is the case, that's why you are seeing the error "No database selected".
You can create an empty database manually or add the create database statements to the SQL dump files. If the database exists already, you can just add the "USE Database" SQL commands to the dump file.
I currently don't have access to any MySQL instances, but I thought there was a way to have the Workbench add the create or USE statements automatically...
Regards,
LaJuan
If you look into your SQL dump files Dump20170528.sql, office_188.sql, or officeCOPY.sql using any text editor,
you will see that the files probbaly don't contain commands to create a database or to use an existing db.
If this is the case, that's why you are seeing the error "No database selected".
You can create an empty database manually or add the create database statements to the SQL dump files. If the database exists already, you can just add the "USE Database" SQL commands to the dump file.
I currently don't have access to any MySQL instances, but I thought there was a way to have the Workbench add the create or USE statements automatically...
Regards,
LaJuan
@James - Take a look at the screenshots from the from the MySQL Support site. These illustrate a restore to an existing database and highlight advanced export options:
https://dev.mysql.com/doc/workbench/en/wb-admin-export-import-management.html
Regards,
LaJuan
https://dev.mysql.com/doc/workbench/en/wb-admin-export-import-management.html
Regards,
LaJuan
ASKER
I created a new blank database with the same name as the one I wanted to import. I then attempeted to import that database from my hard disk. Unfortunately get exactly the same error as I did before. Error 1046.
In the application, which runs correctly using and updating the database, I have an BACKUP LINK (see code below). On clicking this a cfml page runs and creates a backup 'C:\mysql_backups\office.s ql. This no longer works on the windows 7 laptop. I get an error which indicates a java problem. See attached
In the application, which runs correctly using and updating the database, I have an BACKUP LINK (see code below). On clicking this a cfml page runs and creates a backup 'C:\mysql_backups\office.s
<cftry>
<!--- Increase timeout to account for db size. Larger db's require more time for backup --->
<cfexecute name='C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqldump.exe'
arguments=" -uroot -pBuddyholly_69 office"
errorVariable="errorMessage"
outputFile="C:\mysql_backups\office.sql"
timeout="120" />
<!---errorMessage = <cfoutput>#errorMessage#</cfoutput><br>--->
<cfdump var="#GetFileInfo('C:\mysql_backups\office.sql')#">
<strong>Votre sauvegarde 1 a reussi</strong> C:\mysql_backups
<cfcatch type="any">
<span class="style1"><strong>Votre sauvegarde 1 a echoue</strong></span> C:\mysql_backups
<cfdump var="#cfcatch#">
</cfcatch>
</cftry> <br /> <br />
@James - What type of account are you using to run ColdFusion on your Windows 10 versus the Windows 7 workstation? For example, using the default "localSystem". You can check this in your Windows services.
Sometimes the error, "java.io.IOException cannot run program" is associated with permissions being denied.
Also, did you check your dump.sql file to make sure it includes the USE (db) statement?
Regards,
LaJuan
Sometimes the error, "java.io.IOException cannot run program" is associated with permissions being denied.
Also, did you check your dump.sql file to make sure it includes the USE (db) statement?
Regards,
LaJuan
ASKER
Also, did you check your dump.sql file to make sure it includes the USE (db) statement?
No, I did create a blank database on the server 'officecopy'. I then changed the name of the file I wanted to import to officecopy.sql - I understood from what you said that this would suffice ? I'm not sure how to check if officecopy.sql has a db statement within in.
Sometimes the error, "java.io.IOException cannot run program" is associated with permissions being denied
I am inclined to rule this out as my coldfusion application which uses the sql database on the server runs properly. By running I mean updating the database and using data from the database to generate reports. ?? Also, see attached images. I checked for any security errors in the log just after running an import. No security error reported.
What type of account are you using to run ColdFusion on your Windows 10 versus the Windows 7 workstation? For example, using the default "localSystem". You can check this in your Windows services
Am attaching a snapshot of the application which shows the local address used. Its the same set up both windows 7 and windows 10.
Again, very many thanks for taking the time on this.
James
No, I did create a blank database on the server 'officecopy'. I then changed the name of the file I wanted to import to officecopy.sql - I understood from what you said that this would suffice ? I'm not sure how to check if officecopy.sql has a db statement within in.
Sometimes the error, "java.io.IOException cannot run program" is associated with permissions being denied
I am inclined to rule this out as my coldfusion application which uses the sql database on the server runs properly. By running I mean updating the database and using data from the database to generate reports. ?? Also, see attached images. I checked for any security errors in the log just after running an import. No security error reported.
What type of account are you using to run ColdFusion on your Windows 10 versus the Windows 7 workstation? For example, using the default "localSystem". You can check this in your Windows services
Am attaching a snapshot of the application which shows the local address used. Its the same set up both windows 7 and windows 10.
Again, very many thanks for taking the time on this.
James
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Lajuan, apologies for delay in getting back. I have not yet resolved the problem but , will your really excellent and patient support I have all the tools necessary to reach a solution or confirm that this is a mysql / windows 7 issue. I have a sense that Oracle has dropped the ball here.
So, I am closing out the question. All of your inputs have been really helpfull - but I will choose the last one for purposes of closing the question.
Again, many thanks
james
So, I am closing out the question. All of your inputs have been really helpfull - but I will choose the last one for purposes of closing the question.
Again, many thanks
james
@James - You're welcome.