主頁 > 作業系統 > 二進制安裝MySQL資料庫

二進制安裝MySQL資料庫

2020-10-04 15:29:48 作業系統

二進制安裝MySQL資料庫

目錄
  • 二進制安裝MySQL資料庫
    • 實驗準備:
    • 準備階段:
    • 實驗階段:

實驗準備:

  1. 一個干凈的centos7系統(確認是沒有安裝過資料庫的系統)
  2. 關閉防火墻和selinux
  3. 創建一個邏輯卷磁區(因為資料庫存放資料一般都是在上漲的普通的磁區到達磁區容量極限時沒辦法在擴充磁區所以使用邏輯卷磁區比較好)
  4. 從官方平臺下載一個編譯過的一個二進制程式包(官方包下載地址:https://dev.mysql.com/downloads/mysql/)

準備階段:

  1. 創建邏輯卷磁區:
[root@centos7 ~]# df
Filesystem     1K-blocks     Used Available Use% Mounted on
/dev/sda2      104806400  4233244 100573156   5% /
devtmpfs          998216        0    998216   0% /dev
tmpfs            1014056        0   1014056   0% /dev/shm
tmpfs            1014056    10452   1003604   2% /run
tmpfs            1014056        0   1014056   0% /sys/fs/cgroup
/dev/sr0        10491772 10491772         0 100% /misc/cd
/dev/sda1        1038336   167036    871300  17% /boot
/dev/sda3       52403200    32992  52370208   1% /data
tmpfs             202812        0    202812   0% /run/user/0
tmpfs             202812       12    202800   1% /run/user/42
[root@centos7 ~]# umount /data    (確定這個磁區沒有需要的資料了取消掛載)
  • 改為邏輯卷標識
[root@centos7 ~]# fdisk /dev/sda  
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p

Disk /dev/sda: 214.7 GB, 214748364800 bytes, 419430400 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000a8280

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     2099199     1048576   83  Linux
/dev/sda2         2099200   211814399   104857600   83  Linux
/dev/sda3       211814400   316671999    52428800   83  Linux
/dev/sda4       316672000   419430399    51379200    5  Extended
/dev/sda5       316674048   325062655     4194304   82  Linux swap / Solaris

Command (m for help): t
Partition number (1-5, default 5): 3
Hex code (type L to list all codes): 8e
Changed type of partition 'Linux' to 'Linux LVM'

Command (m for help): p

Disk /dev/sda: 214.7 GB, 214748364800 bytes, 419430400 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000a8280

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     2099199     1048576   83  Linux
/dev/sda2         2099200   211814399   104857600   83  Linux
/dev/sda3       211814400   316671999    52428800   8e  Linux LVM
/dev/sda4       316672000   419430399    51379200    5  Extended
/dev/sda5       316674048   325062655     4194304   82  Linux swap / Solaris

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
  • 使用partprobe同步一下磁區
[root@centos7 ~]# lsblk 
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda      8:0    0  200G  0 disk 
├─sda1   8:1    0    1G  0 part /boot
├─sda2   8:2    0  100G  0 part /
├─sda3   8:3    0   50G  0 part 
├─sda4   8:4    0    1K  0 part 
└─sda5   8:5    0    4G  0 part [SWAP]
sr0     11:0    1   10G  0 rom  /misc/cd
[root@centos7 ~]# partprobe    
Warning: Unable to open /dev/sr0 read-write (Read-only file system).  /dev/sr0 has been opened read-only.
  • 更改為物理卷
[root@centos7 ~]# pvcreate /dev/sda3
WARNING: xfs signature detected on /dev/sda3 at offset 0. Wipe it? [y/n]: y
  Wiping xfs signature on /dev/sda3.
  Physical volume "/dev/sda3" successfully created.
[root@centos7 ~]# pvs
  PV         VG Fmt  Attr PSize  PFree 
  /dev/sda3     lvm2 ---  50.00g 50.00g

  • 把物理卷加為卷組并起個名字
[root@centos7 ~]# vgcreate vg_data /dev/sda3
  Volume group "vg_data" successfully created
[root@centos7 ~]# vgs
  VG      #PV #LV #SN Attr   VSize   VFree  
  vg_data   1   0   0 wz--n- <50.00g <50.00g
  • 創建邏輯卷為MySQL并設定為40G空間(空行之后的都是示例防止你們設錯空間忘了怎么刪!)
[root@centos7 ~]# lvcreate -n mysql -L 40G  vg_data
  Logical volume "mysql" created.
[root@centos7 ~]# lvs
  LV    VG      Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  mysql vg_data -wi-a----- 40.00g                                                    

[root@centos7 ~]# lvremove /dev/vg_data/mysql 
Do you really want to remove active logical volume vg_data/mysql? [y/n]: y
  Logical volume "mysql" successfully removed
[root@centos7 ~]# lvcreate -n mysql -l 100%free  vg_data  (這里是把所有的剩余空間都設為邏輯卷)
  Logical volume "mysql" created.
[root@centos7 ~]# lvs
  LV    VG      Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  mysql vg_data -wi-a----- <50.00g  
  • 格式化磁區并創建檔案系統
[root@centos7 ~]# mkfs.xfs /dev/vg_data/mysql
meta-data=https://www.cnblogs.com/dev/vg_data/mysql     isize=512    agcount=4, agsize=3276544 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=0, sparse=0
data     =                       bsize=4096   blocks=13106176, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal log           bsize=4096   blocks=6399, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
  • 掛載磁區并永久保存(更改/data那一行)
[root@centos7 ~]# lsblk -f   (注意使用邏輯卷對應的UUID)
NAME              FSTYPE      LABEL           UUID                                   MOUNTPOINT
sda                                                                                  
├─sda1            xfs                         0f7c8887-58c8-4c16-98d4-32cf5635006a   /boot
├─sda2            xfs                         71131d8c-e6d0-4104-b270-dcb8d5ae959a   /
├─sda3            LVM2_member                 IRcHvr-fkfh-eutS-0de9-RGsJ-4pi3-mGKmJd 
│ └─vg_data-mysql xfs                         7d3d4b4d-66c1-43d7-8d33-9de94d6b812d   /mnt
├─sda4                                                                               
└─sda5            swap                        045c4250-e51f-4af0-a2f5-6c248700e1fb   [SWAP]
sr0               iso9660     CentOS 7 x86_64 2018-11-26-14-22-58-00                 /misc/cd
[root@centos7 ~]# vim /etc/fstab
UUID=7d3d4b4d-66c1-43d7-8d33-9de94d6b812d /data                   xfs     defaults        0 0
[root@centos7 ~]# mount -a  (重新讀取組態檔進行掛載)
[root@centos7 ~]# lsblk 
NAME              MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda                 8:0    0  200G  0 disk 
├─sda1              8:1    0    1G  0 part /boot
├─sda2              8:2    0  100G  0 part /
├─sda3              8:3    0   50G  0 part 
│ └─vg_data-mysql 253:0    0   50G  0 lvm  /data
├─sda4              8:4    0    1K  0 part 
└─sda5              8:5    0    4G  0 part [SWAP]
sr0                11:0    1   10G  0 rom  /misc/cd
  1. 準備二進制程式包(我是從服務器傳下來的沒有的可以去官網下載,放在哪個目錄都可以,)
[root@centos7 ~]# rz -E
rz waiting to receive.
[root@centos7 ~]# ls
anaconda-ks.cfg  Downloads                                    Music     Templates
Desktop          initial-setup-ks.cfg                         Pictures  Videos
Documents        mariadb-10.2.29-linux-systemd-x86_64.tar.gz  Public

實驗階段:

  • 確認系統上沒有資料庫檔案
[root@centos7 ~]# rpm -qa mariadb*
  • 創建檔案夾和創建用戶并讓他有讀、執行權限,
[root@centos7 ~]# mkdir /data/mysql
[root@centos7 ~]# useradd -r -s /sbin/nologin -d /data/mysql mysql
[root@centos7 ~]# ll /data
total 0
drwxr-xr-x 2 root root 6 Nov 19 16:12 mysql
  • 程式包解壓到/usr/local/目錄下
[root@centos7 ~]# tar xvf mariadb-10.2.29-linux-systemd-x86_64.tar.gz -C /usr/local/
  • 更改用戶和所屬組(先把MariaDB目錄做成軟連接)
[root@centos7 ~]# ll /usr/local/
total 0
drwxr-xr-x.  2 root root   6 Apr 11  2018 bin
drwxr-xr-x.  2 root root   6 Apr 11  2018 etc
drwxr-xr-x.  2 root root   6 Apr 11  2018 games
drwxr-xr-x.  2 root root   6 Apr 11  2018 include
drwxr-xr-x.  2 root root   6 Apr 11  2018 lib
drwxr-xr-x.  2 root root   6 Apr 11  2018 lib64
drwxr-xr-x.  2 root root   6 Apr 11  2018 libexec
drwxrwxr-x  13 yang yang 294 Nov  8 01:21 mariadb-10.2.29-linux-systemd-x86_64
drwxr-xr-x.  2 root root   6 Apr 11  2018 sbin
drwxr-xr-x.  5 root root  49 Sep  5 16:17 share
drwxr-xr-x.  2 root root   6 Apr 11  2018 src
[root@centos7 local]# ln -s mariadb-10.2.29-linux-systemd-x86_64/ mysql
[root@centos7 local]# chown -R root.root mysql/
[root@centos7 local]# ll 
total 0
drwxr-xr-x.  2 root root   6 Apr 11  2018 bin
drwxr-xr-x.  2 root root   6 Apr 11  2018 etc
drwxr-xr-x.  2 root root   6 Apr 11  2018 games
drwxr-xr-x.  2 root root   6 Apr 11  2018 include
drwxr-xr-x.  2 root root   6 Apr 11  2018 lib
drwxr-xr-x.  2 root root   6 Apr 11  2018 lib64
drwxr-xr-x.  2 root root   6 Apr 11  2018 libexec
drwxrwxr-x  13 root root 294 Nov  8 01:21 mariadb-10.2.29-linux-systemd-x86_64
lrwxrwxrwx   1 root root  37 Nov 19 16:22 mysql -> mariadb-10.2.29-linux-systemd-x86_64/
drwxr-xr-x.  2 root root   6 Apr 11  2018 sbin
drwxr-xr-x.  5 root root  49 Sep  5 16:17 share
drwxr-xr-x.  2 root root   6 Apr 11  2018 src
  • 查看二進制檔案并把二進制檔案目錄加到PATH變數里以后使用方便不用寫絕對路徑
[root@centos7 local]# ls mysql/bin/
aria_chk                 mysqladmin                  mysqlshow
aria_dump_log            mysqlbinlog                 mysqlslap
aria_ftdump              mysqlcheck                  mysqltest
aria_pack                mysql_client_test           mysqltest_embedded
aria_read_log            mysql_client_test_embedded  mysql_tzinfo_to_sql
galera_new_cluster       mysql_config                mysql_upgrade
galera_recovery          mysql_convert_table_format  mysql_waitpid
garbd                    mysqld                      mytop
innochecksum             mysqld_multi                perror
mariabackup              mysqld_safe                 replace
mariadb_config           mysqld_safe_helper          resolveip
mariadb-service-convert  mysqldump                   resolve_stack_dump
mbstream                 mysqldumpslow               sst_dump
msql2mysql               mysql_embedded              tokuftdump
myisamchk                mysql_find_rows             tokuft_logprint
myisam_ftdump            mysql_fix_extensions        wsrep_sst_common
myisamlog                mysqlhotcopy                wsrep_sst_mariabackup
myisampack               mysqlimport                 wsrep_sst_mysqldump
my_print_defaults        mysql_ldb                   wsrep_sst_rsync
myrocks_hotbackup        mysql_plugin                wsrep_sst_rsync_wan
mysql                    mysql_secure_installation   wsrep_sst_xtrabackup
mysqlaccess              mysql_setpermission         wsrep_sst_xtrabackup-v2
[root@centos7 local]# echo 'PATh=/usr/local/mysql/bin:$PATH' > /etc/profile.d/mysql.sh
[root@centos7 local]# . /etc/profile.d/mysql.sh
[root@centos7 support-files]# echo $PATH   (使用這個命令檢查一下)
/usr/local/mysql/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
  • 準備組態檔(使用軟體包里自帶的組態檔稍加修改使用就可以了)
[root@centos7 local]# cd mysql/
[root@centos7 mysql]# ls
bin      data               include         man         README-wsrep  sql-bench
COPYING  docs               INSTALL-BINARY  mysql-test  scripts       support-files
CREDITS  EXCEPTIONS-CLIENT  lib             README.md   share         THIRDPARTY
[root@centos7 mysql]# ls support-files/  
binary-configure  my-innodb-heavy-4G.cnf  my-small.cnf         mysql.server  wsrep.cnf
magic             my-large.cnf            mysqld_multi.server  policy        wsrep_notify
my-huge.cnf       my-medium.cnf           mysql-log-rotate     systemd
[root@centos7 mysql]# less support-files/my-huge.cnf  (查看一下檔案選擇一個合適的記憶體大小,這個是最大的 1G-2G) 
[root@centos7 mysql]# 
[root@centos7 mysql]# cp -b support-files/my-huge.cnf /etc/my.cnf
cp: overwrite ‘/etc/my.cnf’? y    (把這個檔案拷貝到組態檔目錄下并備份原有檔案)

修改組態檔
[root@centos7 mysql]# vim /etc/my.cnf

# The MySQL server
[mysqld]
datadir=/data/mysql   (加入這一行指定路徑就可以了)
  • 使用軟體包自帶腳本生成資料庫
[root@centos7 mysql]# cd scripts/
[root@centos7 scripts]# ls
mysql_install_db
[root@centos7 scripts]# pwd
/usr/local/mysql/scripts

這里要注意一下要是你要寫相對路徑必須在scripts目錄下執行,要不就寫成絕對路徑,
[root@centos7 scripts]# /usr/local/mysql/scripts/mysql_install_db --datadir=/data/mysql --user=mysql
Installing MariaDB/MySQL system tables in '/data/mysql' ...
2019-11-19 16:41:29 140185403569984 [Warning] 'THREAD_CONCURRENCY' is deprecated and will be removed in a future release.
2019-11-19 16:41:29 140185402984192 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1146: Table 'mysql.gtid_slave_pos' doesn't exist
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system


PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following commands:

'/usr/local/mysql/bin/mysqladmin' -u root password 'new-password'
'/usr/local/mysql/bin/mysqladmin' -u root -h centos7.localdomain password 'new-password'

Alternatively you can run:
'/usr/local/mysql/bin/mysql_secure_installation'

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the MariaDB Knowledgebase at http://mariadb.com/kb or the
MySQL manual for more instructions.

You can start the MariaDB daemon with:
cd '/usr/local/mysql' ; /usr/local/mysql/bin/mysqld_safe --datadir='/data/mysql'

You can test the MariaDB daemon with mysql-test-run.pl
cd '/usr/local/mysql/mysql-test' ; perl mysql-test-run.pl

Please report any problems at http://mariadb.org/jira

The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/

[root@centos7 scripts]# ll /data/mysql/    (查看資料庫生成檔案)
total 110660
-rw-rw---- 1 mysql mysql    16384 Nov 19 16:41 aria_log.00000001
-rw-rw---- 1 mysql mysql       52 Nov 19 16:41 aria_log_control
-rw-rw---- 1 mysql mysql      938 Nov 19 16:41 ib_buffer_pool
-rw-rw---- 1 mysql mysql 12582912 Nov 19 16:41 ibdata1
-rw-rw---- 1 mysql mysql 50331648 Nov 19 16:41 ib_logfile0
-rw-rw---- 1 mysql mysql 50331648 Nov 19 16:41 ib_logfile1
drwx------ 2 mysql mysql     4096 Nov 19 16:41 mysql
-rw-rw---- 1 mysql mysql    29310 Nov 19 16:41 mysql-bin.000001
-rw-rw---- 1 mysql mysql       19 Nov 19 16:41 mysql-bin.index
-rw-rw---- 1 mysql mysql        7 Nov 19 16:41 mysql-bin.state
drwx------ 2 mysql mysql       20 Nov 19 16:41 performance_schema
drwx------ 2 mysql mysql       20 Nov 19 16:41 test
  • 設定啟動相關檔案
[root@centos7 support-files]# cp /usr/local/mysql/support-files/systemd/mariadb.service /usr/lib/systemd/system/
[root@centos7 support-files]# ll /usr/lib/systemd/system/ |grep mariadb
-rw-r--r--  1 root root 5231 Nov 19 16:45 mariadb.service


centos6 的話可以使用mysql.server
[root@centos7 support-files]# ls
binary-configure  my-innodb-heavy-4G.cnf  my-small.cnf         mysql.server  wsrep.cnf
magic             my-large.cnf            mysqld_multi.server  policy        wsrep_notify
my-huge.cnf       my-medium.cnf           mysql-log-rotate     systemd
[root@centos7 support-files]# cp mysql.server /etc/init.d/mysqld
[root@centos7 support-files]# chkconfig --list mysqld

Note: This output shows SysV services only and does not include native
      systemd services. SysV configuration data might be overridden by native
      systemd configuration.

      If you want to list systemd services use 'systemctl list-unit-files'.
      To see services enabled on particular target use
      'systemctl list-dependencies [target]'.

error reading information on service mysqld: No such file or direct
[root@centos7 support-files]# chkconfig --add mysqld  (把mysql注冊為服務之后可以使用server來管理)
[root@centos7 support-files]# chkconfig --list mysqld  (在使用chkconfig查看你服務)
  • 再查看一下檔案確保設定的路徑正確,就可以啟動服務了,
[root@centos7 support-files]# vim /usr/lib/systemd/system/mariadb.service 
[root@centos7 support-files]# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 9
Server version: 10.2.29-MariaDB-log MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> 
MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| test               |
+--------------------+
4 rows in set (0.00 sec)

MariaDB [(none)]> 
(已經可以正常使用了但是密碼沒有設定誰都可以登錄重新設定一下密碼)
  • 跑一遍安全加固腳本(這也是軟體包自帶的)
(安全加固腳本路徑)
[root@centos7 support-files]# which mysql_secure_installation 
/usr/local/mysql/bin/mysql_secure_installation
[root@centos7 support-files]# mysql_secure_installation 

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):   (輸入當前密碼,回車不輸入任何字符)
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y (是否要設定密碼輸y)
New password: 
Re-enter new password: (輸入兩遍密碼)
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y   (是否洗掉默認用戶,輸入y)
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y   (不允許root遠程登錄,輸入y安全考慮)
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y  (是否洗掉測驗資料庫test,生產中用不到刪掉y)
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y  (是否重新加載特權表,輸入y)
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

(直接使用mysql不可以登陸了)
[root@centos7 support-files]# mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
[root@centos7 support-files]# mysql -p123456  (-p輸入密碼登錄,注意:-p后不要加空格)
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 19
Server version: 10.2.29-MariaDB-log MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> exit
Bye
[root@centos7 support-files]# mysql -uroot -p123456  (上面登錄不寫用戶的話默認就為root登錄既管理員)注意:這里的root不是作業系統的root他只是針對于MySQL資料庫的root用戶不要搞混了,
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 20
Server version: 10.2.29-MariaDB-log MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> exit
Bye

轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/154774.html

標籤:Linux

上一篇:Linux系統學習 三、網路基礎—虛擬機網路配置

下一篇:MySQL多實體安裝教程

標籤雲
其他(157675) Python(38076) JavaScript(25376) Java(17977) C(15215) 區塊鏈(8255) C#(7972) AI(7469) 爪哇(7425) MySQL(7132) html(6777) 基礎類(6313) sql(6102) 熊猫(6058) PHP(5869) 数组(5741) R(5409) Linux(5327) 反应(5209) 腳本語言(PerlPython)(5129) 非技術區(4971) Android(4554) 数据框(4311) css(4259) 节点.js(4032) C語言(3288) json(3245) 列表(3129) 扑(3119) C++語言(3117) 安卓(2998) 打字稿(2995) VBA(2789) Java相關(2746) 疑難問題(2699) 细绳(2522) 單片機工控(2479) iOS(2429) ASP.NET(2402) MongoDB(2323) 麻木的(2285) 正则表达式(2254) 字典(2211) 循环(2198) 迅速(2185) 擅长(2169) 镖(2155) 功能(1967) .NET技术(1958) Web開發(1951) python-3.x(1918) HtmlCss(1915) 弹簧靴(1913) C++(1909) xml(1889) PostgreSQL(1872) .NETCore(1853) 谷歌表格(1846) Unity3D(1843) for循环(1842)

熱門瀏覽
  • CA和證書

    1、在 CentOS7 中使用 gpg 創建 RSA 非對稱密鑰對 gpg --gen-key #Centos上生成公鑰/密鑰對(存放在家目錄.gnupg/) 2、將 CentOS7 匯出的公鑰,拷貝到 CentOS8 中,在 CentOS8 中使用 CentOS7 的公鑰加密一個檔案 gpg -a ......

    uj5u.com 2020-09-10 00:09:53 more
  • Kubernetes K8S之資源控制器Job和CronJob詳解

    Kubernetes的資源控制器Job和CronJob詳解與示例 ......

    uj5u.com 2020-09-10 00:10:45 more
  • VMware下安裝CentOS

    VMware下安裝CentOS 一、軟硬體準備 1 Centos鏡像準備 1.1 CentOS鏡像下載地址 下載地址 1.2 CentOS鏡像下載程序 點擊下載地址進入如下圖的網站,選擇需要下載的版本,這里選擇的是Centos8,點擊如圖所示。 決定選擇Centos8后,選擇想要的鏡像源進行下載,此 ......

    uj5u.com 2020-09-10 00:12:10 more
  • 如何使用Grep命令查找多個字串

    如何使用Grep 命令查找多個字串 大家好,我是良許! 今天向大家介紹一個非常有用的技巧,那就是使用 grep 命令查找多個字串。 簡單介紹一下,grep 命令可以理解為是一個功能強大的命令列工具,可以用它在一個或多個輸入檔案中搜索與正則運算式相匹配的文本,然后再將每個匹配的文本用標準輸出的格式 ......

    uj5u.com 2020-09-10 00:12:28 more
  • git配置http代理

    git配置http代理 經常遇到克隆 github 慢的問題,這里記錄一下幾種配置 git 代理的方法,解決 clone github 過慢。 目錄 git配置代理 git單獨配置github代理 git配置全域代理 配置終端環境變數 git配置代理 主要使用 git config 命令 git單獨 ......

    uj5u.com 2020-09-10 00:12:33 more
  • Linux npm install 裝包時提示Error EACCES permission denied解

    npm install 裝包時提示Error EACCES permission denied解決辦法 ......

    uj5u.com 2020-09-10 00:12:53 more
  • Centos 7下安裝nginx,使用yum install nginx,提示沒有可用的軟體包

    Centos 7下安裝nginx,使用yum install nginx,提示沒有可用的軟體包。 18 (flaskApi) [root@67 flaskDemo]# yum -y install nginx 19 已加載插件:fastestmirror, langpacks 20 Loading ......

    uj5u.com 2020-09-10 00:13:13 more
  • Linux查看服務器暴力破解ssh IP

    在公網的服務器上經常遇到別人爆破你服務器的22埠,用來挖礦或者干其他嘿嘿嘿的事情~ 這種情況下正確的做法是: 修改默認ssh的22埠 使用設定密鑰登錄或者白名單ip登錄 建議服務器密碼為復雜密碼 創建普通用戶登錄服務器(root權限過大) 建立堡壘機,實作統一管理服務器 統計爆破IP [root ......

    uj5u.com 2020-09-10 00:13:17 more
  • CentOS 7系統常見快捷鍵操作方式

    Linux系統中一些常見的快捷方式,可有效提高操作效率,在某些時刻也能避免操作失誤帶來的問題。 ......

    uj5u.com 2020-09-10 00:13:31 more
  • CentOS 7作業系統目錄結構介紹

    作業系統存在著大量的資料檔案資訊,相應檔案資訊會存在于系統相應目錄中,為了更好的管理資料資訊,會將系統進行一些目錄規劃,不同目錄存放不同的資源。 ......

    uj5u.com 2020-09-10 00:13:35 more
最新发布
  • vim的常用命令

    Vim的6種基本模式 1. 普通模式在普通模式中,用的編輯器命令,比如移動游標,洗掉文本等等。這也是Vim啟動后的默認模式。這正好和許多新用戶期待的操作方式相反(大多數編輯器默認模式為插入模式)。 2. 插入模式在這個模式中,大多數按鍵都會向文本緩沖中插入文本。大多數新用戶希望文本編輯器編輯程序中一 ......

    uj5u.com 2023-04-20 08:43:21 more
  • vim的常用命令

    Vim的6種基本模式 1. 普通模式在普通模式中,用的編輯器命令,比如移動游標,洗掉文本等等。這也是Vim啟動后的默認模式。這正好和許多新用戶期待的操作方式相反(大多數編輯器默認模式為插入模式)。 2. 插入模式在這個模式中,大多數按鍵都會向文本緩沖中插入文本。大多數新用戶希望文本編輯器編輯程序中一 ......

    uj5u.com 2023-04-20 08:42:36 more
  • docker學習

    ###Docker概述 真實專案部署環境可能非常復雜,傳統發布專案一個只需要一個jar包,運行環境需要單獨部署。而通過Docker可將jar包和相關環境(如jdk,redis,Hadoop...)等打包到docker鏡像里,將鏡像發布到Docker倉庫,部署時下載發布的鏡像,直接運行發布的鏡像即可。 ......

    uj5u.com 2023-04-19 09:26:53 more
  • 設定Windows主機的瀏覽器為wls2的默認瀏覽器

    這里以Chrome為例。 1. 準備作業 wsl是可以使用Windows主機上安裝的exe程式,出于安全考慮,默認情況下改功能是無法使用。要使用的話,終端需要以管理員權限啟動。 我這里以Windows Terminal為例,介紹如何默認使用管理員權限打開終端,具體操作如下圖所示: 2. 操作 wsl ......

    uj5u.com 2023-04-19 09:25:49 more
  • docker學習

    ###Docker概述 真實專案部署環境可能非常復雜,傳統發布專案一個只需要一個jar包,運行環境需要單獨部署。而通過Docker可將jar包和相關環境(如jdk,redis,Hadoop...)等打包到docker鏡像里,將鏡像發布到Docker倉庫,部署時下載發布的鏡像,直接運行發布的鏡像即可。 ......

    uj5u.com 2023-04-19 09:19:04 more
  • Linux學習筆記

    IP地址和主機名 IP地址 ifconfig可以用來查詢本機的IP地址,如果不能使用,可以通過install net-tools安裝。 Centos系統下ens33表示主網卡;inet后表示IP地址;lo表示本地回環網卡; 127.0.0.1表示代指本機;0.0.0.0可以用于代指本機,同時在放行設 ......

    uj5u.com 2023-04-18 06:52:01 more
  • 解決linux系統的kdump服務無法啟動的問題

    問題:專案麒麟系統服務器的kdump服務無法啟動,沒有相關日志無法定位問題。 1、查看服務狀態是關閉的,重啟系統也無法啟動 systemctl status kdump 2、修改grub引數,修改“crashkernel”為“512M(有的機器數值太大太小都會導致報錯,建議從128M開始試,或者加個 ......

    uj5u.com 2023-04-12 09:59:50 more
  • 解決linux系統的kdump服務無法啟動的問題

    問題:專案麒麟系統服務器的kdump服務無法啟動,沒有相關日志無法定位問題。 1、查看服務狀態是關閉的,重啟系統也無法啟動 systemctl status kdump 2、修改grub引數,修改“crashkernel”為“512M(有的機器數值太大太小都會導致報錯,建議從128M開始試,或者加個 ......

    uj5u.com 2023-04-12 09:59:01 more
  • 你是不是暴露了?

    作者:袁首京 原創文章,轉載時請保留此宣告,并給出原文連接。 如果您是計算機相關從業人員,那么應該經歷不止一次網路安全專項檢查了,你肯定是收到過資訊系統技術檢測報告,要求你加強風險監測,確保你提供的系統服務堅實可靠了。 沒檢測到問題還好,檢測到問題的話,有些處理起來還是挺麻煩的,尤其是線上正在運行的 ......

    uj5u.com 2023-04-05 16:52:56 more
  • 細節拉滿,80 張圖帶你一步一步推演 slab 記憶體池的設計與實作

    1. 前文回顧 在之前的幾篇記憶體管理系列文章中,筆者帶大家從宏觀角度完整地梳理了一遍 Linux 記憶體分配的整個鏈路,本文的主題依然是記憶體分配,這一次我們會從微觀的角度來探秘一下 Linux 內核中用于零散小記憶體塊分配的記憶體池 —— slab 分配器。 在本小節中,筆者還是按照以往的風格先帶大家簡單 ......

    uj5u.com 2023-04-05 16:44:11 more