0
  • 聊天消息
  • 系統(tǒng)消息
  • 評論與回復(fù)
登錄后你可以
  • 下載海量資料
  • 學(xué)習(xí)在線課程
  • 觀看技術(shù)視頻
  • 寫文章/發(fā)帖/加入社區(qū)
會員中心
創(chuàng)作中心

完善資料讓更多小伙伴認(rèn)識你,還能領(lǐng)取20積分哦,立即完善>

3天內(nèi)不再提示

【魯班貓門禁系統(tǒng)】安裝mysql

華仔的編程隨筆 ? 來源:華仔的編程隨筆 ? 作者:華仔的編程隨筆 ? 2023-04-27 09:15 ? 次閱讀

安裝

現(xiàn)在,我們將通過 apt 包管理器安裝 MySQL。執(zhí)行下udo apt install mysql-server。具體日志如下:

cat@lubancat:~/lugl/my_project$ sudo apt install mysql-server
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  accountsservice-ubuntu-schemas activity-log-manager apg aptdaemon aptdaemon-data cracklib-runtime gedit
  gedit-common gir1.2-accountsservice-1.0 gir1.2-adw-1 gir1.2-gck-1 gir1.2-gcr-3 gir1.2-gdesktopenums-3.0
  gir1.2-gdm-1.0 gir1.2-geoclue-2.0 gir1.2-gnomebluetooth-3.0 gir1.2-gnomedesktop-3.0 gir1.2-graphene-1.0
  gir1.2-gtk-4.0 gir1.2-gtksource-4 gir1.2-gweather-3.0 gir1.2-javascriptcoregtk-4.0 gir1.2-json-1.0
  gir1.2-mutter-10 gir1.2-nma-1.0 gir1.2-peas-1.0 gir1.2-rsvg-2.0 gir1.2-soup-2.4 gir1.2-upowerglib-1.0
  gir1.2-vte-2.91 gkbd-capplet gnome-bluetooth-3-common gnome-bluetooth-common gnome-control-center-data
  gnome-control-center-faces gnome-menus gnome-remote-desktop gnome-settings-daemon gnome-shell-common
  gsfonts imagemagick-6-common language-selector-gnome libabsl20210324 libadwaita-1-0 libcolord-gtk1
  libcrack2 libdca0 libde265-0 libdee-1.0-4 libdjvulibre-text libdjvulibre21 libebackend-1.2-10
  libebook-1.2-20 libebook-contacts-1.2-3 libedata-book-1.2-26 libedata-cal-2.0-1 libfaad2
  libfftw3-double3 libfluidsynth3 libfreeaptx0 libfreerdp-client2-2 libfreerdp-server2-2 libfreerdp2-2
  libgdm1 libgeoclue-2-0 libgeocode-glib0 libgeonames-common libgeonames0 libgjs0g libgnome-autoar-0-0
  libgnome-bluetooth-3.0-13 libgnome-bluetooth13 libgnome-menu-3-0 libgnomekbd8 libgsound0 libgspell-1-2
  libgspell-1-common libgssdp-1.2-0 libgtksourceview-4-0 libgtksourceview-4-common libgupnp-1.2-1
  libgupnp-av-1.0-3 libgupnp-igd-1.0-4 libgweather-3-16 libgweather-common libheif1 libinstpatch-1.0-2
  libjxr-tools libjxr0 libkate1 liblqr-1-0 libltc11 libmagickcore-6.q16-6 libmagickcore-6.q16-6-extra
  libmagickwand-6.q16-6 libmediaart-2.0-0 libmjpegutils-2.1-0 libmodplug1 libmozjs-102-0 libmpcdec6
  libmpeg2encpp-2.1-0 libmplex2-2.1-0 libmutter-10-0 libnice10 libopenh264-6 libopenni2-0 libpeas-1.0-0
  libpeas-common libphonenumber8 libprotobuf23 libpulsedsp libpwquality-common libpwquality1 libqrencode4
  libqt5multimedia5 libqt5multimediaquick5 libqt5multimediawidgets5 librest-0.7-0 librygel-core-2.6-2
  librygel-db-2.6-2 librygel-renderer-2.6-2 librygel-server-2.6-2 libsoundtouch1 libsoup-gnome2.4-1
  libspandsp2 libspeexdsp1 libsrtp2-1 libtimezonemap-data libtimezonemap1 libtumbler-1-0
  libunity-control-center1 libvncserver1 libvo-aacenc0 libvo-amrwbenc0 libwhoopsie-preferences0
  libwildmidi2 libwinpr2-2 libwmflite-0.2-7 libxcb-xv0 libxcvt0 libzbar0 libzeitgeist-2.0-0 libzxingcore1
  mutter-common power-profiles-daemon pulseaudio-utils python3-aptdaemon python3-aptdaemon.gtk3widgets
  python3-defer python3-macaroonbakery python3-nacl python3-protobuf python3-pymacaroons python3-rfc3339
  python3-tz qml-module-qtmultimedia switcheroo-control timgm6mb-soundfont tumbler-common
  ubuntu-wallpapers ubuntu-wallpapers-jammy whoopsie whoopsie-preferences xwayland yaru-theme-gnome-shell
  zeitgeist-core zenity-common
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libaio1 libcgi-fast-perl libcgi-pm-perl libfcgi-bin libfcgi-perl libfcgi0ldbl libhtml-template-perl
  libmecab2 libprotobuf-lite23 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:
  libipc-sharedcache-perl mailx tinyca
The following NEW packages will be installed:
  libaio1 libcgi-fast-perl libcgi-pm-perl libfcgi-bin libfcgi-perl libfcgi0ldbl libhtml-template-perl
  libmecab2 libprotobuf-lite23 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, 18 newly installed, 0 to remove and 95 not upgraded.
Need to get 28.4 MB of archives.
After this operation, 236 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://mirrors.ustc.edu.cn/ubuntu-ports jammy/main arm64 mysql-common all 5.8+1.0.8 [7212 B]
Get:2 http://mirrors.ustc.edu.cn/ubuntu-ports jammy-security/main arm64 mysql-client-core-8.0 arm64 8.0.32-0ubuntu0.22.04.2 [2877 kB]
Get:3 http://mirrors.ustc.edu.cn/ubuntu-ports jammy-security/main arm64 mysql-client-8.0 arm64 8.0.32-0ubuntu0.22.04.2 [22.7 kB]
Get:4 http://mirrors.ustc.edu.cn/ubuntu-ports jammy/main arm64 libaio1 arm64 0.3.112-13build1 [7018 B]
Get:5 http://mirrors.ustc.edu.cn/ubuntu-ports jammy/main arm64 libmecab2 arm64 0.996-14build9 [188 kB]
Get:6 http://mirrors.ustc.edu.cn/ubuntu-ports jammy-security/main arm64 libprotobuf-lite23 arm64 3.12.4-1ubuntu7.22.04.1 [192 kB]
Get:7 http://mirrors.ustc.edu.cn/ubuntu-ports jammy-security/main arm64 mysql-server-core-8.0 arm64 8.0.32-0ubuntu0.22.04.2 [16.9 MB]
Get:8 http://mirrors.ustc.edu.cn/ubuntu-ports jammy-security/main arm64 mysql-server-8.0 arm64 8.0.32-0ubuntu0.22.04.2 [1230 kB]
Get:9 http://mirrors.ustc.edu.cn/ubuntu-ports jammy/main arm64 libcgi-pm-perl all 4.54-1 [188 kB]
Get:10 http://mirrors.ustc.edu.cn/ubuntu-ports jammy/main arm64 libfcgi0ldbl arm64 2.4.2-2build2 [28.0 kB]
Get:11 http://mirrors.ustc.edu.cn/ubuntu-ports jammy/main arm64 libfcgi-perl arm64 0.82+ds-1build1 [22.3 kB]
Get:12 http://mirrors.ustc.edu.cn/ubuntu-ports jammy/main arm64 libcgi-fast-perl all 1:2.15-1 [10.5 kB]
Get:13 http://mirrors.ustc.edu.cn/ubuntu-ports jammy/main arm64 libfcgi-bin arm64 2.4.2-2build2 [10.7 kB]
Get:14 http://mirrors.ustc.edu.cn/ubuntu-ports jammy/main arm64 libhtml-template-perl all 2.97-1.1 [59.1 kB]
Get:15 http://mirrors.ustc.edu.cn/ubuntu-ports jammy/main arm64 mecab-utils arm64 0.996-14build9 [4830 B]
Get:16 http://mirrors.ustc.edu.cn/ubuntu-ports jammy/main arm64 mecab-ipadic all 2.7.0-20070801+main-3 [6718 kB]
Get:17 http://mirrors.ustc.edu.cn/ubuntu-ports jammy/main arm64 mecab-ipadic-utf8 all 2.7.0-20070801+main-3 [4384 B]
Get:18 http://mirrors.ustc.edu.cn/ubuntu-ports jammy-security/main arm64 mysql-server all 8.0.32-0ubuntu0.22.04.2 [9458 B]
Fetched 28.4 MB in 2s (11.9 MB/s)
Preconfiguring packages ...
Selecting previously unselected package mysql-common.
(Reading database ... 159629 files and directories currently installed.)
Preparing to unpack .../0-mysql-common_5.8+1.0.8_all.deb ...
Unpacking mysql-common (5.8+1.0.8) ...
Selecting previously unselected package mysql-client-core-8.0.
Preparing to unpack .../1-mysql-client-core-8.0_8.0.32-0ubuntu0.22.04.2_arm64.deb ...
Unpacking mysql-client-core-8.0 (8.0.32-0ubuntu0.22.04.2) ...
Selecting previously unselected package mysql-client-8.0.
Preparing to unpack .../2-mysql-client-8.0_8.0.32-0ubuntu0.22.04.2_arm64.deb ...
Unpacking mysql-client-8.0 (8.0.32-0ubuntu0.22.04.2) ...
Selecting previously unselected package libaio1:arm64.
Preparing to unpack .../3-libaio1_0.3.112-13build1_arm64.deb ...
Unpacking libaio1:arm64 (0.3.112-13build1) ...
Selecting previously unselected package libmecab2:arm64.
Preparing to unpack .../4-libmecab2_0.996-14build9_arm64.deb ...
Unpacking libmecab2:arm64 (0.996-14build9) ...
Selecting previously unselected package libprotobuf-lite23:arm64.
Preparing to unpack .../5-libprotobuf-lite23_3.12.4-1ubuntu7.22.04.1_arm64.deb ...
Unpacking libprotobuf-lite23:arm64 (3.12.4-1ubuntu7.22.04.1) ...
Selecting previously unselected package mysql-server-core-8.0.
Preparing to unpack .../6-mysql-server-core-8.0_8.0.32-0ubuntu0.22.04.2_arm64.deb ...
Unpacking mysql-server-core-8.0 (8.0.32-0ubuntu0.22.04.2) ...
Setting up mysql-common (5.8+1.0.8) ...
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 ... 159843 files and directories currently installed.)
Preparing to unpack .../00-mysql-server-8.0_8.0.32-0ubuntu0.22.04.2_arm64.deb ...
Unpacking mysql-server-8.0 (8.0.32-0ubuntu0.22.04.2) ...
Selecting previously unselected package libcgi-pm-perl.
Preparing to unpack .../01-libcgi-pm-perl_4.54-1_all.deb ...
Unpacking libcgi-pm-perl (4.54-1) ...
Selecting previously unselected package libfcgi0ldbl:arm64.
Preparing to unpack .../02-libfcgi0ldbl_2.4.2-2build2_arm64.deb ...
Unpacking libfcgi0ldbl:arm64 (2.4.2-2build2) ...
Selecting previously unselected package libfcgi-perl:arm64.
Preparing to unpack .../03-libfcgi-perl_0.82+ds-1build1_arm64.deb ...
Unpacking libfcgi-perl:arm64 (0.82+ds-1build1) ...
Selecting previously unselected package libcgi-fast-perl.
Preparing to unpack .../04-libcgi-fast-perl_1%3a2.15-1_all.deb ...
Unpacking libcgi-fast-perl (1:2.15-1) ...
Selecting previously unselected package libfcgi-bin.
Preparing to unpack .../05-libfcgi-bin_2.4.2-2build2_arm64.deb ...
Unpacking libfcgi-bin (2.4.2-2build2) ...
Selecting previously unselected package libhtml-template-perl.
Preparing to unpack .../06-libhtml-template-perl_2.97-1.1_all.deb ...
Unpacking libhtml-template-perl (2.97-1.1) ...
Selecting previously unselected package mecab-utils.
Preparing to unpack .../07-mecab-utils_0.996-14build9_arm64.deb ...
Unpacking mecab-utils (0.996-14build9) ...
Selecting previously unselected package mecab-ipadic.
Preparing to unpack .../08-mecab-ipadic_2.7.0-20070801+main-3_all.deb ...
Unpacking mecab-ipadic (2.7.0-20070801+main-3) ...
Selecting previously unselected package mecab-ipadic-utf8.
Preparing to unpack .../09-mecab-ipadic-utf8_2.7.0-20070801+main-3_all.deb ...
Unpacking mecab-ipadic-utf8 (2.7.0-20070801+main-3) ...
Selecting previously unselected package mysql-server.
Preparing to unpack .../10-mysql-server_8.0.32-0ubuntu0.22.04.2_all.deb ...
Unpacking mysql-server (8.0.32-0ubuntu0.22.04.2) ...
Setting up libmecab2:arm64 (0.996-14build9) ...
Setting up mysql-client-core-8.0 (8.0.32-0ubuntu0.22.04.2) ...
Setting up libfcgi0ldbl:arm64 (2.4.2-2build2) ...
Setting up libcgi-pm-perl (4.54-1) ...
Setting up libfcgi-bin (2.4.2-2build2) ...
Setting up libhtml-template-perl (2.97-1.1) ...
Setting up libprotobuf-lite23:arm64 (3.12.4-1ubuntu7.22.04.1) ...
Setting up mecab-utils (0.996-14build9) ...
Setting up mysql-client-8.0 (8.0.32-0ubuntu0.22.04.2) ...
Setting up libfcgi-perl:arm64 (0.82+ds-1build1) ...
Setting up libaio1:arm64 (0.3.112-13build1) ...
Setting up mecab-ipadic (2.7.0-20070801+main-3) ...
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/Suffix.csv ... 1393
reading /usr/share/mecab/dic/ipadic/Interjection.csv ... 252
reading /usr/share/mecab/dic/ipadic/Noun.place.csv ... 72999
reading /usr/share/mecab/dic/ipadic/Adnominal.csv ... 135
reading /usr/share/mecab/dic/ipadic/Noun.demonst.csv ... 120
reading /usr/share/mecab/dic/ipadic/Postp.csv ... 146
reading /usr/share/mecab/dic/ipadic/Noun.adjv.csv ... 3328
reading /usr/share/mecab/dic/ipadic/Adj.csv ... 27210
reading /usr/share/mecab/dic/ipadic/Conjunction.csv ... 171
reading /usr/share/mecab/dic/ipadic/Noun.proper.csv ... 27328
reading /usr/share/mecab/dic/ipadic/Postp-col.csv ... 91
reading /usr/share/mecab/dic/ipadic/Verb.csv ... 130750
reading /usr/share/mecab/dic/ipadic/Adverb.csv ... 3032
reading /usr/share/mecab/dic/ipadic/Filler.csv ... 19
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.number.csv ... 42
reading /usr/share/mecab/dic/ipadic/Auxil.csv ... 199
reading /usr/share/mecab/dic/ipadic/Noun.adverbal.csv ... 795
reading /usr/share/mecab/dic/ipadic/Symbol.csv ... 208
reading /usr/share/mecab/dic/ipadic/Prefix.csv ... 221
reading /usr/share/mecab/dic/ipadic/Noun.csv ... 60477
reading /usr/share/mecab/dic/ipadic/Noun.others.csv ... 151
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.org.csv ... 16668
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 libcgi-fast-perl (1:2.15-1) ...
Setting up mysql-server-core-8.0 (8.0.32-0ubuntu0.22.04.2) ...
Setting up mecab-ipadic-utf8 (2.7.0-20070801+main-3) ...
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/Suffix.csv ... 1393
reading /usr/share/mecab/dic/ipadic/Interjection.csv ... 252
reading /usr/share/mecab/dic/ipadic/Noun.place.csv ... 72999
reading /usr/share/mecab/dic/ipadic/Adnominal.csv ... 135
reading /usr/share/mecab/dic/ipadic/Noun.demonst.csv ... 120
reading /usr/share/mecab/dic/ipadic/Postp.csv ... 146
reading /usr/share/mecab/dic/ipadic/Noun.adjv.csv ... 3328
reading /usr/share/mecab/dic/ipadic/Adj.csv ... 27210
reading /usr/share/mecab/dic/ipadic/Conjunction.csv ... 171
reading /usr/share/mecab/dic/ipadic/Noun.proper.csv ... 27328
reading /usr/share/mecab/dic/ipadic/Postp-col.csv ... 91
reading /usr/share/mecab/dic/ipadic/Verb.csv ... 130750
reading /usr/share/mecab/dic/ipadic/Adverb.csv ... 3032
reading /usr/share/mecab/dic/ipadic/Filler.csv ... 19
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.number.csv ... 42
reading /usr/share/mecab/dic/ipadic/Auxil.csv ... 199
reading /usr/share/mecab/dic/ipadic/Noun.adverbal.csv ... 795
reading /usr/share/mecab/dic/ipadic/Symbol.csv ... 208
reading /usr/share/mecab/dic/ipadic/Prefix.csv ... 221
reading /usr/share/mecab/dic/ipadic/Noun.csv ... 60477
reading /usr/share/mecab/dic/ipadic/Noun.others.csv ... 151
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.org.csv ... 16668
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 mysql-server-8.0 (8.0.32-0ubuntu0.22.04.2) ...
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 3901
Created symlink /etc/systemd/system/multi-user.target.wants/mysql.service → /lib/systemd/system/mysql.service.
Setting up mysql-server (8.0.32-0ubuntu0.22.04.2) ...
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for libc-bin (2.35-0ubuntu3.1) ...

我們看到mysqld is running as pid 3901,說明mysql服務(wù)已經(jīng)啟動,當(dāng)然我們也可以用命令sudo service mysql status來查看信息

cat@lubancat:~/lugl/my_project$ sudo service mysql status
● mysql.service - MySQL Community Server
     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
     Active: active (running) since Wed 2023-04-26 18:07:49 CST; 4min 35s ago
    Process: 4076 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
   Main PID: 4084 (mysqld)
     Status: "Server is operational"
     Memory: 364.6M
        CPU: 7.808s
     CGroup: /system.slice/mysql.service
             └─4084 /usr/sbin/mysqld

進(jìn)入mysql控制臺:

cat@lubancat:~/lugl/my_project$ sudo mysql
Welcome to the MySQL monitor.  Commands end with ; or \\g.
Your MySQL connection id is 8
Server version: 8.0.32-0ubuntu0.22.04.2 (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>

在這里我就可以進(jìn)入命令行的日常操作了

mysql> SELECT user,authentication_string,plugin,host FROM mysql.user;
+------------------+------------------------------------------------------------------------+-----------------------+-----------+
| user             | authentication_string                                                  | plugin                | host      |
+------------------+------------------------------------------------------------------------+-----------------------+-----------+
| debian-sys-maint | $A$005$}ZCg'cRfV3C8yInxkte5T9evBgjAOj45tRKiyXQP4fyYgikL.UambrqdlC | caching_sha2_password | localhost |
| mysql.infoschema | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | caching_sha2_password | localhost |
| mysql.session    | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | caching_sha2_password | localhost |
| mysql.sys        | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | caching_sha2_password | localhost |
| root             |                                                                        | auth_socket           | localhost |
+------------------+------------------------------------------------------------------------+-----------------------+-----------+
5 rows in set (0.01 sec)

輸入以下命修改登錄密碼

mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Temppwd123@'
    -> ;
Query OK, 0 rows affected (0.25 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.04 sec)

mysql>

完成后,我們需要確認(rèn) root 用戶不再使用 auth_socket 進(jìn)行身份驗(yàn)證。通過再次運(yùn)行以下命令來執(zhí)行此操作。

mysql> create user 'root'@'192.168.3.192' identified by 'password'

-> ^C

mysql> create user 'root'@'192.168.3.192' identified by 'Temppwd123@';

Query OK, 0 rows affected (0.07 sec)

mysql> grant all privileges on . to 'root'@'192.168.3.192' with grant option

-> ;

Query OK, 0 rows affected (0.07 sec)

mysql> flush privileges;

Query OK, 0 rows affected (0.03 sec)

mysql>

安裝pymysql

執(zhí)行sudo apt install python3-pymysql

測試

cat@lubancat:~$ python3
Python 3.10.6 (main, Mar 10 2023, 10:55:28) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pymysql
>>> conn = pymysql.connect(host='127.0.0.1',database='mysql',user='root',password='Temppwd123@')
>>> print(conn)

到此,mysql了安裝成功,并完成了測試。
審核編輯:湯梓紅

聲明:本文內(nèi)容及配圖由入駐作者撰寫或者入駐合作網(wǎng)站授權(quán)轉(zhuǎn)載。文章觀點(diǎn)僅代表作者本人,不代表電子發(fā)燒友網(wǎng)立場。文章及其配圖僅供工程師學(xué)習(xí)之用,如有內(nèi)容侵權(quán)或者其他違規(guī)問題,請聯(lián)系本站處理。 舉報投訴
  • 測試
    +關(guān)注

    關(guān)注

    8

    文章

    5103

    瀏覽量

    126340
  • 門禁系統(tǒng)
    +關(guān)注

    關(guān)注

    17

    文章

    391

    瀏覽量

    45436
  • MySQL
    +關(guān)注

    關(guān)注

    1

    文章

    798

    瀏覽量

    26399
收藏 人收藏

    評論

    相關(guān)推薦

    【野火魯班2開發(fā)板體驗(yàn)】Debian + 物聯(lián)網(wǎng) + 綜合小項(xiàng)目

    ,刷刷網(wǎng)頁都灑灑水啦。最后在說一下 本次使用的是 野火的魯班2開發(fā)板,資料豐富,外設(shè)接口齊全,無論是學(xué)習(xí)外設(shè)使用,diy作品,或接屏幕聽音樂看視頻,體驗(yàn)Ubuntu/Debian操作系統(tǒng)都是很好
    發(fā)表于 03-08 20:12

    魯班0 :驅(qū)動攝像頭完成拍照

    【目的】驅(qū)動攝像頭完成拍照【實(shí)驗(yàn)器材】1、魯班0+wifi開發(fā)板2、野火MIPI CSI攝像頭【軟件環(huán)境】1、ubuntu20.4.02、python3.103、opencv 4.5.0【實(shí)現(xiàn)步驟
    發(fā)表于 04-06 21:21

    魯班門禁系統(tǒng)】之一 選擇Tornado

    的小區(qū)門禁系統(tǒng)已經(jīng)有5年多了,非常之穩(wěn)定。 魯班上運(yùn)行這套系統(tǒng)非常適合,也就適應(yīng)了他輕量的系統(tǒng)
    發(fā)表于 04-25 09:53

    魯班門禁系統(tǒng)】之二 Tornado庫的安裝、入門篇

    (tornado.web.RequestHandler): def get(self): self.write(\"你好魯班!\") def my_app(): return
    發(fā)表于 04-25 13:06

    魯班門禁系統(tǒng)】之二 安裝samba服務(wù)

    ]//在win下面顯示的文件夾名稱 path = /home/cat/lugl///設(shè)置在魯班上充許訪問的目錄 available = yes browseable = yes public
    發(fā)表于 04-25 13:32

    魯班門禁系統(tǒng)】創(chuàng)建tornado工程

    映身網(wǎng)絡(luò)文件夾 1、按下圖指引映射魯班的samba文件夾 2、我們映射為Z盤: 2、用VScode 選擇剛才我們新映射的盤: 創(chuàng)建工程文件 新建目錄與文件如下: 工程初始代碼: 1
    發(fā)表于 04-26 13:29

    魯班門禁系統(tǒng)安裝并測試mysql

    安裝 現(xiàn)在,我們將通過 apt 包管理器安裝 MySQL。執(zhí)行下udo apt install mysql-server。具體日志如下: cat@lubancat:~/lugl/my_
    發(fā)表于 04-26 20:35

    魯班智能時鐘】安裝 AWTRIX server

    入 HOSTPOD 模式,設(shè)置 AWTRIX 的 Wi-Fi 和服務(wù)器 IP,服務(wù)器IP設(shè)置為 192.168.0.150 至此,魯班作為 AWTRIX 的服務(wù)器已經(jīng)搭建完成了。 安裝 EMQX 執(zhí)行如下命令
    發(fā)表于 04-29 21:02

    魯班智能時鐘】項(xiàng)目提交:基于魯班0的滿血版AWTRIX時鐘

    /jishu_2349201_1_1.html 魯班0 AWTRIX 控制端固件修改燒錄 https://bbs.elecfans.com/jishu_2350764_1_1.html 魯班
    發(fā)表于 05-01 20:43

    魯班創(chuàng)意氛圍賽】用魯班控制你的機(jī)箱和副屏

    、控制機(jī)箱的argb。 3、遠(yuǎn)程開關(guān)機(jī)。 4、雙系統(tǒng)互救(windows的安裝u盤用魯班0,dd來做。魯班
    發(fā)表于 05-14 20:49

    魯班創(chuàng)意氛圍賽】使用魯班運(yùn)行l(wèi)akka

    ,可以打開SD卡,可以看到下面內(nèi)容 設(shè)備樹如下,魯班有多種設(shè)備,可以根據(jù)自己的設(shè)備使用相應(yīng)的設(shè)備樹,具體的配置在下面的配置。 配置文件夾里有個配置文件,可以根據(jù)自己的喜好配置系統(tǒng) 搞完就可以
    發(fā)表于 05-15 23:19

    魯班創(chuàng)意氛圍賽】項(xiàng)目提交:基于魯班1的智慧物聯(lián)中控系統(tǒng)

    魯班創(chuàng)意氛圍賽】項(xiàng)目提交:基于魯班1的智慧物聯(lián)中控系統(tǒng)大信(QQ:8125036)一、前言 魯班
    發(fā)表于 05-16 02:36

    魯班創(chuàng)意氛圍賽】魯班2單板電腦=物聯(lián)網(wǎng)+綜合小項(xiàng)目

    使用的是 野火的魯班2開發(fā)板,資料豐富,外設(shè)接口齊全,無論是學(xué)習(xí)外設(shè)使用,diy作品,或接屏幕聽音樂看視頻,體驗(yàn)Ubuntu/Debian操作系統(tǒng)都是很好的選擇。 下面是項(xiàng)目的視頻演示在b站,鏈接
    發(fā)表于 05-18 20:06

    魯班Tornado門禁系統(tǒng)】為什么選擇Tornado搭建

    介紹輕量的tornado框架搭建魯班門禁系統(tǒng)
    的頭像 發(fā)表于 04-25 09:49 ?663次閱讀

    魯班門禁系統(tǒng)】創(chuàng)建tornado工程

    魯班卡片電腦上創(chuàng)建tornado工程
    的頭像 發(fā)表于 04-26 13:25 ?26.1w次閱讀
    【<b class='flag-5'>魯班</b><b class='flag-5'>貓</b><b class='flag-5'>門禁</b><b class='flag-5'>系統(tǒng)</b>】創(chuàng)建tornado工程