当前位置: 首页 > news >正文

学生网站建设总结报告制作广告公司宣传片

学生网站建设总结报告,制作广告公司宣传片,征婚网站上拉业务做恒指期货,万能网站浏览器记录一下在Ubuntu20.04 64位系统下面使用apt-get方式安装mysql8关系型数据库 Centos下使用yum安装Mysql8#xff08;Mysql5.7#xff09;以及常见的配置和使用 首先肯定是检查下当前Ubuntu系统是否已经安装过mysql数据库 一般拿到新的云服务器是没有安装的 rootmyw:~# whe…记录一下在Ubuntu20.04 64位系统下面使用apt-get方式安装mysql8关系型数据库 Centos下使用yum安装Mysql8Mysql5.7以及常见的配置和使用 首先肯定是检查下当前Ubuntu系统是否已经安装过mysql数据库 一般拿到新的云服务器是没有安装的 rootmyw:~# whereis mysql mysql: rootmyw:~# find / -name mysql* /etc/apparmor.d/abstractions/mysql /usr/lib/python3/dist-packages/sos/report/plugins/__pycache__/mysql.cpython-38.pyc /usr/lib/python3/dist-packages/sos/report/plugins/mysql.py /usr/share/bash-completion/completions/mysqladmin /usr/share/bash-completion/completions/mysql /usr/share/vim/vim81/syntax/mysql.vim rootmyw:~# Ubuntu系统和centos所用的依赖包管理器不一样 Ubuntu用的是apt包管理器 centos用的是yum包管理器 那么这里使用apt-get来安装mysql 为了能够安装高版本的mysql 我这里首先是更新apt-get 更新之后去安装mysql 发现mysql安装好后是8.x版本 对于使用8.x版本来说这是一个很欣喜的消息 更新apt-get系统软件库 apt-get updaterootmyw:~# apt-get update Get:1 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB] Hit:2 http://archive.ubuntu.com/ubuntu focal InRelease Get:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB] Get:4 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [2,464 kB] Get:5 http://archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB] Get:6 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [2,850 kB] Get:7 http://security.ubuntu.com/ubuntu focal-security/main Translation-en [385 kB] Get:8 http://security.ubuntu.com/ubuntu focal-security/main amd64 c-n-f Metadata [13.2 kB] Get:9 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [2,210 kB] Get:10 http://security.ubuntu.com/ubuntu focal-security/restricted Translation-en [309 kB] Get:11 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 c-n-f Metadata [580 B] Get:12 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [885 kB] Get:13 http://security.ubuntu.com/ubuntu focal-security/universe Translation-en [185 kB] Get:14 http://security.ubuntu.com/ubuntu focal-security/universe amd64 c-n-f Metadata [19.1 kB] Get:15 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 Packages [23.6 kB] Get:16 http://security.ubuntu.com/ubuntu focal-security/multiverse Translation-en [5,504 B] Get:17 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 c-n-f Metadata [548 B] Get:18 http://archive.ubuntu.com/ubuntu focal-updates/main Translation-en [468 kB] Get:19 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 c-n-f Metadata [17.1 kB] Get:20 http://archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [2,327 kB] Get:21 http://archive.ubuntu.com/ubuntu focal-updates/restricted Translation-en [325 kB] Get:22 http://archive.ubuntu.com/ubuntu focal-updates/restricted amd64 c-n-f Metadata [576 B] Get:23 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [1,117 kB] Get:24 http://archive.ubuntu.com/ubuntu focal-updates/universe Translation-en [267 kB] Get:25 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 c-n-f Metadata [25.6 kB] Get:26 http://archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 Packages [25.8 kB] Get:27 http://archive.ubuntu.com/ubuntu focal-updates/multiverse Translation-en [7,484 B] Get:28 http://archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 c-n-f Metadata [620 B] Get:29 http://archive.ubuntu.com/ubuntu focal-backports/main amd64 Packages [45.7 kB] Get:30 http://archive.ubuntu.com/ubuntu focal-backports/main Translation-en [16.3 kB] Get:31 http://archive.ubuntu.com/ubuntu focal-backports/main amd64 c-n-f Metadata [1,420 B] Get:32 http://archive.ubuntu.com/ubuntu focal-backports/universe amd64 Packages [25.0 kB] Get:33 http://archive.ubuntu.com/ubuntu focal-backports/universe Translation-en [16.3 kB] Get:34 http://archive.ubuntu.com/ubuntu focal-backports/universe amd64 c-n-f Metadata [880 B] Fetched 14.4 MB in 6s (2,221 kB/s) Reading package lists... Done rootmyw:~# 直接安装mysql apt-get install mysql-server -yrootmyw:~# apt-get install mysql-server -y Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed:libcgi-fast-perl libcgi-pm-perl libencode-locale-perl libevent-core-2.1-7 libevent-pthreads-2.1-7 libfcgi-perl libhtml-parser-perl libhtml-tagset-perl libhtml-template-perl libhttp-date-perl libhttp-message-perl libio-html-perlliblwp-mediatypes-perl libmecab2 libtimedate-perl liburi-perl mecab-ipadic mecab-ipadic-utf8 mecab-utils mysql-client-8.0 mysql-client-core-8.0 mysql-common mysql-server-8.0 mysql-server-core-8.0 Suggested packages:libdata-dump-perl libipc-sharedcache-perl libwww-perl mailx tinyca The following NEW packages will be installed:libcgi-fast-perl libcgi-pm-perl libencode-locale-perl libevent-core-2.1-7 libevent-pthreads-2.1-7 libfcgi-perl libhtml-parser-perl libhtml-tagset-perl libhtml-template-perl libhttp-date-perl libhttp-message-perl libio-html-perlliblwp-mediatypes-perl libmecab2 libtimedate-perl liburi-perl mecab-ipadic mecab-ipadic-utf8 mecab-utils mysql-client-8.0 mysql-client-core-8.0 mysql-common mysql-server mysql-server-8.0 mysql-server-core-8.0 0 upgraded, 25 newly installed, 0 to remove and 271 not upgraded. Need to get 36.7 MB of archives. After this operation, 318 MB of additional disk space will be used. Get:1 http://archive.ubuntu.com/ubuntu focal/main amd64 mysql-common all 5.81.0.5ubuntu2 [7,496 B] Get:2 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 mysql-client-core-8.0 amd64 8.0.34-0ubuntu0.20.04.1 [5,075 kB] Get:3 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 mysql-client-8.0 amd64 8.0.34-0ubuntu0.20.04.1 [22.0 kB] Get:4 http://archive.ubuntu.com/ubuntu focal/main amd64 libevent-core-2.1-7 amd64 2.1.11-stable-1 [89.1 kB] Get:5 http://archive.ubuntu.com/ubuntu focal/main amd64 libevent-pthreads-2.1-7 amd64 2.1.11-stable-1 [7,372 B] Get:6 http://archive.ubuntu.com/ubuntu focal/main amd64 libmecab2 amd64 0.996-10build1 [233 kB] Get:7 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 mysql-server-core-8.0 amd64 8.0.34-0ubuntu0.20.04.1 [22.6 MB] Get:8 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 mysql-server-8.0 amd64 8.0.34-0ubuntu0.20.04.1 [1,325 kB] Get:9 http://archive.ubuntu.com/ubuntu focal/main amd64 libhtml-tagset-perl all 3.20-4 [12.5 kB] Get:10 http://archive.ubuntu.com/ubuntu focal/main amd64 liburi-perl all 1.76-2 [77.5 kB] Get:11 http://archive.ubuntu.com/ubuntu focal/main amd64 libhtml-parser-perl amd64 3.72-5 [86.3 kB] Get:12 http://archive.ubuntu.com/ubuntu focal/main amd64 libcgi-pm-perl all 4.46-1 [186 kB] Get:13 http://archive.ubuntu.com/ubuntu focal/main amd64 libfcgi-perl amd64 0.79-1 [33.1 kB] Get:14 http://archive.ubuntu.com/ubuntu focal/main amd64 libcgi-fast-perl all 1:2.15-1 [10.5 kB] Get:15 http://archive.ubuntu.com/ubuntu focal/main amd64 libencode-locale-perl all 1.05-1 [12.3 kB] Get:16 http://archive.ubuntu.com/ubuntu focal/main amd64 libhtml-template-perl all 2.97-1 [59.0 kB] Get:17 http://archive.ubuntu.com/ubuntu focal/main amd64 libtimedate-perl all 2.3200-1 [34.0 kB] Get:18 http://archive.ubuntu.com/ubuntu focal/main amd64 libhttp-date-perl all 6.05-1 [9,920 B] Get:19 http://archive.ubuntu.com/ubuntu focal/main amd64 libio-html-perl all 1.001-1 [14.9 kB] Get:20 http://archive.ubuntu.com/ubuntu focal/main amd64 liblwp-mediatypes-perl all 6.04-1 [19.5 kB] Get:21 http://archive.ubuntu.com/ubuntu focal/main amd64 libhttp-message-perl all 6.22-1 [76.1 kB] Get:22 http://archive.ubuntu.com/ubuntu focal/main amd64 mecab-utils amd64 0.996-10build1 [4,912 B] Get:23 http://archive.ubuntu.com/ubuntu focal/main amd64 mecab-ipadic all 2.7.0-20070801main-2.1 [6,714 kB] Get:24 http://archive.ubuntu.com/ubuntu focal/main amd64 mecab-ipadic-utf8 all 2.7.0-20070801main-2.1 [4,380 B] Get:25 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 mysql-server all 8.0.34-0ubuntu0.20.04.1 [9,468 B] Fetched 36.7 MB in 12s (3,130 kB/s) Preconfiguring packages ... Selecting previously unselected package mysql-common. (Reading database ... 72145 files and directories currently installed.) Preparing to unpack .../0-mysql-common_5.81.0.5ubuntu2_all.deb ... Unpacking mysql-common (5.81.0.5ubuntu2) ... Selecting previously unselected package mysql-client-core-8.0. Preparing to unpack .../1-mysql-client-core-8.0_8.0.34-0ubuntu0.20.04.1_amd64.deb ... Unpacking mysql-client-core-8.0 (8.0.34-0ubuntu0.20.04.1) ... Selecting previously unselected package mysql-client-8.0. Preparing to unpack .../2-mysql-client-8.0_8.0.34-0ubuntu0.20.04.1_amd64.deb ... Unpacking mysql-client-8.0 (8.0.34-0ubuntu0.20.04.1) ... Selecting previously unselected package libevent-core-2.1-7:amd64. Preparing to unpack .../3-libevent-core-2.1-7_2.1.11-stable-1_amd64.deb ... Unpacking libevent-core-2.1-7:amd64 (2.1.11-stable-1) ... Selecting previously unselected package libevent-pthreads-2.1-7:amd64. Preparing to unpack .../4-libevent-pthreads-2.1-7_2.1.11-stable-1_amd64.deb ... Unpacking libevent-pthreads-2.1-7:amd64 (2.1.11-stable-1) ... Selecting previously unselected package libmecab2:amd64. Preparing to unpack .../5-libmecab2_0.996-10build1_amd64.deb ... Unpacking libmecab2:amd64 (0.996-10build1) ... Selecting previously unselected package mysql-server-core-8.0. Preparing to unpack .../6-mysql-server-core-8.0_8.0.34-0ubuntu0.20.04.1_amd64.deb ... Unpacking mysql-server-core-8.0 (8.0.34-0ubuntu0.20.04.1) ... Setting up mysql-common (5.81.0.5ubuntu2) ... update-alternatives: using /etc/mysql/my.cnf.fallback to provide /etc/mysql/my.cnf (my.cnf) in auto mode Selecting previously unselected package mysql-server-8.0. (Reading database ... 72361 files and directories currently installed.) Preparing to unpack .../00-mysql-server-8.0_8.0.34-0ubuntu0.20.04.1_amd64.deb ... Unpacking mysql-server-8.0 (8.0.34-0ubuntu0.20.04.1) ... Selecting previously unselected package libhtml-tagset-perl. Preparing to unpack .../01-libhtml-tagset-perl_3.20-4_all.deb ... Unpacking libhtml-tagset-perl (3.20-4) ... Selecting previously unselected package liburi-perl. Preparing to unpack .../02-liburi-perl_1.76-2_all.deb ... Unpacking liburi-perl (1.76-2) ... Selecting previously unselected package libhtml-parser-perl. Preparing to unpack .../03-libhtml-parser-perl_3.72-5_amd64.deb ... Unpacking libhtml-parser-perl (3.72-5) ... Selecting previously unselected package libcgi-pm-perl. Preparing to unpack .../04-libcgi-pm-perl_4.46-1_all.deb ... Unpacking libcgi-pm-perl (4.46-1) ... Selecting previously unselected package libfcgi-perl. Preparing to unpack .../05-libfcgi-perl_0.79-1_amd64.deb ... Unpacking libfcgi-perl (0.79-1) ... Selecting previously unselected package libcgi-fast-perl. Preparing to unpack .../06-libcgi-fast-perl_1%3a2.15-1_all.deb ... Unpacking libcgi-fast-perl (1:2.15-1) ... Selecting previously unselected package libencode-locale-perl. Preparing to unpack .../07-libencode-locale-perl_1.05-1_all.deb ... Unpacking libencode-locale-perl (1.05-1) ... Selecting previously unselected package libhtml-template-perl. Preparing to unpack .../08-libhtml-template-perl_2.97-1_all.deb ... Unpacking libhtml-template-perl (2.97-1) ... Selecting previously unselected package libtimedate-perl. Preparing to unpack .../09-libtimedate-perl_2.3200-1_all.deb ... Unpacking libtimedate-perl (2.3200-1) ... Selecting previously unselected package libhttp-date-perl. Preparing to unpack .../10-libhttp-date-perl_6.05-1_all.deb ... Unpacking libhttp-date-perl (6.05-1) ... Selecting previously unselected package libio-html-perl. Preparing to unpack .../11-libio-html-perl_1.001-1_all.deb ... Unpacking libio-html-perl (1.001-1) ... Selecting previously unselected package liblwp-mediatypes-perl. Preparing to unpack .../12-liblwp-mediatypes-perl_6.04-1_all.deb ... Unpacking liblwp-mediatypes-perl (6.04-1) ... Selecting previously unselected package libhttp-message-perl. Preparing to unpack .../13-libhttp-message-perl_6.22-1_all.deb ... Unpacking libhttp-message-perl (6.22-1) ... Selecting previously unselected package mecab-utils. Preparing to unpack .../14-mecab-utils_0.996-10build1_amd64.deb ... Unpacking mecab-utils (0.996-10build1) ... Selecting previously unselected package mecab-ipadic. Preparing to unpack .../15-mecab-ipadic_2.7.0-20070801main-2.1_all.deb ... Unpacking mecab-ipadic (2.7.0-20070801main-2.1) ... Selecting previously unselected package mecab-ipadic-utf8. Preparing to unpack .../16-mecab-ipadic-utf8_2.7.0-20070801main-2.1_all.deb ... Unpacking mecab-ipadic-utf8 (2.7.0-20070801main-2.1) ... Selecting previously unselected package mysql-server. Preparing to unpack .../17-mysql-server_8.0.34-0ubuntu0.20.04.1_all.deb ... Unpacking mysql-server (8.0.34-0ubuntu0.20.04.1) ... Setting up libmecab2:amd64 (0.996-10build1) ... Setting up mysql-client-core-8.0 (8.0.34-0ubuntu0.20.04.1) ... Setting up libhtml-tagset-perl (3.20-4) ... Setting up liblwp-mediatypes-perl (6.04-1) ... Setting up libencode-locale-perl (1.05-1) ... Setting up mecab-utils (0.996-10build1) ... Setting up libevent-core-2.1-7:amd64 (2.1.11-stable-1) ... Setting up libio-html-perl (1.001-1) ... Setting up libtimedate-perl (2.3200-1) ... Setting up mysql-client-8.0 (8.0.34-0ubuntu0.20.04.1) ... Setting up libfcgi-perl (0.79-1) ... Setting up liburi-perl (1.76-2) ... Setting up libevent-pthreads-2.1-7:amd64 (2.1.11-stable-1) ... Setting up libhttp-date-perl (6.05-1) ... Setting up mecab-ipadic (2.7.0-20070801main-2.1) ... Compiling IPA dictionary for Mecab. This takes long time... reading /usr/share/mecab/dic/ipadic/unk.def ... 40 emitting double-array: 100% |###########################################| /usr/share/mecab/dic/ipadic/model.def is not found. skipped. reading /usr/share/mecab/dic/ipadic/Noun.demonst.csv ... 120 reading /usr/share/mecab/dic/ipadic/Postp-col.csv ... 91 reading /usr/share/mecab/dic/ipadic/Noun.number.csv ... 42 reading /usr/share/mecab/dic/ipadic/Adj.csv ... 27210 reading /usr/share/mecab/dic/ipadic/Postp.csv ... 146 reading /usr/share/mecab/dic/ipadic/Noun.proper.csv ... 27328 reading /usr/share/mecab/dic/ipadic/Conjunction.csv ... 171 reading /usr/share/mecab/dic/ipadic/Auxil.csv ... 199 reading /usr/share/mecab/dic/ipadic/Adverb.csv ... 3032 reading /usr/share/mecab/dic/ipadic/Noun.others.csv ... 151 reading /usr/share/mecab/dic/ipadic/Suffix.csv ... 1393 reading /usr/share/mecab/dic/ipadic/Adnominal.csv ... 135 reading /usr/share/mecab/dic/ipadic/Filler.csv ... 19 reading /usr/share/mecab/dic/ipadic/Noun.place.csv ... 72999 reading /usr/share/mecab/dic/ipadic/Prefix.csv ... 221 reading /usr/share/mecab/dic/ipadic/Symbol.csv ... 208 reading /usr/share/mecab/dic/ipadic/Noun.adverbal.csv ... 795 reading /usr/share/mecab/dic/ipadic/Others.csv ... 2 reading /usr/share/mecab/dic/ipadic/Noun.name.csv ... 34202 reading /usr/share/mecab/dic/ipadic/Noun.adjv.csv ... 3328 reading /usr/share/mecab/dic/ipadic/Interjection.csv ... 252 reading /usr/share/mecab/dic/ipadic/Noun.org.csv ... 16668 reading /usr/share/mecab/dic/ipadic/Verb.csv ... 130750 reading /usr/share/mecab/dic/ipadic/Noun.nai.csv ... 42 reading /usr/share/mecab/dic/ipadic/Noun.verbal.csv ... 12146 reading /usr/share/mecab/dic/ipadic/Noun.csv ... 60477 emitting double-array: 100% |###########################################| reading /usr/share/mecab/dic/ipadic/matrix.def ... 1316x1316 emitting matrix : 100% |###########################################| done! update-alternatives: using /var/lib/mecab/dic/ipadic to provide /var/lib/mecab/dic/debian (mecab-dictionary) in auto mode Setting up mysql-server-core-8.0 (8.0.34-0ubuntu0.20.04.1) ... Setting up mecab-ipadic-utf8 (2.7.0-20070801main-2.1) ... Compiling IPA dictionary for Mecab. This takes long time... reading /usr/share/mecab/dic/ipadic/unk.def ... 40 emitting double-array: 100% |###########################################| /usr/share/mecab/dic/ipadic/model.def is not found. skipped. reading /usr/share/mecab/dic/ipadic/Noun.demonst.csv ... 120 reading /usr/share/mecab/dic/ipadic/Postp-col.csv ... 91 reading /usr/share/mecab/dic/ipadic/Noun.number.csv ... 42 reading /usr/share/mecab/dic/ipadic/Adj.csv ... 27210 reading /usr/share/mecab/dic/ipadic/Postp.csv ... 146 reading /usr/share/mecab/dic/ipadic/Noun.proper.csv ... 27328 reading /usr/share/mecab/dic/ipadic/Conjunction.csv ... 171 reading /usr/share/mecab/dic/ipadic/Auxil.csv ... 199 reading /usr/share/mecab/dic/ipadic/Adverb.csv ... 3032 reading /usr/share/mecab/dic/ipadic/Noun.others.csv ... 151 reading /usr/share/mecab/dic/ipadic/Suffix.csv ... 1393 reading /usr/share/mecab/dic/ipadic/Adnominal.csv ... 135 reading /usr/share/mecab/dic/ipadic/Filler.csv ... 19 reading /usr/share/mecab/dic/ipadic/Noun.place.csv ... 72999 reading /usr/share/mecab/dic/ipadic/Prefix.csv ... 221 reading /usr/share/mecab/dic/ipadic/Symbol.csv ... 208 reading /usr/share/mecab/dic/ipadic/Noun.adverbal.csv ... 795 reading /usr/share/mecab/dic/ipadic/Others.csv ... 2 reading /usr/share/mecab/dic/ipadic/Noun.name.csv ... 34202 reading /usr/share/mecab/dic/ipadic/Noun.adjv.csv ... 3328 reading /usr/share/mecab/dic/ipadic/Interjection.csv ... 252 reading /usr/share/mecab/dic/ipadic/Noun.org.csv ... 16668 reading /usr/share/mecab/dic/ipadic/Verb.csv ... 130750 reading /usr/share/mecab/dic/ipadic/Noun.nai.csv ... 42 reading /usr/share/mecab/dic/ipadic/Noun.verbal.csv ... 12146 reading /usr/share/mecab/dic/ipadic/Noun.csv ... 60477 emitting double-array: 100% |###########################################| reading /usr/share/mecab/dic/ipadic/matrix.def ... 1316x1316 emitting matrix : 100% |###########################################| done! update-alternatives: using /var/lib/mecab/dic/ipadic-utf8 to provide /var/lib/mecab/dic/debian (mecab-dictionary) in auto mode Setting up libhtml-parser-perl (3.72-5) ... Setting up libhttp-message-perl (6.22-1) ... Setting up mysql-server-8.0 (8.0.34-0ubuntu0.20.04.1) ... update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode Renaming removed key_buffer and myisam-recover options (if present) mysqld will log errors to /var/log/mysql/error.log mysqld is running as pid 19288 Created symlink /etc/systemd/system/multi-user.target.wants/mysql.service → /lib/systemd/system/mysql.service. insserv: warning: script S03denyhosts missing LSB tags and overrides insserv: warning: script denyhosts missing LSB tags and overrides Setting up libcgi-pm-perl (4.46-1) ... Setting up libhtml-template-perl (2.97-1) ... Setting up mysql-server (8.0.34-0ubuntu0.20.04.1) ... Setting up libcgi-fast-perl (1:2.15-1) ... Processing triggers for systemd (245.4-4ubuntu3.5) ... Processing triggers for man-db (2.9.1-1) ... Processing triggers for libc-bin (2.31-0ubuntu9.2) ... rootmyw:~# 从执行指令安装的这些信息来看 默认安装mysql后 默认是启动的看这条信息 mysqld will log errors to /var/log/mysql/error.log mysqld is running as pid 19288 这是一条很欣喜的是消息首先来确认下mysql的版本 8.0.x rootmyw:~# mysql -V mysql Ver 8.0.34-0ubuntu0.20.04.1 for Linux on x86_64 ((Ubuntu)) rootmyw:~# mysql --version mysql Ver 8.0.34-0ubuntu0.20.04.1 for Linux on x86_64 ((Ubuntu)) rootmyw:~# 确认下mysql是否启动 在这里使用指令发现缺少工具那么使用apt安装一下便可以 rootmyw:~# netstat -lnp|grep 3306Command netstat not found, but can be installed with:apt install net-toolsrootmyw:~# 执行 rootmyw:~# apt-get install net-tools Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed:net-tools 0 upgraded, 1 newly installed, 0 to remove and 271 not upgraded. Need to get 196 kB of archives. After this operation, 864 kB of additional disk space will be used. Get:1 http://archive.ubuntu.com/ubuntu focal/main amd64 net-tools amd64 1.60git20180626.aebd88e-1ubuntu1 [196 kB] Fetched 196 kB in 2s (110 kB/s) Selecting previously unselected package net-tools. (Reading database ... 72727 files and directories currently installed.) Preparing to unpack .../net-tools_1.60git20180626.aebd88e-1ubuntu1_amd64.deb ... Unpacking net-tools (1.60git20180626.aebd88e-1ubuntu1) ... Setting up net-tools (1.60git20180626.aebd88e-1ubuntu1) ... Processing triggers for man-db (2.9.1-1) ... rootmyw:~# 确认mysql是否运行 rootmyw:~# netstat -lnp|grep 3306 tcp 0 0 127.0.0.1:33060 0.0.0.0:* LISTEN 19601/mysqld tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 19601/mysqld rootmyw:~# netstat -lnp|grep mysql tcp 0 0 127.0.0.1:33060 0.0.0.0:* LISTEN 19601/mysqld tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 19601/mysqld unix 2 [ ACC ] STREAM LISTENING 163194 19601/mysqld /var/run/mysqld/mysqlx.sock unix 2 [ ACC ] STREAM LISTENING 162394 19601/mysqld /var/run/mysqld/mysqld.sock rootmyw:~# netstat -lnp|grep mysqld tcp 0 0 127.0.0.1:33060 0.0.0.0:* LISTEN 19601/mysqld tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 19601/mysqld unix 2 [ ACC ] STREAM LISTENING 163194 19601/mysqld /var/run/mysqld/mysqlx.sock unix 2 [ ACC ] STREAM LISTENING 162394 19601/mysqld /var/run/mysqld/mysqld.sock rootmyw:~# 进入mysql内可以直接使用mysql指令进去不需要密码 rootmyw:~# mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 8 Server version: 8.0.34-0ubuntu0.20.04.1 (Ubuntu)Copyright (c) 2000, 2023, Oracle and/or its affiliates.Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.Type help; or \h for help. Type \c to clear the current input statement.mysql \s -------------- mysql Ver 8.0.34-0ubuntu0.20.04.1 for Linux on x86_64 ((Ubuntu))Connection id: 8 Current database: Current user: rootlocalhost SSL: Not in use Current pager: stdout Using outfile: Using delimiter: ; Server version: 8.0.34-0ubuntu0.20.04.1 (Ubuntu) Protocol version: 10 Connection: Localhost via UNIX socket Server characterset: utf8mb4 Db characterset: utf8mb4 Client characterset: utf8mb4 Conn. characterset: utf8mb4 UNIX socket: /var/run/mysqld/mysqld.sock Binary data as: Hexadecimal Uptime: 4 min 33 secThreads: 2 Questions: 5 Slow queries: 0 Opens: 119 Flush tables: 3 Open tables: 38 Queries per second avg: 0.018 --------------mysql 也可以使用root来登录 root用户不需要输入密码的 rootmyw:~# mysql -uroot -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 9 Server version: 8.0.34-0ubuntu0.20.04.1 (Ubuntu)Copyright (c) 2000, 2023, Oracle and/or its affiliates.Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.Type help; or \h for help. Type \c to clear the current input statement.mysql 查看mysql内的用户信息发现其中有一条数据User是debian-sys-maint 这条直接删掉 mysql use mysql Database changed mysql select Host, User, plugin, authentication_string, password_lifetime from user; ----------------------------------------------------------------------------------------------------------------------------------------------- | Host | User | plugin | authentication_string | password_lifetime | ----------------------------------------------------------------------------------------------------------------------------------------------- | localhost | debian-sys-maint | caching_sha2_password | $A$005$ ^2lO) KVuHJ5LuXU8r1FPmt5.KJA.LCBgue/SrC42rvBmqDmSv3 | NULL | | localhost | mysql.infoschema | caching_sha2_password | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | NULL | | localhost | mysql.session | caching_sha2_password | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | NULL | | localhost | mysql.sys | caching_sha2_password | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | NULL | | localhost | root | auth_socket | | NULL | ----------------------------------------------------------------------------------------------------------------------------------------------- 5 rows in set (0.01 sec)mysql delete from user where userdebian-sys-maint; Query OK, 1 row affected (0.00 sec)mysql select host,user,plugin,authentication_string, password_lifetime from user; ----------------------------------------------------------------------------------------------------------------------------------------------- | host | user | plugin | authentication_string | password_lifetime | ----------------------------------------------------------------------------------------------------------------------------------------------- | localhost | mysql.infoschema | caching_sha2_password | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | NULL | | localhost | mysql.session | caching_sha2_password | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | NULL | | localhost | mysql.sys | caching_sha2_password | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | NULL | | localhost | root | auth_socket | | NULL | ----------------------------------------------------------------------------------------------------------------------------------------------- 4 rows in set (0.00 sec)mysql 数据库执行初始化 安装好mysql数据库后本身就可以使用了也可以执行一次初始化(在数据库运行时才能执行) mysql_secure_installation是否启用密码有效验证插件 rootmyw:~# mysql_secure_installationSecuring the MySQL server deployment.Connecting to MySQL using a blank password.VALIDATE PASSWORD COMPONENT can be used to test passwords and improve security. It checks the strength of password and allows the users to set only those passwords which are secure enough. Would you like to setup VALIDATE PASSWORD component?// 是否启用密码有效验证插件 必须选择是 y Press y|Y for Yes, any other key for No: y设置密码强度复杂度 There are three levels of password validation policy:LOW Length 8 MEDIUM Length 8, numeric, mixed case, and special characters STRONG Length 8, numeric, mixed case, special characters and dictionary file// 设置密码强度复杂度 中级 八位 数字 大小写字母 特殊字符 Please enter 0 LOW, 1 MEDIUM and 2 STRONG: 1 移除匿名用户 Skipping password set for root as authentication with auth_socket is used by default. If you would like to use password authentication instead, this can be done with the ALTER_USER command. See https://dev.mysql.com/doc/refman/8.0/en/alter-user.html#alter-user-password-management for more information.By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL 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? (Press y|Y for Yes, any other key for No) : 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? (Press y|Y for Yes, any other key for No) : n删除测试数据库 ... skipping. By default, MySQL 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? (Press y|Y for Yes, any other key for No) : 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? (Press y|Y for Yes, any other key for No) : y Success.All done! rootmyw:~# mysql数据安装好 默认加入了开机启动的 因此也不需要担心服务器重启 mysql 常用的 开 关 重启 取消开机启动指令 // 启动 systemctl start mysql// 重启 systemctl restart mysql// 停止 systemctl stop mysql// 查看启动状态 systemctl status mysql// 加入开机启动 systemctl enable mysql// 取消开机启动 systemctl disable mysql通过创建一个数据库方式 再去找这个数据库的名字就能找到mysql默认存数据的位置 在centos系统中/etc/my.cnf里配置mysql的参数 但是在Ubuntu系统有些不同在Ubuntu系统的/etc下面是找不到my.cnf配置文件的但是可以找到一个mysql的文件夹 打开my.cnf文件 里面的内容如下 mysql.cnf里也差不多的 一般情况下配置编码 但在mysql8里默认编码就可以utf8mb4,所以其他参数在简单应用里不需要调整的有一个点需要注意mysql8默认是打开了binlog日志存储的如果稍微数据量大那么会产生大量的日志文件(在/var/lib/mysql下面存在binlog.index, binlog.0000xx这类很大的文件)云服务器的云盘太少很容易爆满的因此一般应用需要把它关掉 可以先去查看 mysql SHOW VARIABLES LIKE log_bin; ---------------------- | Variable_name | Value | ---------------------- | log_bin | ON | ---------------------- 1 row in set (0.00 sec)mysql ON是开启的关掉需要配置 先找到mysqld.cnf文件 打开后的文件内容 # # The MySQL database server configuration file. # # One can use all long options that the program supports. # Run program with --help to get a list of available options and with # --print-defaults to see which it would actually understand and use. # # For explanations see # http://dev.mysql.com/doc/mysql/en/server-system-variables.html# Here is entries for some specific programs # The following values assume you have at least 32M ram[mysqld] # # * Basic Settings # user mysql # pid-file /var/run/mysqld/mysqld.pid # socket /var/run/mysqld/mysqld.sock # port 3306 # datadir /var/lib/mysql# If MySQL is running as a replication slave, this should be # changed. Ref https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_tmpdir # tmpdir /tmp # # Instead of skip-networking the default is now to listen only on # localhost which is more compatible and is not less secure. bind-address 127.0.0.1 mysqlx-bind-address 127.0.0.1 # # * Fine Tuning # key_buffer_size 16M # max_allowed_packet 64M # thread_stack 256K# thread_cache_size -1# This replaces the startup script and checks MyISAM tables if needed # the first time they are touched myisam-recover-options BACKUP# max_connections 151# table_open_cache 4000# # * Logging and Replication # # Both location gets rotated by the cronjob. # # Log all queries # Be aware that this log type is a performance killer. # general_log_file /var/log/mysql/query.log # general_log 1 # # Error log - should be very few entries. # log_error /var/log/mysql/error.log # # Here you can see queries with especially long duration # slow_query_log 1 # slow_query_log_file /var/log/mysql/mysql-slow.log # long_query_time 2 # log-queries-not-using-indexes # # The following can be used as easy to replay backup logs or for replication. # note: if you are setting up a replication slave, see README.Debian about # other settings you may need to change. # server-id 1 # log_bin /var/log/mysql/mysql-bin.log # binlog_expire_logs_seconds 2592000 max_binlog_size 100M # binlog_do_db include_database_name # binlog_ignore_db include_database_name 在这个文件的末尾加上配置 disable-log-bin或者 skip-log-bin再执行指令 mysql SHOW VARIABLES LIKE log_bin; ---------------------- | Variable_name | Value | ---------------------- | log_bin | OFF | ---------------------- 1 row in set (0.00 sec)mysql 可以看到biglog已经关掉了 在查询指令可以看到更多信息 show variables like %bin%;mysql show variables like %bin%; ---------------------------------------------------------------------- | Variable_name | Value | ---------------------------------------------------------------------- | bind_address | 127.0.0.1 | | binlog_cache_size | 32768 | | binlog_checksum | CRC32 | | binlog_direct_non_transactional_updates | OFF | | binlog_encryption | OFF | | binlog_error_action | ABORT_SERVER | | binlog_expire_logs_auto_purge | ON | | binlog_expire_logs_seconds | 2592000 | | binlog_format | ROW | | binlog_group_commit_sync_delay | 0 | | binlog_group_commit_sync_no_delay_count | 0 | | binlog_gtid_simple_recovery | ON | | binlog_max_flush_queue_time | 0 | | binlog_order_commits | ON | | binlog_rotate_encryption_master_key_at_startup | OFF | | binlog_row_event_max_size | 8192 | | binlog_row_image | FULL | | binlog_row_metadata | MINIMAL | | binlog_row_value_options | | | binlog_rows_query_log_events | OFF | | binlog_stmt_cache_size | 32768 | | binlog_transaction_compression | OFF | | binlog_transaction_compression_level_zstd | 3 | | binlog_transaction_dependency_history_size | 25000 | | binlog_transaction_dependency_tracking | COMMIT_ORDER | | innodb_api_enable_binlog | OFF | | log_bin | OFF | | log_bin_basename | | | log_bin_index | | | log_bin_trust_function_creators | OFF | | log_bin_use_v1_row_events | OFF | | log_statements_unsafe_for_binlog | ON | | max_binlog_cache_size | 18446744073709547520 | | max_binlog_size | 104857600 | | max_binlog_stmt_cache_size | 18446744073709547520 | | mysqlx_bind_address | 127.0.0.1 | | sql_log_bin | ON | | sync_binlog | 1 | ---------------------------------------------------------------------- 38 rows in set (0.00 sec)mysql 远程路由连接mysql mysql安装在云端 要在本地通过一些远程连接工具来连接云端的mysql 需要创建能够远程连接的账号 mysql CREATE USER myroot% IDENTIFIED BY myW.123456; Query OK, 0 rows affected (0.01 sec)mysql GRANT ALL ON *.* TO myroot%; Query OK, 0 rows affected (0.00 sec) mysql use mysql Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -ADatabase changed mysql select Host, User, plugin, authentication_string, password_lifetime, password_last_changed from user; ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | Host | User | plugin | authentication_string | password_lifetime | password_last_changed | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | % | myroot | caching_sha2_password | $A$005$^S1HhJ|hR/^,9,iVqqzJ3IKSfy7BMFtllgWqDvbSm5U76E84OVTJXWQZUtF. | NULL | 2023-09-21 14:18:21 | | localhost | mysql.infoschema | caching_sha2_password | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | NULL | 2023-09-21 12:40:28 | | localhost | mysql.session | caching_sha2_password | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | NULL | 2023-09-21 12:40:28 | | localhost | mysql.sys | caching_sha2_password | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | NULL | 2023-09-21 12:40:28 | | localhost | root | auth_socket | | NULL | 2023-09-21 12:40:28 | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- 5 rows in set (0.00 sec)mysql 可以看到我在这里创建了一个myroot用户 密码是myW.123456 是满足远程连接的 使用navicat(15版本以上支持mysql8的效果更好) 可以看到连接不上 在centos下安装的mysql8 只要账号满足就可以自我本地电脑远程连接但是在Ubuntu下还需要改刚才的那个配置文件 目录下面 /etc/mysql/mysql.conf.d/mysqld.cnf将 bind-address 127.0.0.1改成 bind-address 0.0.0.0修改后必须重启mysql 不重启不生效的 然后访问 再来看在Ubuntu系统里关于mysql的信息和路径 rootmyw:~# whereis mysql mysql: /usr/bin/mysql /usr/lib/mysql /etc/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz rootmyw:~# find / -name mysql* /etc/init/mysql.conf /etc/logrotate.d/mysql-server /etc/apparmor.d/abstractions/mysql /etc/mysql /etc/mysql/mysql.cnf /etc/mysql/conf.d/mysql.cnf /etc/mysql/conf.d/mysqldump.cnf /etc/mysql/mysql.conf.d /etc/mysql/mysql.conf.d/mysql.cnf /etc/mysql/mysql.conf.d/mysqld.cnf /etc/init.d/mysql /etc/logcheck/ignore.d.workstation/mysql-server-8_0 /etc/logcheck/ignore.d.server/mysql-server-8_0 /etc/logcheck/ignore.d.paranoid/mysql-server-8_0 /etc/systemd/system/multi-user.target.wants/mysql.service /usr/bin/mysqlpump /usr/bin/mysqld_multi /usr/bin/mysql_migrate_keyring /usr/bin/mysqlshow /usr/bin/mysqloptimize /usr/bin/mysql_ssl_rsa_setup /usr/bin/mysqlslap /usr/bin/mysql_config_editor /usr/bin/mysqlreport /usr/bin/mysqldump /usr/bin/mysqladmin /usr/bin/mysql_tzinfo_to_sql /usr/bin/mysqlimport /usr/bin/mysqlrepair /usr/bin/mysqld_safe /usr/bin/mysqlanalyze /usr/bin/mysqldumpslow /usr/bin/mysql_upgrade /usr/bin/mysql /usr/bin/mysqlbinlog /usr/bin/mysql_secure_installation /usr/bin/mysqlcheck /usr/sbin/mysqld /usr/lib/python3/dist-packages/sos/report/plugins/__pycache__/mysql.cpython-38.pyc /usr/lib/python3/dist-packages/sos/report/plugins/mysql.py /usr/lib/mysql /usr/lib/mysql/plugin/mysql_no_login.so /usr/lib/mysql/plugin/mysql_clone.so /usr/lib/systemd/system/mysql.service /usr/share/lintian/overrides/mysql-client-8.0 /usr/share/lintian/overrides/mysql-common /usr/share/lintian/overrides/mysql-server-8.0 /usr/share/mysql-common /usr/share/bash-completion/completions/mysqladmin /usr/share/bash-completion/completions/mysql /usr/share/vim/vim81/syntax/mysql.vim /usr/share/man/man1/mysqlrepair.1.gz /usr/share/man/man1/mysqladmin.1.gz /usr/share/man/man1/mysqldumpslow.1.gz /usr/share/man/man1/mysqloptimize.1.gz /usr/share/man/man1/mysql.1.gz /usr/share/man/man1/mysqlbinlog.1.gz /usr/share/man/man1/mysqlreport.1.gz /usr/share/man/man1/mysqldump.1.gz /usr/share/man/man1/mysql_upgrade.1.gz /usr/share/man/man1/mysql_tzinfo_to_sql.1.gz /usr/share/man/man1/mysqlanalyze.1.gz /usr/share/man/man1/mysql_config_editor.1.gz /usr/share/man/man1/mysqlman.1.gz /usr/share/man/man1/mysqlpump.1.gz /usr/share/man/man1/mysqlshow.1.gz /usr/share/man/man1/mysqld_multi.1.gz /usr/share/man/man1/mysqld_safe.1.gz /usr/share/man/man1/mysqlimport.1.gz /usr/share/man/man1/mysql_ssl_rsa_setup.1.gz /usr/share/man/man1/mysql_secure_installation.1.gz /usr/share/man/man1/mysqlslap.1.gz /usr/share/man/man1/mysqlcheck.1.gz /usr/share/man/man8/mysqld.8.gz /usr/share/mysql /usr/share/mysql/mysqld_multi.server /usr/share/mysql/mysql-log-rotate /usr/share/mysql/mysql-systemd-start /usr/share/doc/mysql-client-8.0 /usr/share/doc/mysql-common /usr/share/doc/mysql-server-8.0 /usr/share/doc/mysql-server-8.0/mysqld.sym.gz /usr/share/doc/mysql-client-core-8.0 /usr/share/doc/mysql-server-core-8.0 /usr/share/doc/mysql-server /run/mysqld /run/mysqld/mysqld.sock /run/mysqld/mysqld.sock.lock /run/mysqld/mysqlx.sock /run/mysqld/mysqlx.sock.lock /var/log/mysql /var/cache/apt/archives/mysql-server-8.0_8.0.34-0ubuntu0.20.04.1_amd64.deb /var/cache/apt/archives/mysql-server-core-8.0_8.0.34-0ubuntu0.20.04.1_amd64.deb /var/cache/apt/archives/mysql-server_8.0.34-0ubuntu0.20.04.1_all.deb /var/cache/apt/archives/mysql-client-core-8.0_8.0.34-0ubuntu0.20.04.1_amd64.deb /var/cache/apt/archives/mysql-common_5.81.0.5ubuntu2_all.deb /var/cache/apt/archives/mysql-client-8.0_8.0.34-0ubuntu0.20.04.1_amd64.deb /var/lib/mysql-keyring /var/lib/dpkg/info/mysql-server.list /var/lib/dpkg/info/mysql-server-8.0.prerm /var/lib/dpkg/info/mysql-common.preinst /var/lib/dpkg/info/mysql-common.conffiles /var/lib/dpkg/info/mysql-common.postinst /var/lib/dpkg/info/mysql-common.list /var/lib/dpkg/info/mysql-common.md5sums /var/lib/dpkg/info/mysql-server-8.0.postrm /var/lib/dpkg/info/mysql-common.prerm /var/lib/dpkg/info/mysql-server-8.0.templates /var/lib/dpkg/info/mysql-client-8.0.list /var/lib/dpkg/info/mysql-client-core-8.0.md5sums /var/lib/dpkg/info/mysql-server.md5sums /var/lib/dpkg/info/mysql-server-8.0.preinst /var/lib/dpkg/info/mysql-server-8.0.postinst /var/lib/dpkg/info/mysql-server-8.0.conffiles /var/lib/dpkg/info/mysql-server-8.0.md5sums /var/lib/dpkg/info/mysql-server-8.0.list /var/lib/dpkg/info/mysql-server-core-8.0.triggers /var/lib/dpkg/info/mysql-server-8.0.config /var/lib/dpkg/info/mysql-client-core-8.0.list /var/lib/dpkg/info/mysql-server-core-8.0.md5sums /var/lib/dpkg/info/mysql-client-8.0.md5sums /var/lib/dpkg/info/mysql-server-core-8.0.list /var/lib/dpkg/info/mysql-common.postrm /var/lib/dpkg/info/mysql-server-core-8.0.shlibs /var/lib/mysql-upgrade /var/lib/mysql /var/lib/mysql/mysql.ibd /var/lib/mysql/mysql /var/lib/mysql-files /var/lib/systemd/deb-systemd-helper-enabled/multi-user.target.wants/mysql.service /var/lib/systemd/deb-systemd-helper-enabled/mysql.service.dsh-also /sys/fs/cgroup/pids/system.slice/mysql.service /sys/fs/cgroup/devices/system.slice/mysql.service /sys/fs/cgroup/memory/system.slice/mysql.service /sys/fs/cgroup/systemd/system.slice/mysql.service /sys/fs/cgroup/unified/system.slice/mysql.service rootmyw:~# 卸载mysql 首先查看mysql的依赖项 dpkg --list|grep mysqlrootmyw:~# dpkg --list|grep mysql ii mysql-client-8.0 8.0.34-0ubuntu0.20.04.1 amd64 MySQL database client binaries ii mysql-client-core-8.0 8.0.34-0ubuntu0.20.04.1 amd64 MySQL database core client binaries ii mysql-common 5.81.0.5ubuntu2 all MySQL database common files, e.g. /etc/mysql/my.cnf ii mysql-server 8.0.34-0ubuntu0.20.04.1 all MySQL database server (metapackage depending on the latest version) ii mysql-server-8.0 8.0.34-0ubuntu0.20.04.1 amd64 MySQL database server binaries and system database setup ii mysql-server-core-8.0 8.0.34-0ubuntu0.20.04.1 amd64 MySQL database server binaries rootmyw:~# 卸载 apt-get autoremove mysql* --purgerootmyw:~# apt-get autoremove mysql* --purge Reading package lists... Done Building dependency tree Reading state information... Done Note, selecting mysql-source-8.0 for glob mysql* Note, selecting mysqltcl for glob mysql* Note, selecting mysql-client-5.5 for glob mysql* Note, selecting mysql-client-5.6 for glob mysql* Note, selecting mysql-client-5.7 for glob mysql* Note, selecting mysql-common-5.6 for glob mysql* Note, selecting mysql-server-5.5 for glob mysql* Note, selecting mysql-server-5.6 for glob mysql* Note, selecting mysql-server-5.7 for glob mysql* Note, selecting mysql-client-8.0 for glob mysql* Note, selecting mysql-testsuite for glob mysql* Note, selecting mysql-server for glob mysql* Note, selecting mysql-router for glob mysql* Note, selecting mysql-server-8.0 for glob mysql* Note, selecting mysql-client for glob mysql* Note, selecting mysql-sandbox for glob mysql* Note, selecting mysql-client-core-5.5 for glob mysql* Note, selecting mysql-client-core-5.6 for glob mysql* Note, selecting mysql-client-core-5.7 for glob mysql* Note, selecting mysql-client-core-8.0 for glob mysql* Note, selecting mysql-testsuite-5.5 for glob mysql* Note, selecting mysql-testsuite-5.6 for glob mysql* Note, selecting mysql-testsuite-5.7 for glob mysql* Note, selecting mysql-common for glob mysql* Note, selecting mysql-testsuite-8.0 for glob mysql* Note, selecting mysqltuner for glob mysql* Note, selecting mysql-server-core-5.5 for glob mysql* Note, selecting mysql-server-core-5.6 for glob mysql* Note, selecting mysql-server-core-5.7 for glob mysql* Note, selecting mysql-server-core-8.0 for glob mysql* Package mysql-client-5.7 is not installed, so not removed Package mysql-client-core-5.7 is not installed, so not removed Note, selecting mysql-common instead of mysql-common-5.6 Package mysql-server-5.5 is not installed, so not removed Package mysql-server-5.7 is not installed, so not removed Package mysql-server-core-5.7 is not installed, so not removed Package mysql-client-core-5.5 is not installed, so not removed Package mysql-client-core-5.6 is not installed, so not removed Package mysql-client-5.5 is not installed, so not removed Package mysql-client-5.6 is not installed, so not removed Package mysql-server-core-5.5 is not installed, so not removed Package mysql-server-core-5.6 is not installed, so not removed Package mysql-server-5.6 is not installed, so not removed Package mysql-testsuite-5.5 is not installed, so not removed Package mysql-testsuite-5.6 is not installed, so not removed Package mysql-testsuite-5.7 is not installed, so not removed Package mysql-sandbox is not installed, so not removed Package mysqltcl is not installed, so not removed Package mysqltuner is not installed, so not removed Package mysql-client is not installed, so not removed Package mysql-router is not installed, so not removed Package mysql-source-8.0 is not installed, so not removed Package mysql-testsuite is not installed, so not removed Package mysql-testsuite-8.0 is not installed, so not removed The following packages will be REMOVED:libcgi-fast-perl* libcgi-pm-perl* libencode-locale-perl* libevent-core-2.1-7* libevent-pthreads-2.1-7* libfcgi-perl* libhtml-parser-perl* libhtml-tagset-perl* libhtml-template-perl* libhttp-date-perl* libhttp-message-perl* libio-html-perl*liblwp-mediatypes-perl* libmecab2* libtimedate-perl* liburi-perl* mecab-ipadic* mecab-ipadic-utf8* mecab-utils* mysql-client-8.0* mysql-client-core-8.0* mysql-common* mysql-server* mysql-server-8.0* mysql-server-core-8.0* 0 upgraded, 0 newly installed, 25 to remove and 271 not upgraded. After this operation, 318 MB disk space will be freed. Do you want to continue? [Y/n] y (Reading database ... 72776 files and directories currently installed.) Removing libcgi-fast-perl (1:2.15-1) ... Removing libhtml-template-perl (2.97-1) ... Removing libcgi-pm-perl (4.46-1) ... Removing libhttp-message-perl (6.22-1) ... Removing libencode-locale-perl (1.05-1) ... Removing mysql-server (8.0.34-0ubuntu0.20.04.1) ... Removing mysql-server-8.0 (8.0.34-0ubuntu0.20.04.1) ... update-alternatives: using /etc/mysql/my.cnf.fallback to provide /etc/mysql/my.cnf (my.cnf) in auto mode Removing mysql-server-core-8.0 (8.0.34-0ubuntu0.20.04.1) ... Removing libevent-pthreads-2.1-7:amd64 (2.1.11-stable-1) ... Removing libevent-core-2.1-7:amd64 (2.1.11-stable-1) ... Removing libfcgi-perl (0.79-1) ... Removing libhtml-parser-perl (3.72-5) ... Removing libhtml-tagset-perl (3.20-4) ... Removing libhttp-date-perl (6.05-1) ... Removing libio-html-perl (1.001-1) ... Removing liblwp-mediatypes-perl (6.04-1) ... Removing mecab-ipadic-utf8 (2.7.0-20070801main-2.1) ... update-alternatives: using /var/lib/mecab/dic/ipadic to provide /var/lib/mecab/dic/debian (mecab-dictionary) in auto mode Removing mecab-ipadic (2.7.0-20070801main-2.1) ... Removing mecab-utils (0.996-10build1) ... Removing libmecab2:amd64 (0.996-10build1) ... Removing libtimedate-perl (2.3200-1) ... Removing liburi-perl (1.76-2) ... Removing mysql-client-8.0 (8.0.34-0ubuntu0.20.04.1) ... Removing mysql-client-core-8.0 (8.0.34-0ubuntu0.20.04.1) ... Removing mysql-common (5.81.0.5ubuntu2) ... Processing triggers for man-db (2.9.1-1) ... Processing triggers for libc-bin (2.31-0ubuntu9.2) ... (Reading database ... 72215 files and directories currently installed.) Purging configuration files for mysql-server-8.0 (8.0.34-0ubuntu0.20.04.1) ... insserv: warning: script S03denyhosts missing LSB tags and overrides insserv: warning: script denyhosts missing LSB tags and overrides Purging configuration files for libmecab2:amd64 (0.996-10build1) ... Purging configuration files for mysql-common (5.81.0.5ubuntu2) ... dpkg: warning: while removing mysql-common, directory /etc/mysql not empty so not removed Processing triggers for systemd (245.4-4ubuntu3.5) ... rootmyw:~# dpkg --list|grep mysql rootmyw:~# 可以看到mysql的依赖项都卸载了在查询有没有mysql rootmyw:~# whereis mysql mysql: /etc/mysql rootmyw:~# 可以看到配置文件夹还在 删除配置文件夹 rootmyw:~# rm -rf /etc/mysql rootmyw:~# whereis mysql mysql: rootmyw:~# 再看 rootmyw:~# find / -name mysql* /etc/apparmor.d/abstractions/mysql /usr/lib/python3/dist-packages/sos/report/plugins/__pycache__/mysql.cpython-38.pyc /usr/lib/python3/dist-packages/sos/report/plugins/mysql.py /usr/share/bash-completion/completions/mysqladmin /usr/share/bash-completion/completions/mysql /usr/share/vim/vim81/syntax/mysql.vim /var/cache/apt/archives/mysql-server-8.0_8.0.34-0ubuntu0.20.04.1_amd64.deb /var/cache/apt/archives/mysql-server-core-8.0_8.0.34-0ubuntu0.20.04.1_amd64.deb /var/cache/apt/archives/mysql-server_8.0.34-0ubuntu0.20.04.1_all.deb /var/cache/apt/archives/mysql-client-core-8.0_8.0.34-0ubuntu0.20.04.1_amd64.deb /var/cache/apt/archives/mysql-common_5.81.0.5ubuntu2_all.deb /var/cache/apt/archives/mysql-client-8.0_8.0.34-0ubuntu0.20.04.1_amd64.deb /var/lib/mysql-keyring /var/lib/mysql /var/lib/mysql/mysql.ibd /var/lib/mysql/mysql /var/lib/mysql-files rootmyw:~# mysql虽然卸载了但是他的配置信息依旧是保留着的 刚刚删了/etc/mysql的配置文件夹 现在来看mysql的存储数据的地方/var/lib/mysql*** 这里面的文件就是mysql原有的数据信息一般我们都是备份后才卸载mysql的所以这里面的文件没用了需要删掉 rootmyw:~# rm -rf /var/lib/mysql rootmyw:~# rm -rf /var/lib/mysql-keyring rootmyw:~# rm -rf /var/lib/mysql-files rootmyw:~# find / -name mysql* /etc/apparmor.d/abstractions/mysql /usr/lib/python3/dist-packages/sos/report/plugins/__pycache__/mysql.cpython-38.pyc /usr/lib/python3/dist-packages/sos/report/plugins/mysql.py /usr/share/bash-completion/completions/mysqladmin /usr/share/bash-completion/completions/mysql /usr/share/vim/vim81/syntax/mysql.vim /var/cache/apt/archives/mysql-server-8.0_8.0.34-0ubuntu0.20.04.1_amd64.deb /var/cache/apt/archives/mysql-server-core-8.0_8.0.34-0ubuntu0.20.04.1_amd64.deb /var/cache/apt/archives/mysql-server_8.0.34-0ubuntu0.20.04.1_all.deb /var/cache/apt/archives/mysql-client-core-8.0_8.0.34-0ubuntu0.20.04.1_amd64.deb /var/cache/apt/archives/mysql-common_5.81.0.5ubuntu2_all.deb /var/cache/apt/archives/mysql-client-8.0_8.0.34-0ubuntu0.20.04.1_amd64.deb rootmyw:~# 在/var/cache/apt/archives/下关于mysql的deb文件 可以不删除 但是要改变mysql的版本 建议还是可以删除的 rootmyw:~# rm -rf /var/cache/apt/archives/mysql* rootmyw:~# find / -name mysql* /etc/apparmor.d/abstractions/mysql /usr/lib/python3/dist-packages/sos/report/plugins/__pycache__/mysql.cpython-38.pyc /usr/lib/python3/dist-packages/sos/report/plugins/mysql.py /usr/share/bash-completion/completions/mysqladmin /usr/share/bash-completion/completions/mysql /usr/share/vim/vim81/syntax/mysql.vim rootmyw:~# 如此在Ubuntu下面mysql算是卸载干净了。 在Ubuntu系统下安装mysql比在centos要稍显简单一点儿其他安装方式遇到再记录
http://www.ho-use.cn/article/10817741.html

相关文章:

  • 杭州信贷网站制作免费的域名注册
  • 上海专业网站推广公司网站实名审核
  • 电商网站运营规划seo推广优势
  • 做网站学h5还是php做网站是做广告吗
  • 做电影网站会不会涉及版权问题江苏网站备案要求
  • 乌镇网站开发文档it外包服务管理制度
  • 电商网站开发prd厦门网站定制开发
  • 佛山市桂城建设局网站古风wordpress
  • 上海宽带网网站app ui设计欣赏 网站
  • 深圳网站维护页面设计seo全网优化推广
  • 免费的网站域名申请网件路由器设置教程
  • 仓库管理系统网站建设个人证书查询网全国联网
  • 零食网站策划书有什么好用的模拟建站软件
  • 简述php网站开发流程图哪里有做网站服务
  • 深圳市城乡住房和建设局网站首页建设食品网站如何定位
  • 网站seo外链国内重大新闻事件2024
  • 做个人的网站怎么做装修软件排行榜前十名
  • asp做的网站如何更新云虚拟主机做网站
  • 容城网站建设道滘仿做网站
  • 学生管理系统 网站开发济南做网站公司排名
  • 哪里有做网站的优化大师在哪里
  • 云服务器怎么做网站网站排名掉了怎么恢复
  • 用php做网站要用构架吗焦作做微信网站多少钱
  • 常用网站大全蓝色系网站
  • 网站建设费如何账务处理天津先进网站建设指导
  • 网站开发的目的相关书籍义乌设计网站
  • 济南企业建站公司适合夜里看的php
  • 宣武门网站建设wordpress网站在哪里修改
  • 网站怎么做修改莘县网站建设
  • 南京网站设公司西安旅游攻略知乎