Jump to content

Recommended Posts

Posted
Create Backups of the databases, If I schedule to export databases to a folder then get the backup software to backup that software.
Posted

HI, someone posted some commands to achieve this. They also stated not to stop the database. I think it was Jona but not 100%. Them posts have been lost because of the server going down.

 

Please can you post them again :)

 

Thanks

Posted

Hi,

Yeh it was me. We back up our mysql server (moodle) nightly and don't stop it, if fact if you do stop it as in kill the service you can't connect at all (fairly obviously) so I don't think you need to do this.

 

The command is as follows:

mysqldump -u mysqlUsername --password=mysqlPassword databaseName > c:\locationYouWantToSave\TheDatabase.sql

 

If your path environment isn't set up correctly you may need to search for mysqldump on your hard disk and run it from there.

 

Hope that helps.

 

Cheers

Jona

  • Thanks 1
Posted

Hiya, thanks for that works a treat :)

 

Another question, do you know the command to export all databases?

 

Thanks

 

Z

Posted

Hi

 

when i try to import a database that has been exported using the command i get the attached error message.

 

If works fine if i do it manually.

 

Any ideas please?

 

Thanks

 

Z

php.jpg

Posted

Are you using the --all-databases when exporting? If you aren't then you need to have a database selected before you try and import it, you could create a new test database for this purpose.

 

When I do an import I ignore phpmyadmin and just do it directly from the command line using something like:

mysql -h loclahost -P 3306 -u root --password=rootpassword testdb < c:\database\database.sql

 

Guide here: How to Back Up and Restore a MySQL Database

 

Cheers

Jona

Posted

I am using this one

 

mysqldump -u mysqlUsername --password=mysqlPassword databaseName > c:\locationYouWantToSave\TheDatabase.sql

 

I will try that tomorrow and let you know how i get on.

 

Cheers

 

Z

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...