The location of MySQL’s configuration files on Linux is located /etc/my.cnf

How to Manually make a backup of a MySQL database on a Linux server

  • open a terminal window on your linux server.
  • Type: user@loaclhost>mysqldump -u root -p DATABASE_NAME > DB_NAME.sql
    for example: mysqldump -u root -p wordpressdatabase > wordpressdatabase.sql

    • (notice I do not pass the password. I did this because one of the most common mistakes is that people put a space between -p [password] when you are supposed to leave the space out, -p[password]
  • note that DB_NAME.sql will be saved where you run the command. So you may want to change to the directory that you want to save the the SQL dump file and run themysqldunmp in that directory.

How to Move a database from one server to another Linux server

  • on source server: The one you want to move your database from:
    • Just like above you start out by making a backup of your SQL database.
    • open a terminal window on your Linux server.
    • Change to the directory that you want to store your sql dump, (which is a text file with SQL statements that will be used to insert data back into your new server’s MySQL database)
    • Type: user@loaclhost>mysqldump -u root -p DB_NAME > DB_NAME.sql
    • copy db_NAME.sql to your new server (you are probably going to use FTP)
  • On the new server: the one that you want to copy or import the data into
    • Again open a SSH telnet session or a terminal window
    • type at prompt user@localhost>mysql -u root -p wordpressdb < wordpressdb.sql;
      • for eaxample: mysql -u root -p wordpress_database< DB_NAME.sql;
Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

counter