Qunhui ds218 + deploy MySQL

Time:2021-2-20

Welcome to my GitHub

https://github.com/zq2599/blog_demos

Content: all the original articles and supporting source code, including Java, docker, kubernetes, Devops, etc;

The cause is laziness

I’m a java programmer. When I write code at home, I can’t do without basic services such as redis, MySQL and Kafka. The usual way is to turn on the computer, start redis, MySQL and Kafka, and then turn off the computer after using them. Please (do you want to call me lazy? You are right…)

It’s not the first time

Before that, I used to worry about Qunhui ds218 + at home and installed Maven private service nexus3, address:Qunhui ds218 + make Maven private service (nexus3)

Qunhui ds218+

There is a Qunhui ds218 + at home, which has been running 24 hours for a long time to serve the whole family. If you can install MySQL here, it seems that the trouble ahead will be gone;

  1. The following figure shows what ds218 + just bought. It has two NAS hard disks and has been serving stably
    在这里插入图片描述
  2. The following figure shows the memory module of online shopping. Now there is a total of 2 + 8 = 10g memory. Sufficient memory is the base to dare to toss
    在这里插入图片描述
  3. It’s said that the original 2G memory module can be replaced when the machine is disassembled, and two 8g memory modules can be installed. At present, I can’t use them. I need to restrain myself

thinking

In fact, the operation is very simple: Qunhui has a docker service, and you can deploy MySQL with docker. Therefore, this article is the basic operation record of Qunhui docker. The following points should be noted:

  1. Container port
  2. Container data volume
  3. file right
  4. Login container operation

environmental information

  1. Qunhui system: DSM 6.2.2-24922 update 4
  2. Mysql:5.7.29

preparation

  1. First, prepare a local directory for the MySQL container, otherwise once the container goes wrong, the MySQL data will not be found
  2. As shown in the figure below, in the file station, create a new folder named MySQL under the docker directory
    在这里插入图片描述
  3. You should also give permission to this directory, otherwise the container can’t write data, as shown in the figure below. Right click and select on the menuattribute
    在这里插入图片描述
  4. As shown in the figure below, I have released all the permissions here for the sake of simplicity and convenience
    在这里插入图片描述
  5. As shown in the red box below:
    在这里插入图片描述
  6. The preparatory work has been completed and the formal operation can be started;

operation

  1. Enter Qunhui management page
  2. Enter the docker application, search for the MySQL image, and then start to download the image in the following numerical order:
    在这里插入图片描述
  3. After the image is downloaded, the operation is in the following numerical order to enter the start container page:
    在这里插入图片描述
  4. Give the container a proper name and clickadvanced setting
    在这里插入图片描述
  5. choicevolumeThis tab page, clickadd folders
    在这里插入图片描述
  6. Select the MySQL folder we just created:
    在这里插入图片描述
  7. Load path refers to the path within the container, write/var/lib/mysql
    在这里插入图片描述
  8. Next, set the port, as shown in the figure below, and remove the local port corresponding to 3306 from theautomaticChange to3306
    在这里插入图片描述
  9. At the end of the dayEnvironmental ScienceIn the tab page of MySQL, add the password settings of the root account of MySQL, as shown in the figure belowMYSQL_ROOT_PASSWORD, value123456After the operation, click theapplicationButton to complete the setting:
    在这里插入图片描述
  10. CheckRun this container after the wizard completes, click theapplicationYou can start creating the container:
    在这里插入图片描述

verification

To verify whether MySQL is available:

  1. Double click the position in the red box below:
    在这里插入图片描述
  2. In the pop-up page, continue to double-click the position in the red box below:
    在这里插入图片描述
  3. As shown in the following figure, you can execute a shell command in the namespace of the MySQL container:
    在这里插入图片描述
  4. Pop up a window for you to enter the command, please enter/bin/bash
    在这里插入图片描述
  5. As shown in the figure below, it enters the container
    在这里插入图片描述
  6. Execute the ordermysql -uroot -p123456, you can enter MySQL command mode, as shown in the figure below, and the operation is normal:
    在这里插入图片描述
  7. Remote connection should also try. After all, other machines will connect through IP address in the future. I used a MacBook Pro here and installed itMySQL Workbench, configured Qunhui’s IP address and3306Port, account numberroot, password123456The connection is normal, as shown in the figure below:
    在这里插入图片描述
    So far, Qunhui ds218 + has successfully deployed mysql. In the future, the database service will be available at any time, and there is no extra cost

Welcome to the official account: programmer Xin Chen

Wechat search “programmer Xinchen”, I’m Xinchen, looking forward to enjoying the Java world with you
https://github.com/zq2599/blog_demos

Recommended Today

Background management system menu management module

1 menu management page design 1.1 business design Menu management, also known as resource management, is the external manifestation of system resources. This module is mainly to add, modify, query and delete the menu. CREATE TABLE `sys_menus` ( `id` int(11) NOT NULL AUTO_INCREMENT, `Name ` varchar (50) default null comment ‘resource name’, `URL ` varchar […]