Home > database >  Download mysql installation and database import tutorial
Download mysql installation and database import tutorial

Time:10-24

step one: download the MySQL installation package
1. Open a browser and enter the download address: https://dev.mysql.com/downloads/mysql/5.5.html#downloads

2 before you click on the download version,

3. Click on the after the jump to interface the following

step 2: configure
Reference: https://blog.csdn.net/qq_37350706/article/details/81707862
1. To download the installation package of decompression, unzipped directory as follows:

2. The initialization configuration my. Ini file file:
The unzipped directory is not my. The ini file, it's ok to create the installation root directory to add my. Ini (new text files, change the file type to. Ini), write the basic configuration:

[mysqld]
 
# set port 3306
Port=3306
# set the mysql installation directory
Basedir=C: \ Program Files \ MySQL
# set the mysql database data storage directory
Datadir=C: \ Program Files \ MySQL \ Data
# to allow maximum number of connections
Max_connections=200
# allows the number of connection fails,
Max_connect_errors=10
# server using character set the default for utf8mb4
Character - set - server=utf8mb4
# to create a new table will use the default storage engine
Default - storage - engine=INNODB
# default "mysql_native_password" plug-in authentication
# mysql_native_password
Default_authentication_plugin=mysql_native_password
[mysql]
# set the mysql client default character set
Default - character - set=utf8mb4
[client]
# set the mysql client default ports used for connection to the server
Port=3306
Default - character - set=utf8mb4

And actually stored in the configuration file path to the path of the same (not to manually create the Data folder), written to complete the following chart directory structure

step 3: install
1. When installing, avoid using an administrator permissions error problem we try to run the CMD, otherwise it would be an error in the installation, can lead to install failed
2. As an administrator to run the CMD window, click on computer corner start icon, choose the "Windows" find "command prompt", right click "more" choice, and then select "run as administrator"

3. Open a command prompt window into mysql after bin directory

4. Under the bin directory of the mysql to execute the command: mysqld, initialize the console

5. In the following drawings show run successfully, to remember the contents of the red box

[Note] [Note] A temporary password generated for root @ localhost: P6zPxgk5oO: k, including root @ localhost: behind P6zPxgk5oO: k is the initial password (excluding the first space), before did not change the password, need to remember this password, login to follow-up, copy the password stored first!!!!!!
If the system error problems

Column: this is because the lack of Microsoft some required library operation, the baidu the download can be found the source installed a (may need to restart)
6. Then install the MySQL service + start MySQL service
Execute the command: mysqld -- install [service] # # # (service name can not add the default for mysql)
Appear, as shown in the figure below to install the MySQL service success

7. Start the MySQL service after successful installation, command: net start MySQL
Don't close CMD window after start-up success,

8. Then to change the mysql password to open a CMD window, again with the administrator at the command line, enter: mysql -u root -p, enter, after the initial password input before remember below

9. The mysql> This time you can go to change password! Type the command: the ALTER USER 'root' @ 'localhost' IDENTIFIED BY 'new password'. , change the password as below figure, after the success of the modified type exit; Exit,

step 4: configure the environment variables
1. Win10, for example: right-click on the computer - "attributes"

2. Select the "advanced system Settings" - "senior" - "environment variables"

3. Click on "new", in the edit box input variable name: MYSQL_HOME, a variable's value: mysql installation directory, file input and then click the "sure,"

4. Find the Path in the system variable, click on the "edit"

5. Click on "new", type: % MYSQL_HOME % \ bin, and then click "ok", Mysql environment variables successfully added at this time,

step 5: MySQL connection test
1. Open the database management tools, I used here is navicat, click "connect" input connection name and password

Click on the connection test, 2. Input after a successful connection is successful after the prompt dialog box, click ok to

3. Close the connected database appears after the connection window, double-click it to open the connection

4. The following figure said the connection is successful

step 6: a new database run the SQL file
1. Right-click the localhost133, select "new database" pop-up window as follows

2. After the success of the new will appear in the list

3. Select the database, double-click to open, stay icon to green then right click, choose "run the SQL file below
"nullnullnullnullnullnullnull
  • Related