[ Pobierz całość w formacie PDF ]
.Restoring your database using the mysql clientTo restore the database from the backup file, you must first edit the backupfile (which is a text file).Then, you use the mysql client to create the databasefrom the SQL statements in the backup file.First, you edit the backup file by following these steps:1.Open the backup file in a text editor.2.Locate the line that shows the Server Versions.3.If you want to rebuild an entire database, add the following statementbelow the line that you locate in Step 2:CREATE DATABASE IF NOT EXISTS databasename4.Below the line in Step 3, add a line specifying which database to addBook IIIthe tables to:Chapter 2USE databasename5.Check the blocks of statements that rebuild the tables.If you don t want to rebuild a table, add --(two hyphens) at the beginningof each line that rebuilds the table.The hyphens mark the lines ascomments.6.Check the INSERTlines for each table.If you don t want to add data to any tables, comment out the lines thatINSERTthe data.7.Save the edited backup file.After the backup file contains the statements that you want to use to rebuildyour database or table(s), you can use the mysql client to execute the SQLstatements in the backup file.Just follow these steps:1.From a command line prompt, change to the binsubdirectory in thedirectory where MySQL is installed.In Windows, you open a command prompt window to use the mysqlclient, as described in Chapter 1 of this minibook.AdministeringMySQL 17_167779 bk03ch02.qxp 12/17/07 8:32 PM Page 292292 Restoring Your DataType a cdcommand to change to the correct directory.For instance,you might type cd /usr/local/mysql/bin or cd c:\ProgramFiles\MySQL\MySQL Server 5.0\bin.2.Type this command (which sends the SQL queries in the backup file):mysql -u accountname -p [ Pobierz całość w formacie PDF ]

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • funlifepok.htw.pl
  •