mysql 5.6.48 升级到mysql 5.7.44 ERROR! MySQL server PID file could not be...
ERROR! MySQL server PID file could not be found在centos7 使用lnmp 1.7将 mysql 5.6.48 升级到mysql 5.7.44报错。请教如何处理。
2023-12-08T08:17:22.606780Z 0 --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
2023-12-08T08:17:22.606882Z 0 /usr/local/mysql/bin/mysqld (mysqld 5.7.44-log) starting as process 15156 ...
2023-12-08T08:17:22.636526Z 0 InnoDB: PUNCH HOLE support available
2023-12-08T08:17:22.636582Z 0 InnoDB: Mutexes and rw_locks use GCC atomic builtins
2023-12-08T08:17:22.636586Z 0 InnoDB: Uses event mutexes
2023-12-08T08:17:22.636590Z 0 InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2023-12-08T08:17:22.636594Z 0 InnoDB: Compressed tables use zlib 1.2.13
2023-12-08T08:17:22.636599Z 0 InnoDB: Using Linux native AIO
2023-12-08T08:17:22.637029Z 0 InnoDB: Number of pools: 1
2023-12-08T08:17:22.637146Z 0 InnoDB: Using CPU crc32 instructions
2023-12-08T08:17:22.638747Z 0 InnoDB: Initializing buffer pool, total size = 1G, instances = 8, chunk size = 128M
2023-12-08T08:17:22.700531Z 0 InnoDB: Completed initialization of buffer pool
2023-12-08T08:17:22.715039Z 0 InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2023-12-08T08:17:22.726936Z 0 InnoDB: Highest supported file format is Barracuda.
2023-12-08T08:17:22.751864Z 0 InnoDB: Creating shared tablespace for temporary tables
2023-12-08T08:17:22.751935Z 0 InnoDB: Setting file '/usr/local/mysql/var/ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2023-12-08T08:17:22.872993Z 0 InnoDB: File '/usr/local/mysql/var/ibtmp1' size is now 12 MB.
2023-12-08T08:17:22.873765Z 0 InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2023-12-08T08:17:22.873777Z 0 InnoDB: 32 non-redo rollback segment(s) are active.
2023-12-08T08:17:22.874120Z 0 InnoDB: Waiting for purge to start
2023-12-08T08:17:22.924265Z 0 InnoDB: 5.7.44 started; log sequence number 1209987
2023-12-08T08:17:22.924506Z 0 InnoDB: Loading buffer pool(s) from /usr/local/mysql/var/ib_buffer_pool
2023-12-08T08:17:22.924697Z 0 Plugin 'FEDERATED' is disabled.
2023-12-08T08:17:22.924729Z 0 InnoDB: Buffer pool(s) load completed at 231208 16:17:22
mysqld: Table 'mysql.plugin' doesn't exist
2023-12-08T08:17:22.924821Z 0 Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
2023-12-08T08:17:22.929842Z 0 Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2023-12-08T08:17:22.932547Z 0 Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2023-12-08T08:17:22.932562Z 0 Skipping generation of SSL certificates as certificate files are present in data directory.
2023-12-08T08:17:22.932566Z 0 A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
2023-12-08T08:17:22.932569Z 0 A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
2023-12-08T08:17:22.933142Z 0 CA certificate ca.pem is self signed.
2023-12-08T08:17:22.933186Z 0 Skipping generation of RSA key pair as key files are present in data directory.
2023-12-08T08:17:22.933260Z 0 Server hostname (bind-address): '*'; port: 3306
2023-12-08T08:17:22.933295Z 0 IPv6 is available.
2023-12-08T08:17:22.933305Z 0 - '::' resolves to '::';
2023-12-08T08:17:22.933322Z 0 Server socket created on IP: '::'.
2023-12-08T08:17:22.934749Z 0 Insecure configuration for --pid-file: Location '/usr/local/mysql/var' in the path is accessible to all OS users. Consider choosing a different directory.
2023-12-08T08:17:22.934845Z 0 Failed to open optimizer cost constant tables
2023-12-08T08:17:22.935844Z 0 Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
2023-12-08T08:17:22.935856Z 0 Fatal error: Failed to initialize ACL/grant/time zones structures or failed to remove temporary table files.
2023-12-08T08:17:22.935901Z 0 Aborting
2023-12-08T08:17:22.935926Z 0 Binlog end
2023-12-08T08:17:22.937359Z 0 Shutting down plugin 'ngram'
2023-12-08T08:17:22.937369Z 0 Shutting down plugin 'ARCHIVE'
2023-12-08T08:17:22.937372Z 0 Shutting down plugin 'partition'
2023-12-08T08:17:22.937375Z 0 Shutting down plugin 'BLACKHOLE'
2023-12-08T08:17:22.937378Z 0 Shutting down plugin 'PERFORMANCE_SCHEMA'
2023-12-08T08:17:22.937438Z 0 Shutting down plugin 'MEMORY'
2023-12-08T08:17:22.937443Z 0 Shutting down plugin 'CSV'
2023-12-08T08:17:22.937446Z 0 Shutting down plugin 'MyISAM'
2023-12-08T08:17:22.937456Z 0 Shutting down plugin 'MRG_MYISAM'
2023-12-08T08:17:22.937459Z 0 Shutting down plugin 'INNODB_SYS_VIRTUAL'
2023-12-08T08:17:22.937462Z 0 Shutting down plugin 'INNODB_SYS_DATAFILES'
2023-12-08T08:17:22.937465Z 0 Shutting down plugin 'INNODB_SYS_TABLESPACES'
2023-12-08T08:17:22.937467Z 0 Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2023-12-08T08:17:22.937470Z 0 Shutting down plugin 'INNODB_SYS_FOREIGN'
2023-12-08T08:17:22.937473Z 0 Shutting down plugin 'INNODB_SYS_FIELDS'
2023-12-08T08:17:22.937475Z 0 Shutting down plugin 'INNODB_SYS_COLUMNS'
2023-12-08T08:17:22.937478Z 0 Shutting down plugin 'INNODB_SYS_INDEXES'
2023-12-08T08:17:22.937480Z 0 Shutting down plugin 'INNODB_SYS_TABLESTATS'
2023-12-08T08:17:22.937483Z 0 Shutting down plugin 'INNODB_SYS_TABLES'
2023-12-08T08:17:22.937485Z 0 Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2023-12-08T08:17:22.937488Z 0 Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2023-12-08T08:17:22.937490Z 0 Shutting down plugin 'INNODB_FT_CONFIG'
2023-12-08T08:17:22.937493Z 0 Shutting down plugin 'INNODB_FT_BEING_DELETED'
2023-12-08T08:17:22.937495Z 0 Shutting down plugin 'INNODB_FT_DELETED'
2023-12-08T08:17:22.937497Z 0 Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2023-12-08T08:17:22.937500Z 0 Shutting down plugin 'INNODB_METRICS'
2023-12-08T08:17:22.937502Z 0 Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
2023-12-08T08:17:22.937505Z 0 Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2023-12-08T08:17:22.937508Z 0 Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2023-12-08T08:17:22.937510Z 0 Shutting down plugin 'INNODB_BUFFER_PAGE'
2023-12-08T08:17:22.937513Z 0 Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2023-12-08T08:17:22.937515Z 0 Shutting down plugin 'INNODB_CMP_PER_INDEX'
2023-12-08T08:17:22.937518Z 0 Shutting down plugin 'INNODB_CMPMEM_RESET'
2023-12-08T08:17:22.937520Z 0 Shutting down plugin 'INNODB_CMPMEM'
2023-12-08T08:17:22.937523Z 0 Shutting down plugin 'INNODB_CMP_RESET'
2023-12-08T08:17:22.937525Z 0 Shutting down plugin 'INNODB_CMP'
2023-12-08T08:17:22.937528Z 0 Shutting down plugin 'INNODB_LOCK_WAITS'
2023-12-08T08:17:22.937530Z 0 Shutting down plugin 'INNODB_LOCKS'
2023-12-08T08:17:22.937547Z 0 Shutting down plugin 'INNODB_TRX'
2023-12-08T08:17:22.937550Z 0 Shutting down plugin 'InnoDB'
2023-12-08T08:17:22.937610Z 0 InnoDB: FTS optimize thread exiting.
2023-12-08T08:17:22.937678Z 0 InnoDB: Starting shutdown...
2023-12-08T08:17:23.037869Z 0 InnoDB: Dumping buffer pool(s) to /usr/local/mysql/var/ib_buffer_pool
2023-12-08T08:17:23.038097Z 0 InnoDB: Buffer pool(s) dump completed at 231208 16:17:23
2023-12-08T08:17:24.563215Z 0 InnoDB: Shutdown completed; log sequence number 1210006
2023-12-08T08:17:24.565246Z 0 InnoDB: Removed temporary tablespace data file: "ibtmp1"
2023-12-08T08:17:24.565262Z 0 Shutting down plugin 'sha256_password'
2023-12-08T08:17:24.565265Z 0 Shutting down plugin 'mysql_native_password'
2023-12-08T08:17:24.565382Z 0 Shutting down plugin 'binlog'
2023-12-08T08:17:24.569483Z 0 /usr/local/mysql/bin/mysqld: Shutdown complete
升级日志发一下,应该升级过程中就报错了 Enter current root password of Database (Password will not shown): OK, MySQL root password correct.
Current MYSQL Version:5.6.48
You can get version number from http://dev.mysql.com/downloads/mysql/
[0;33mPlease input MySQL Version you want.[0m
(example: 5.5.60 ): ===========================
[0;33mDo you want to install the InnoDB Storage Engine?[0m
(Default yes,if you want please enter: y , if not please enter: n): You will install the InnoDB Storage Engine
==================================================
You will upgrade MySQL Version to 5.7.44
==================================================
[0;32mPress any key to start...or Press Ctrl+c to cancel[0m
============================check files==================================
mysql-boost-5.7.44.tar.gz
============================check files==================================
+-------------------------------------------+
| Manager for LNMP, Written by Licess |
+-------------------------------------------+
| https://lnmp.org |
+-------------------------------------------+
Stoping LNMPA...
Stoping nginx...done
Shutting down MySQL.... SUCCESS!
stop apache...done
Starting upgrade MySQL...
Uncompress mysql-boost-5.7.44.tar.gz...
cd mysql-5.7.44...
Download or use exist boost...[0m
-- Running cmake version 2.8.12.2
-- Found Git: /usr/bin/git (found version "1.8.3.1")
-- Configuring with MAX_INDEXES = 64U
-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- CMAKE_GENERATOR: Unix Makefiles
-- Looking for SHM_HUGETLB
-- Looking for SHM_HUGETLB - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of void *
-- Check size of void * - done
-- SIZEOF_VOIDP 8
-- Performing Test HAVE_C_SHIFT_OR_OPTIMIZATION_BUG
-- Performing Test HAVE_C_SHIFT_OR_OPTIMIZATION_BUG - Failed
-- Performing Test HAVE_CXX_SHIFT_OR_OPTIMIZATION_BUG
-- Performing Test HAVE_CXX_SHIFT_OR_OPTIMIZATION_BUG - Failed
-- Performing Test HAVE_C_FLOATING_POINT_FUSED_MADD
-- Performing Test HAVE_C_FLOATING_POINT_FUSED_MADD - Failed
-- Performing Test HAVE_CXX_FLOATING_POINT_FUSED_MADD
-- Performing Test HAVE_CXX_FLOATING_POINT_FUSED_MADD - Failed
-- Performing Test HAVE_C_FP_CONTRACT_FLAG
-- Performing Test HAVE_C_FP_CONTRACT_FLAG - Success
-- Performing Test HAVE_CXX_FP_CONTRACT_FLAG
-- Performing Test HAVE_CXX_FP_CONTRACT_FLAG - Success
-- MySQL 5.7.44
-- Packaging as: mysql-5.7.44-Linux-x86_64
-- Local boost dir /root/lnmp1.7/src/mysql-5.7.44/boost/boost_1_59_0
-- Found /root/lnmp1.7/src/mysql-5.7.44/boost/boost_1_59_0/boost/version.hpp
-- BOOST_VERSION_NUMBER is #define BOOST_VERSION 105900
-- BOOST_INCLUDE_DIR /root/lnmp1.7/src/mysql-5.7.44/boost/boost_1_59_0
-- Performing Test HAVE_LLVM_LIBCPP
-- Performing Test HAVE_LLVM_LIBCPP - Failed
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- CMAKE_MODULE_LINKER_FLAGS
-- CMAKE_SHARED_LINKER_FLAGS
-- Configuring done
-- Generating done
-- Build files have been written to: /root/lnmp1.7/src/mysql-5.7.44
Scanning dependencies of target abi_check
Scanning dependencies of target INFO_BIN
Scanning dependencies of target INFO_SRC
Scanning dependencies of target lz4_lib
Building C object extra/libevent/libevent-2.1.11-stable/CMakeFiles/event_core.dir/bufferevent_sock.c.o
Scanning dependencies of target vio
Install the project...
-- Install configuration: "RelWithDebInfo"
-- Installing: /usr/local/mysql/docs/mysql.info
-- Installing: /usr/local/mysql/./README
-- Installing: /usr/local/mysql/./LICENSE
-- Installing: /usr/local/mysql/docs/INFO_SRC
-- Installing: /usr/local/mysql/support-files/magic
-- Installing: /usr/local/mysql/share/aclocal/mysql.m4
-- Installing: /usr/local/mysql/support-files/mysql.server
groupadd: group 'mysql' already exists
useradd: user 'mysql' already exists
2023-12-11T06:21:53.839128Z 0 InnoDB: 1048576 bytes should have been written. Only 667648 bytes written. Retrying for the remaining bytes.
2023-12-11T06:21:53.839165Z 0 InnoDB: Retry attempts for writing partial data failed.
2023-12-11T06:21:53.839176Z 0 InnoDB: Write to file /usr/local/mysql/var/ib_logfile101 failed at offset 92274688, 1048576 bytes should have been written, only 667648 were written. Operating system error number 28. Check that your OS and file system support files of this size. Check also that the disk is not full or a disk quota exceeded.
2023-12-11T06:21:53.839192Z 0 InnoDB: Error number 28 means 'No space left on device'
2023-12-11T06:21:53.839202Z 0 InnoDB: Cannot set log file /usr/local/mysql/var/ib_logfile101 to size 256 MB
2023-12-11T06:21:53.839209Z 0 InnoDB: InnoDB Database creation was aborted with error Generic error. You may need to delete the ibdata1 file before trying to start up again.
2023-12-11T06:21:54.339528Z 0 Plugin 'InnoDB' init function returned error.
2023-12-11T06:21:54.339549Z 0 Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2023-12-11T06:21:54.339563Z 0 Failed to initialize builtin plugins.
2023-12-11T06:21:54.339567Z 0 Aborting
Starting MySQL.Logging to '/usr/local/mysql/var/iZbp12nzmpsity68p052vgZ.err'.
. ERROR! The server quit without updating PID file (/usr/local/mysql/var/iZbp12nzmpsity68p052vgZ.pid).
ERROR! MySQL server PID file could not be found!
Starting MySQL.. ERROR! The server quit without updating PID file (/usr/local/mysql/var/iZbp12nzmpsity68p052vgZ.pid).
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!
failed, try other way...
ERROR! MySQL server PID file could not be found!
Starting MySQL.. ERROR! The server quit without updating PID file (/usr/local/mysql/var/iZbp12nzmpsity68p052vgZ.pid).
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
Set password failed!
ERROR! MySQL server PID file could not be found!
Starting MySQL.. ERROR! The server quit without updating PID file (/usr/local/mysql/var/iZbp12nzmpsity68p052vgZ.pid).
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
Update root password...
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
... Failed!
Remove anonymous users...
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
... Failed!
Disallow root login remotely...
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
... Failed!
Remove test database...
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
... Failed!
Reload privilege tables...
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
... Failed!
ERROR! MySQL server PID file could not be found!
Starting MySQL.. ERROR! The server quit without updating PID file (/usr/local/mysql/var/iZbp12nzmpsity68p052vgZ.pid).
ERROR! MySQL server PID file could not be found!
Starting MySQL.. ERROR! The server quit without updating PID file (/usr/local/mysql/var/iZbp12nzmpsity68p052vgZ.pid).
Restore backup databases...
include/upgrade_mysql.sh: line 555: /root/mysql_all_backup20231211140605.sql: No such file or directory
Repair databases...
mysql_upgrade: Using a password on the command line interface can be insecure.
mysql_upgrade: Got error: 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) while connecting to the MySQL server
Upgrade process encountered error and will not continue.
ERROR! MySQL server PID file could not be found!
+-------------------------------------------+
| Manager for LNMP, Written by Licess |
+-------------------------------------------+
| https://lnmp.org |
+-------------------------------------------+
Starting LNMPA...
Starting nginx...done
Starting MySQL.. ERROR! The server quit without updating PID file (/usr/local/mysql/var/iZbp12nzmpsity68p052vgZ.pid).
start apache...done
[0;32m======== upgrade MySQL completed ======[0m
因为上传有限制,所以把日志中感觉用处不大的删除了。
尝试升级过2次,失败了又还原
第一次升级失败是因为磁盘不足。后面把升级代码里面的数据库备份注释了。还原后进行第二次升级,还是失败了 注释的是这一块
Backup_MySQL()
{
#echo "Starting backup all databases..."
#echo "If the database is large, the backup time will be longer."
#/usr/local/mysql/bin/mysqldump --defaults-file=~/.my.cnf --all-databases > /root/mysql_all_backup${Upgrade_Date}.sql
#if [ $? -eq 0 ]; then
# echo "MySQL databases backup successfully.";
#else
# echo "MySQL databases backup failed,Please backup databases manually!"
# exit 1
#fi
lnmp stop
mv /usr/local/mysql /usr/local/oldmysql${Upgrade_Date}
mv /etc/init.d/mysql /usr/local/oldmysql${Upgrade_Date}/init.d.mysql.bak.${Upgrade_Date}
mv /etc/my.cnf /usr/local/oldmysql${Upgrade_Date}/my.cnf.bak.${Upgrade_Date}
if [ "${MySQL_Data_Dir}" != "/usr/local/mysql/var" ]; then
mv ${MySQL_Data_Dir} ${MySQL_Data_Dir}${Upgrade_Date}
fi
if echo "${mysql_version}" | grep -Eqi '^5.5.' &&echo "${cur_mysql_version}" | grep -Eqi '^5.6.';then
sed -i 's/STATS_PERSISTENT=0//g' /root/mysql_all_backup${Upgrade_Date}.sql
fi
} 上面的日志是因为硬盘空间不足造成的
上面的日志是第一次还是第二次升级的日志
注释备份部分的话不影响升级 上面的是第二次升级的日志
页:
[1]