sudo systemctl start mysqld
- Firstly we need backup all database data into new file, I use TestPortal.sql
/data/VMs_Share/Homes/bell
-bash-4.2$ mysqldump -u root -p --databases TestPortal > TestPortal.sql
Enter password:
-bash-4.2$
2.download the version you want from mysql official address(https://downloads.mysql.com/archives/community/)
you need to know your installing machine version before you download, here we use Red Hat 7
-bash-4.2$ hostnamectl
Static hostname: TestPortalServer
Icon name: computer-vm
Chassis: vm
Machine ID:
Boot ID:
Virtualization: vmware
Operating System: Red Hat Enterprise Linux
CPE OS Name: cpe:/o:redhat:enterprise_linux:7.6:GA:server
Kernel: Linux 3.10.0-957.1.3.el7.x86_64
Architecture: x86-64
-bash-4.2$
upload below rpm package to server
mysql-community-libs-8.0.14-1.el7.x86_64
mysql-community-devel-8.0.14-1.el7.x86_64
mysql-community-server-8.0.14-1.el7.x86_64
mysql-community-common-8.0.14-1.el7.x86_64
mysql-community-client-8.0.14-1.el7.x86_64
-bash-4.2$ ls
mysql-8.0.33-1.el7.x86_64.rpm-bundle.tar mysql-community-devel-8.0.33-1.el7.x86_64.rpm mysql-community-server-8.0.33-1.el7.x86_64.rpm
mysql-community-client-8.0.33-1.el7.x86_64.rpm mysql-community-libs-8.0.33-1.el7.x86_64.rpm
mysql-community-common-8.0.33-1.el7.x86_64.rpm mysql-community-libs-compat-8.0.33-1.el7.x86_64.rpm
3 stop mysql servide, Running below command one by one, be careful not disrupt the order in case some error occurs. this step is install and update dictionary and server
-bash-4.2$ rpm -ivh mysql-community-common-8.0.33-1.el7.x86_64.rpm --nodeps --force
warning: mysql-community-common-8.0.33-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
error: can't create transaction lock on /var/lib/rpm/.rpm.lock (Permission denied)
-bash-4.2$ sudo rpm -ivh mysql-community-common-8.0.33-1.el7.x86_64.rpm --nodeps --force
[sudo] password for bell :
warning: mysql-community-common-8.0.33-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:mysql-community-common-8.0.33-1.e################################# [100%]
-bash-4.2$ sudo rpm -ivh mysql-community-libs-8.0.33-1.el7.x86_64.rpm --nodeps --force
warning: mysql-community-libs-8.0.33-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:mysql-community-libs-8.0.33-1.el7################################# [100%]
/sbin/ldconfig: /usr/local/boost/lib/libodbctxtS.so.2 is not a symbolic link
/sbin/ldconfig: /usr/local/boost/lib/libodbc.so.2 is not a symbolic link
/sbin/ldconfig: /usr/local/boost/lib/libodbcpsqlS.so.2 is not a symbolic link
/sbin/ldconfig: /usr/local/boost/lib/libodbcnnS.so.2 is not a symbolic link
/sbin/ldconfig: /usr/local/boost/lib/libodbcmyS.so.2 is not a symbolic link
/sbin/ldconfig: /usr/local/boost/lib/libodbcminiS.so.2 is not a symbolic link
/sbin/ldconfig: /usr/local/boost/lib/libodbcinst.so.2 is not a symbolic link
/sbin/ldconfig: /usr/local/boost/lib/libodbcdrvcfg2S.so.2 is not a symbolic link
/sbin/ldconfig: /usr/local/boost/lib/libodbcdrvcfg1S.so.2 is not a symbolic link
/sbin/ldconfig: /usr/local/boost/lib/liblog4cxx.so.10 is not a symbolic link
/sbin/ldconfig: /usr/local/boost/lib/libodbccr.so.2 is not a symbolic link
-bash-4.2$ sudo rmp -ivh mysql-community-client-8.0.33-1.el7.x86_64.rpm --nodeps --force
sudo: rmp: command not found
-bash-4.2$ sudo rpm -ivh mysql-community-client-8.0.33-1.el7.x86_64.rpm --nodeps --force
warning: mysql-community-client-8.0.33-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:mysql-community-client-8.0.33-1.e################################# [100%]
-bash-4.2$ sudo rpm -ivh mysql-community-server-8.0.33-1.el7.x86_64.rpm --nodeps --force
warning: mysql-community-server-8.0.33-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:mysql-community-server-8.0.33-1.e################################# [100%]
-bash-4.2$ rpm -qa | grep mysql
mysql-community-libs-8.0.33-1.el7.x86_64
mysql-workbench-community-8.0.14-1.el7.x86_64
mysql-community-libs-8.0.14-1.el7.x86_64
mysql-community-devel-8.0.14-1.el7.x86_64
mysql-community-server-8.0.14-1.el7.x86_64
mysql-community-client-8.0.33-1.el7.x86_64
mysql-community-server-8.0.33-1.el7.x86_64
mysql-community-libs-compat-8.0.14-1.el7.x86_64
mysql-community-common-8.0.14-1.el7.x86_64
mysql-community-common-8.0.33-1.el7.x86_64
mysql80-community-release-el7-2.noarch
mysql-community-client-8.0.14-1.el7.x86_64
-bash-4.2$
-bash-4.2$ rpm -qa | grep mysql
mysql-community-libs-8.0.33-1.el7.x86_64
mysql-workbench-community-8.0.14-1.el7.x86_64
mysql-community-libs-8.0.14-1.el7.x86_64
mysql-community-devel-8.0.14-1.el7.x86_64
mysql-community-server-8.0.14-1.el7.x86_64
mysql-community-client-8.0.33-1.el7.x86_64
mysql-community-server-8.0.33-1.el7.x86_64
mysql-community-libs-compat-8.0.14-1.el7.x86_64
mysql-community-common-8.0.14-1.el7.x86_64
mysql-community-common-8.0.33-1.el7.x86_64
mysql80-community-release-el7-2.noarch
mysql-community-client-8.0.14-1.el7.x86_64
4 delete the old package after install new.
-bash-4.2$ sudo rpm -e mysql-community-server-8.0.14-1.el7.x86_64
-bash-4.2$ sudo rpm -e mysql-community-client-8.0.14-1.el7.x86_64
-bash-4.2$ sudo rpm -e mysql-community-libs-8.0.14-1.el7.x86_64
/sbin/ldconfig: /usr/local/boost/lib/libodbctxtS.so.2 is not a symbolic link
/sbin/ldconfig: /usr/local/boost/lib/libodbc.so.2 is not a symbolic link
/sbin/ldconfig: /usr/local/boost/lib/libodbcpsqlS.so.2 is not a symbolic link
/sbin/ldconfig: /usr/local/boost/lib/libodbcnnS.so.2 is not a symbolic link
/sbin/ldconfig: /usr/local/boost/lib/libodbcmyS.so.2 is not a symbolic link
/sbin/ldconfig: /usr/local/boost/lib/libodbcminiS.so.2 is not a symbolic link
/sbin/ldconfig: /usr/local/boost/lib/libodbcinst.so.2 is not a symbolic link
/sbin/ldconfig: /usr/local/boost/lib/libodbcdrvcfg2S.so.2 is not a symbolic link
/sbin/ldconfig: /usr/local/boost/lib/libodbcdrvcfg1S.so.2 is not a symbolic link
/sbin/ldconfig: /usr/local/boost/lib/liblog4cxx.so.10 is not a symbolic link
/sbin/ldconfig: /usr/local/boost/lib/libodbccr.so.2 is not a symbolic link
-bash-4.2$ sudo rpm -e mysql-community-common-8.0.14-1.el7.x86_64
5 restart the mysql
-bash-4.2$ sudo systemctl start mysqld
6 check the process of mysql running
-bash-4.2$ ps aux | grep mysql
mysql 26634 35.9 5.5 1371744 445544 ? Ssl 21:37 0:07 /usr/sbin/mysqld
belll+ 26992 0.0 0.0 9088 672 pts/1 R+ 21:37 0:00 grep --color=auto mysql
7 check the version info
-bash-4.2$ mysql --version
mysql Ver 8.0.33 for Linux on x86_64 (MySQL Community Server - GPL)
8 enter mysql db
-bash-4.2$ mysql -u root -p TestPortal
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 8.0.33 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>
mysql> \s
mysql Ver 8.0.33 for Linux on x86_64 (MySQL Community Server - GPL)
Connection id: 10
Current database: TestPortal
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 8.0.33 MySQL Community Server - GPL
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: utf8mb4
Db characterset: latin1
Client characterset: latin1
Conn. characterset: latin1
UNIX socket: /var/lib/mysql/mysql.sock
Binary data as: Hexadecimal
Uptime: 1 min 44 sec
Threads: 2 Questions: 48 Slow queries: 0 Opens: 709 Flush tables: 6 Open tables: 79 Queries per second avg: 0.461
mysql> exit
Bye
-bash-4.2$ mysql --version
mysql Ver 8.0.33 for Linux on x86_64 (MySQL Community Server - GPL)
-bash-4.2$
Update the latest version
1003 mkdir mysql8.035
1004 cd mysql8.035/
1005 ls
1006 ll
1007 ps aux | grep mysql
1008 history
-bash-4.2$
-bash-4.2$ history | grep systemctl
841 systemctl status mysqld.service
843 systemctl status mysqld.service
844 sudo systemctl start mysqld
936 sudo systemctl stop mysqld
944 sudo systemctl start mysqld
964 systemctl stop mysqld
966 sudo systemctl stop mysqld.service
995 sudo systemctl start mysqld
1009 history | grep systemctl
-bash-4.2$ sudo systemctl stop mysqld.service
[sudo] password for bell :
-bash-4.2$ ps aux | grep mysql
belll+ 24170 0.0 0.0 9088 668 pts/1 R+ 01:57 0:00 grep --color=auto mysql
-bash-4.2$ ll
total 86302
-rw-r--r--. 1 bell wheel 16756664 Jan 27 01:57 mysql-community-client-8.0.35-1.el7.x86_64.rpm
-rw-r--r--. 1 bell wheel 680936 Jan 27 01:56 mysql-community-common-8.0.35-1.el7.x86_64.rpm
-rw-r--r--. 1 bell wheel 1948132 Jan 27 01:56 mysql-community-devel-8.0.35-1.el7.x86_64.rpm
-rw-r--r--. 1 bell wheel 1563724 Jan 27 01:56 mysql-community-libs-8.0.35-1.el7.x86_64.rpm
-rw-r--r--. 1 bell wheel 67418188 Jan 27 2024 mysql-community-server-8.0.35-1.el7.x86_64.rpm
-bash-4.2$ rpm -ivh mysql-community-common-8.0.35-1.el7.x86_64.rpm --nodeps --force
warning: mysql-community-common-8.0.35-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
error: can't create transaction lock on /var/lib/rpm/.rpm.lock (Permission denied)
-bash-4.2$ sudo rpm -ivh mysql-community-common-8.0.35-1.el7.x86_64.rpm --nodeps --force
warning: mysql-community-common-8.0.35-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:mysql-community-common-8.0.35-1.e################################# [100%]
-bash-4.2$ sudo rpm -ivh mysql-community-libs-8.0.35-1.el7.x86_64.rpm --nodeps --force
warning: mysql-community-libs-8.0.35-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:mysql-community-libs-8.0.35-1.el7################################# [100%]
/sbin/ldconfig: /usr/local/boost/lib/libodbctxtS.so.2 is not a symbolic link
/sbin/ldconfig: /usr/local/boost/lib/libodbc.so.2 is not a symbolic link
/sbin/ldconfig: /usr/local/boost/lib/libodbcpsqlS.so.2 is not a symbolic link
/sbin/ldconfig: /usr/local/boost/lib/libodbcnnS.so.2 is not a symbolic link
/sbin/ldconfig: /usr/local/boost/lib/libodbcmyS.so.2 is not a symbolic link
/sbin/ldconfig: /usr/local/boost/lib/libodbcminiS.so.2 is not a symbolic link
/sbin/ldconfig: /usr/local/boost/lib/libodbcinst.so.2 is not a symbolic link
/sbin/ldconfig: /usr/local/boost/lib/libodbcdrvcfg2S.so.2 is not a symbolic link
/sbin/ldconfig: /usr/local/boost/lib/libodbcdrvcfg1S.so.2 is not a symbolic link
/sbin/ldconfig: /usr/local/boost/lib/liblog4cxx.so.10 is not a symbolic link
/sbin/ldconfig: /usr/local/boost/lib/libodbccr.so.2 is not a symbolic link
-bash-4.2$ sudo rpm -ivh mysql-community-client-8.0.35-1.el7.x86_64.rpm --nodeps --force
warning: mysql-community-client-8.0.35-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:mysql-community-client-8.0.35-1.e################################# [100%]
-bash-4.2$ sudo rpm -ivh mysql-community-server-8.0.35-1.el7.x86_64.rpm --nodeps --force
warning: mysql-community-server-8.0.35-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:mysql-community-server-8.0.35-1.e################################# [100%]
-bash-4.2$
-bash-4.2$ rpm -qa | grep mysql
mysql-community-libs-8.0.33-1.el7.x86_64
mysql-workbench-community-8.0.14-1.el7.x86_64
mysql-community-server-8.0.35-1.el7.x86_64
mysql-community-common-8.0.35-1.el7.x86_64
mysql-community-devel-8.0.14-1.el7.x86_64
mysql-community-libs-8.0.35-1.el7.x86_64
mysql-community-client-8.0.33-1.el7.x86_64
mysql-community-server-8.0.33-1.el7.x86_64
mysql-community-libs-compat-8.0.14-1.el7.x86_64
mysql-community-common-8.0.33-1.el7.x86_64
mysql80-community-release-el7-2.noarch
mysql-community-client-8.0.35-1.el7.x86_64
-bash-4.2$ sudo rpm -e mysql-community-server-8.0.33-1.el7.x86_64
-bash-4.2$ sudo rpm -e mysql-community-client-8.0.33-1.el7.x86_64
-bash-4.2$ sudo rpm -e mysql-community-libs-8.0.33-1.el7.x86_64
/sbin/ldconfig: /usr/local/boost/lib/libodbctxtS.so.2 is not a symbolic link
/sbin/ldconfig: /usr/local/boost/lib/libodbc.so.2 is not a symbolic link
/sbin/ldconfig: /usr/local/boost/lib/libodbcpsqlS.so.2 is not a symbolic link
/sbin/ldconfig: /usr/local/boost/lib/libodbcnnS.so.2 is not a symbolic link
/sbin/ldconfig: /usr/local/boost/lib/libodbcmyS.so.2 is not a symbolic link
/sbin/ldconfig: /usr/local/boost/lib/libodbcminiS.so.2 is not a symbolic link
/sbin/ldconfig: /usr/local/boost/lib/libodbcinst.so.2 is not a symbolic link
/sbin/ldconfig: /usr/local/boost/lib/libodbcdrvcfg2S.so.2 is not a symbolic link
/sbin/ldconfig: /usr/local/boost/lib/libodbcdrvcfg1S.so.2 is not a symbolic link
/sbin/ldconfig: /usr/local/boost/lib/liblog4cxx.so.10 is not a symbolic link
/sbin/ldconfig: /usr/local/boost/lib/libodbccr.so.2 is not a symbolic link
-bash-4.2$ sudo rpm -e mysql-community-common-8.0.33-1.el7.x86_64
-bash-4.2$ rpm -qa | grep mysql
mysql-workbench-community-8.0.14-1.el7.x86_64
mysql-community-server-8.0.35-1.el7.x86_64
mysql-community-common-8.0.35-1.el7.x86_64
mysql-community-devel-8.0.14-1.el7.x86_64
mysql-community-libs-8.0.35-1.el7.x86_64
mysql-community-libs-compat-8.0.14-1.el7.x86_64
mysql80-community-release-el7-2.noarch
mysql-community-client-8.0.35-1.el7.x86_64
-bash-4.2$ sudo systemctl start mysqld
mysqld.service mysqld@
-bash-4.2$ sudo systemctl start mysqld
-bash-4.2$ ps aux | grep mysql
mysql 25021 27.8 5.7 1346648 457116 ? Ssl 02:05 0:05 /usr/sbin/mysqld
belll+ 25331 0.0 0.0 9088 672 pts/1 R+ 02:05 0:00 grep --color=auto mysql
-bash-4.2$ mysql -u root -p TestPortal
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 8.0.35 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> /n
-> ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '/n' at line 1
mysql> \s
mysql Ver 8.0.35 for Linux on x86_64 (MySQL Community Server - GPL)
Connection id: 10
Current database: TestPortal
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 8.0.35 MySQL Community Server - GPL
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: utf8mb4
Db characterset: latin1
Client characterset: latin1
Conn. characterset: latin1
UNIX socket: /var/lib/mysql/mysql.sock
Binary data as: Hexadecimal
Uptime: 58 sec
Threads: 2 Questions: 33 Slow queries: 0 Opens: 562 Flush tables: 4 Open tables: 77 Queries per second avg: 0.568
mysql> exit
Bye
-bash-4.2$ mysql --version
mysql Ver 8.0.35 for Linux on x86_64 (MySQL Community Server - GPL)
-bash-4.2$ Write failed: Broken pipe