CeskyFrenchGermanItalianPortugueseTurkceSpanish

How do I know the engine number
04/20/2016
WHY hydrogen peroxide sizzles
04/20/2016

How to import a Mysql database

How to import a Mysql database

MySQL database management system is one of the most popular solutions for creating versatile and flexible storage services web-based application data.

Drivers to work with the MySQL database included in thethe vast majority of distributions modern CMS. For the majority of popular scripts and content management systems, databases exist with initial filling.

It is only necessary to import the mysql database to get started.

You will need

  • - Login credentials to access the server MySQL-
  • - Console client mysql.

instructions

1

Prepare MySQL database dump file. If the dump is located in the archive, extract it. Use an appropriate extractor or the possibility file manager.

2

Specify text encoding database dump, if it is not known in advance. Open the file in an editor or viewer, allowing dynamic change encodings. Choose the encoding of the document.

3

Connect to the MySQL server. Run the console client program mysql with the specified host name and user. The host name is specified with the parameter -h command line, and the user name - using -u. You can also specify the password on the command line to access the server using the -password key or leave this option without a value (if the password is requested at connection) .Vvedite console type the following command:
mysql -h HostName -u UserName -password = UserPassword
and press Enter. There HostName - Host name (it can be both symbolic and represent the IP-address), UserName - user name of the database, and UserPassword - password. If a successful connection to the console will display the message, and displays an invitation to enter commands.

4

Print a list of supported server setssymbols. In the console, type «SHOW CHARACTER SET-«. Press Enter. Determine whether installed on the server character set that corresponds to the coding, which contains data dump imported database.

5

Display the list of the existing databases. In the console, type «SHOW DATABASES-«. Press Enter.

6

Create a new base Data on the server MySQL. Enter the type of command:
CREATE DATABASE `DatabaseName` CHARACTER SET CharsetName COLLATE CollateName-
and press Enter. As DatabaseName parameter to specify the desired database name. It should not coincide with the same name from the list printed on the fifth step. The parameter CharsetName specify the name of the character set corresponding to the encoding of the text database dump. List of character sets has been displayed on the fourth step. Instead CollateName substitute value from the «Default collation» corresponding line in the same list.

7

Disconnect from the server. Enter the console q. Press Enter.

8

import base MySQL. Enter in the console type the following command:
mysql -h HostName -u UserName -D DatabaseName -b -B -s -p & lt- filename
press Enter. Enter your user password. Press Enter. Wait until the import dannyh.Zdes values ​​-h and -u parameters are similar to those described in the third step. Instead DatabaseName is necessary to substitute the name created on the sixth step of the database. The value of the filename must be a full or relative path to the database dump. Error messages are displayed in the console.

Comments are closed.