Link to home
Start Free TrialLog in
Avatar of M A
M AFlag for United States of America

asked on

export from MYSQL, command needed

I have been trying to export the database using the commnd in MYSQL5.1
If I type 'mysqldump -u username -ppassword –all-databases –single-transaction > dump.sql'

I am getting an error.

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'mysql
dump -u username -ppassword -all-databases -single-transaction > dump.sql' at li

Anyone can help
Avatar of Sudaraka Wijesinghe
Sudaraka Wijesinghe
Flag of Sri Lanka image

Are you running this command from within MySQL? It should be executed in the command line of the server shell/console.
Avatar of M A

ASKER

I tried both
Not sure of you are using the same code as you posted here, but just noticed that two parameters all-databases and single-transaction have the wrong dashes in front of them. Other than that it works fine for me.

mysqldump -u username -ppassword --all-databases --single-transaction > dump.sql

Open in new window

Avatar of M A

ASKER

It did not work for me.
Post a screen-shot or copy/paste of your attempt.
Hi.

'mysqldump' is a single word, not 2 separate.

Hope this helps.
Regards,
Arty
Message about incorrect SQL syntax and 'mysql dump' (2 words) warned me.
Avatar of M A

ASKER

---->routinet
Screenshot attached

--->Nopius
you can the command in the error, I typed as a single word.

I am new to MYSQL.

Please help
Doc1.docx
SOLUTION
Avatar of Sudaraka Wijesinghe
Sudaraka Wijesinghe
Flag of Sri Lanka image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of M A

ASKER

I tried, but it is ending up in 'access denied'

ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If you are getting an access denied message, it is either because you are using the wrong MySQL credentials, or you do not have write access to the directory to which you are redirecting the mysqldump output.
Avatar of M A

ASKER

now the error is 'access denied @localhost...'

See my last comment.  If you continue to have issues, post a capture of the attempt, as I posted an example for you to follow.
Avatar of M A

ASKER

You need to have access to the folder which you are trying to export to. Many thanks to all