上篇8.0.32库的准备:mysql: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No suc-CSDN博客
此篇测试升级到8.0.40
MySQL :: Download MySQL Community Server
root@jyc:~# mysql -u root -pabcd1234
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 8.0.32 MySQL Community Server - GPL
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> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.00 sec)
mysql> create database jyc;
Query OK, 1 row affected (0.00 sec)
mysql> use jyc;
Database changed
mysql> create table test(id int);
Query OK, 0 rows affected (0.02 sec)
mysql> insert into test values(1);
Query OK, 1 row affected (0.01 sec)
mysql> select * from test;
+------+
| id |
+------+
| 1 |
+------+
1 row in set (0.00 sec)
mysql>
mysql> exit
Bye
root@jyc:~# systemctl stop mysql
root@jyc:~# pwd
/root
root@jyc:~# ll
total 2047552
drwx------ 5 root root 4096 Oct 31 12:37 ./
drwxr-xr-x 20 root root 4096 Oct 31 08:08 ../
-rw------- 1 root root 2412 Oct 31 09:34 .bash_history
-rw-r--r-- 1 root root 3106 Dec 5 2019 .bashrc
drwx------ 2 root root 4096 Oct 31 07:47 .cache/
-rw-r--r-- 1 root root 610315332 Oct 31 07:52 mysql-8.0.32-linux-glibc2.12-x86_64.tar.xz
-rw-r--r-- 1 root root 60201944 Oct 31 11:31 mysql-8.0.32-linux-glibc2.17-x86_64-minimal.tar.xz
-rw-r--r-- 1 root root 1360436040 Oct 31 08:21 mysql-8.0.40-linux-glibc2.12-x86_64.tar.xz
-rw-r--r-- 1 root root 60957800 Oct 31 11:30 mysql-8.0.40-linux-glibc2.17-x86_64-minimal.tar.xz
-rw-r--r-- 1 root root 68620 Dec 16 2022 mysql-common_8.0.32-1ubuntu22.04_amd64.deb
-rw-r--r-- 1 root root 2457710 Oct 31 11:43 mysql-community-client_8.0.32-1ubuntu22.04_amd64.deb
-rw-r--r-- 1 root root 2183834 Oct 31 11:52 mysql-community-client-core_8.0.32-1ubuntu22.04_amd64.deb
-rw------- 1 root root 484 Oct 31 12:37 .mysql_history
-rw-r--r-- 1 root root 161 Dec 5 2019 .profile
drwx------ 3 root root 4096 Oct 31 07:25 snap/
drwx------ 2 root root 4096 Oct 31 07:25 .ssh/
-rw------- 1 root root 9170 Oct 31 08:38 .viminfo
root@jyc:~# tar -xvf mysql-8.0.40-linux-glibc2.17-x86_64-minimal.tar.xz
mysql-8.0.40-linux-glibc2.17-x86_64-minimal/bin/
.......
root@jyc:~#
root@jyc:~# pwd
/root
root@jyc:~# cd /data/
root@jyc:/data# ll
total 16
drwxr-xr-x 4 root root 4096 Oct 31 08:24 ./
drwxr-xr-x 20 root root 4096 Oct 31 08:08 ../
drwxr-xr-x 10 mysql mysql 4096 Oct 31 12:37 mysql/
drwxr-xr-x 8 mysql mysql 4096 Oct 31 12:37 mysql_data/
root@jyc:/data# mv mysql mysql.8.0.32
root@jyc:/data# mv /root/mysql-8.0.40-linux-glibc2.17-x86_64-minimal /data/mysql
root@jyc:/data# ll /data/mysql
total 292
drwxr-xr-x 9 root root 4096 Oct 31 12:38 ./
drwxr-xr-x 5 root root 4096 Oct 31 12:39 ../
drwxr-xr-x 2 7161 31415 4096 Sep 18 11:03 bin/
drwxr-xr-x 2 7161 31415 4096 Sep 18 11:03 docs/
drwxr-xr-x 3 7161 31415 4096 Sep 18 11:03 include/
drwxr-xr-x 6 7161 31415 4096 Sep 18 11:03 lib/
-rw-r--r-- 1 7161 31415 257478 Sep 18 10:08 LICENSE
drwxr-xr-x 4 7161 31415 4096 Sep 18 11:03 man/
-rw-r--r-- 1 7161 31415 666 Sep 18 10:08 README
drwxr-xr-x 28 7161 31415 4096 Sep 18 11:03 share/
drwxr-xr-x 2 7161 31415 4096 Sep 18 11:03 support-files/
root@jyc:/data# mkdir /data/mysql/log
root@jyc:/data# chown -R mysql:mysql /data/mysql
root@jyc:/data# which mysql
/data/mysql/bin/mysql
root@jyc:/data# /data/mysql/bin/mysql -V
/data/mysql/bin/mysql Ver 8.0.40 for Linux on x86_64 (MySQL Community Server - GPL)
root@jyc:/data# systemctl start mysql
root@jyc:/data# systemctl status mysql
● mysql.service - LSB: start and stop MySQL
Loaded: loaded (/etc/init.d/mysql; generated)
Active: active (running) since Thu 2024-10-31 12:40:58 UTC; 4s ago
Docs: man:systemd-sysv-generator(8)
Process: 7319 ExecStart=/etc/init.d/mysql start (code=exited, status=0/SUCCESS)
Tasks: 39 (limit: 9443)
Memory: 484.1M
CGroup: /system.slice/mysql.service
├─7355 /bin/sh /data/mysql/bin/mysqld_safe --datadir=/data/mysql_data --pid-file=/data/mysql_data/jyc.pid
└─7715 /data/mysql/bin/mysqld --basedir=/data/mysql --datadir=/data/mysql_data --plugin-dir=/data/mysql/lib/plugin --user=mysql --log-error=jyc.err --pid-file=/data/mysql_data/jyc.pi>
Oct 31 12:40:48 jyc systemd[1]: Starting LSB: start and stop MySQL...
Oct 31 12:40:48 jyc mysql[7319]: Starting MySQL
Oct 31 12:40:58 jyc mysql[7319]: .......... *
Oct 31 12:40:58 jyc systemd[1]: Started LSB: start and stop MySQL.
root@jyc:/data# ps -ef|grep mysql
root 7355 1 0 12:40 ? 00:00:00 /bin/sh /data/mysql/bin/mysqld_safe --datadir=/data/mysql_data --pid-file=/data/mysql_data/jyc.pid
mysql 7715 7355 44 12:40 ? 00:00:08 /data/mysql/bin/mysqld --basedir=/data/mysql --datadir=/data/mysql_data --plugin-dir=/data/mysql/lib/plugin --user=mysql --log-error=jyc.err --pid-file=/data/mysql_data/jyc.pid --socket=/data/mysql/mysql.sock --port=3306
root 8028 5850 0 12:41 pts/0 00:00:00 grep --color=auto mysql
root@jyc:/data# mysql -u root -pabcd1234
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 8.0.40 MySQL Community Server - GPL
Copyright (c) 2000, 2024, 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> \h
For information about MySQL products and services, visit:
http://www.mysql.com/
For developer information, including the MySQL Reference Manual, visit:
http://dev.mysql.com/
To buy MySQL Enterprise support, training, or other products, visit:
https://shop.mysql.com/
List of all MySQL commands:
Note that all text commands must be first on line and end with ';'
? (\?) Synonym for `help'.
clear (\c) Clear the current input statement.
connect (\r) Reconnect to the server. Optional arguments are db and host.
delimiter (\d) Set statement delimiter.
edit (\e) Edit command with $EDITOR.
ego (\G) Send command to mysql server, display result vertically.
exit (\q) Exit mysql. Same as quit.
go (\g) Send command to mysql server.
help (\h) Display this help.
nopager (\n) Disable pager, print to stdout.
notee (\t) Don't write into outfile.
pager (\P) Set PAGER [to_pager]. Print the query results via PAGER.
print (\p) Print current command.
prompt (\R) Change your mysql prompt.
quit (\q) Quit mysql.
rehash (\#) Rebuild completion hash.
source (\.) Execute an SQL script file. Takes a file name as an argument.
status (\s) Get status information from the server.
system (\!) Execute a system shell command, if enabled
tee (\T) Set outfile [to_outfile]. Append everything into given outfile.
use (\u) Use another database. Takes database name as argument.
charset (\C) Switch to another charset. Might be needed for processing binlog with multi-byte charsets.
warnings (\W) Show warnings after every statement.
nowarning (\w) Don't show warnings after every statement.
resetconnection(\x) Clean session context.
query_attributes Sets string parameters (name1 value1 name2 value2 ...) for the next query to pick up.
ssl_session_data_print Serializes the current SSL session data to stdout or file
For server side help, type 'help contents'
mysql> \s
--------------
mysql Ver 8.0.40 for Linux on x86_64 (MySQL Community Server - GPL)
Connection id: 10
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 8.0.40 MySQL Community Server - GPL
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: utf8mb4
Db characterset: utf8mb4
Client characterset: utf8mb4
Conn. characterset: utf8mb4
UNIX socket: /data/mysql/mysql.sock
Binary data as: Hexadecimal
Uptime: 43 sec
Threads: 2 Questions: 11 Slow queries: 0 Opens: 558 Flush tables: 4 Open tables: 37 Queries per second avg: 0.255
--------------
mysql> select version();
+-----------+
| version() |
+-----------+
| 8.0.40 |
+-----------+
1 row in set (0.00 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| jyc |
| mysql |
| performance_schema |
| sys |
+--------------------+
5 rows in set (0.01 sec)
mysql> use jyc;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> select * from test;
+------+
| id |
+------+
| 1 |
+------+
1 row in set (0.00 sec)
mysql>
检查日志记录:
root@jyc:/data/mysql_data# systemctl stop mysql
root@jyc:/data/mysql_data# systemctl start mysql
root@jyc:/data/mysql_data# more jyc.err
2024-10-31T12:04:34.179682Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.
2024-10-31T12:04:34.179722Z 0 [System] [MY-010116] [Server] /data/mysql/bin/mysqld (mysqld 8.0.32) starting as process 5406
2024-10-31T12:04:34.193901Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-10-31T12:04:34.436376Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2024-10-31T12:04:34.801896Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2024-10-31T12:04:34.801957Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2024-10-31T12:04:34.835140Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /tmp/mysqlx.sock
2024-10-31T12:04:34.835328Z 0 [System] [MY-010931] [Server] /data/mysql/bin/mysqld: ready for connections. Version: '8.0.32' socket: '/data/mysql/mysql.sock' port: 3306 MySQL Community Server -
GPL.
2024-10-31T12:34:59.313115Z 0 [System] [MY-013172] [Server] Received SHUTDOWN from user <via user signal>. Shutting down mysqld (Version: 8.0.32).
2024-10-31T12:35:00.786434Z 0 [System] [MY-010910] [Server] /data/mysql/bin/mysqld: Shutdown complete (mysqld 8.0.32) MySQL Community Server - GPL.
2024-10-31T12:35:04.891460Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.
2024-10-31T12:35:04.891503Z 0 [System] [MY-010116] [Server] /data/mysql/bin/mysqld (mysqld 8.0.32) starting as process 7190
2024-10-31T12:35:04.908498Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-10-31T12:35:05.152290Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2024-10-31T12:35:05.422534Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2024-10-31T12:35:05.422620Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2024-10-31T12:35:05.470567Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /tmp/mysqlx.sock
2024-10-31T12:35:05.470672Z 0 [System] [MY-010931] [Server] /data/mysql/bin/mysqld: ready for connections. Version: '8.0.32' socket: '/data/mysql/mysql.sock' port: 3306 MySQL Community Server -
GPL.
2024-10-31T12:37:44.192653Z 0 [System] [MY-013172] [Server] Received SHUTDOWN from user <via user signal>. Shutting down mysqld (Version: 8.0.32).
2024-10-31T12:37:44.868463Z 0 [System] [MY-010910] [Server] /data/mysql/bin/mysqld: Shutdown complete (mysqld 8.0.32) MySQL Community Server - GPL.
2024-10-31T12:40:49.034557Z 0 [Warning] [MY-011069] [Server] The syntax '--character-set-client-handshake' is deprecated and will be removed in a future release.
2024-10-31T12:40:49.034756Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.
2024-10-31T12:40:49.034790Z 0 [System] [MY-010116] [Server] /data/mysql/bin/mysqld (mysqld 8.0.40) starting as process 7715
2024-10-31T12:40:49.050205Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-10-31T12:40:49.394465Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2024-10-31T12:40:52.035278Z 4 [System] [MY-013381] [Server] Server upgrade from '80032' to '80040' started.
2024-10-31T12:40:57.436638Z 4 [System] [MY-013381] [Server] Server upgrade from '80032' to '80040' completed.
2024-10-31T12:40:57.627002Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2024-10-31T12:40:57.627074Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2024-10-31T12:40:57.667120Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /tmp/mysqlx.sock
2024-10-31T12:40:57.667178Z 0 [System] [MY-010931] [Server] /data/mysql/bin/mysqld: ready for connections. Version: '8.0.40' socket: '/data/mysql/mysql.sock' port: 3306 MySQL Community Server -
GPL.
2024-10-31T12:41:19.539816Z 10 [Warning] [MY-013360] [Server] Plugin mysql_native_password reported: ''mysql_native_password' is deprecated and will be removed in a future release. Please use cach
ing_sha2_password instead'
2024-10-31T13:04:54.629658Z 0 [System] [MY-013172] [Server] Received SHUTDOWN from user <via user signal>. Shutting down mysqld (Version: 8.0.40).
2024-10-31T13:04:55.266680Z 0 [System] [MY-010910] [Server] /data/mysql/bin/mysqld: Shutdown complete (mysqld 8.0.40) MySQL Community Server - GPL.
2024-10-31T13:05:04.925055Z 0 [Warning] [MY-011069] [Server] The syntax '--character-set-client-handshake' is deprecated and will be removed in a future release.
2024-10-31T13:05:04.925221Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.
2024-10-31T13:05:04.925257Z 0 [System] [MY-010116] [Server] /data/mysql/bin/mysqld (mysqld 8.0.40) starting as process 8572
2024-10-31T13:05:04.939248Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-10-31T13:05:05.217637Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2024-10-31T13:05:05.489395Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2024-10-31T13:05:05.489464Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2024-10-31T13:05:05.534184Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /tmp/mysqlx.sock
2024-10-31T13:05:05.534258Z 0 [System] [MY-010931] [Server] /data/mysql/bin/mysqld: ready for connections. Version: '8.0.40' socket: '/data/mysql/mysql.sock' port: 3306 MySQL Community Server -
GPL.