Home > database >  A wrong mysql upgrade mode
A wrong mysql upgrade mode

Time:09-25

His experiment, now want to upgrade to 5.7.24 mysql5.6.29. Following are the steps to upgrade (note: upgrade need to stop the mysql, according to the actual situation to choose upgrade time) :

1, prepare mysql5.7.24 package and will 5.7.24 package uploaded to the server (I'm on the/usr/local/SRC)

2, stop the mysql service (I am directly kill process)

??

3, confirm the mysql has stopped
??
4, the backup of the original mysql (double machine negligible)

I am a direct physical file backup, cp -r/data/mysqldata/MNT/data/

6, extract just uploaded 5.7.24 package

The tar XZF mysql - 5.7.24 - Linux - glibc2.12 - x86_64. Tar. Gz

7, replace the original installation directory (because I am under the package is compiled, direct start can use; If it is not compiled, manual compiled by oneself and then follow these steps)

Mysql - 5.7.24 - Linux - mv glibc2.12 - # x86_64 mysql to 5.7.24 change a name

Mv/usr/local/mysql/usr/local/mysql5.6 #, the original installation package also change name is convenient to distinguish the

Mv mysql/usr/local/mysql # 5.7.24 bag will be moved to the/usr/local under

8, start the mysql



Find the mysql service can't start, and then log and no error, judgment for initialization because there is no permission table cause, need to initialize, 5.7 and 5.6 initialization, bin/MSQLD - initializey - user=mysql - datadir=/data/mysqldata - basedir=/usr/local/mysql - defaults - file=/etc/my CNF

Not use scripts/mysql_install_db, but bin/MSQLD initializey, initialization error:/data/mysqldata (data directory) have the file, unable to initialize the



Then according to the error message, the data to all files in the directory delete (rm - rf *), and initialized again, again an error: open the bin - log, error,

Will bin - log. Then in my CNF commented, initialized again, initial success



Finally start the mysql service,./mysqld_safe -- -- the user=mysql & amp;



Log in the database, an error: the password expired, to login, you must use support overdue client to change the password,



But because my database in the cloud, ali didn't do the relevant configuration, couldn't get through the client login, had to want to other way, then the current data directory of all the rm - rf * off, and then the original backup data directory of 5.6 copy to the current directory and skip - grant - is added in the configuration tables=1 (skip inspection authorization table), start again, found that after log in the database, you can start to upgrade the 5.7.24, is this why?????

??

In the end, will skip - grant - tables=1 commented out, also can log in and normal operation,

What a great god to solve???

CodePudding user response:

Here is the MSSQL, the building Lord to send the wrong plate

CodePudding user response:

Haven't done to upgrade mysql operation, but the original poster is successful is a good thing,

CodePudding user response:

Version of the program, depending on the file, not the data file, see your description is to put the data file reduction, program file does not change, so version still 5.7.24

CodePudding user response:

But the mysql startup reads the db directory, logically under the db data file or 5.6, should be an error

CodePudding user response:

reference mingqing6364 reply: 3/f
version of the program, depending on the executable files, rather than the data file, see your description is to put the data file restore back, didn't change program files, so version or 5.7.24

But the mysql startup reads the db directory, logically under the db data file or 5.6, should be an error

CodePudding user response:

reference 5 floor wzq756984 reply:
Quote: refer to the third floor mingqing6364 response:

Version of the program, depending on the file, not the data file, see your description is to put the data file restore back, didn't change program files, so version or 5.7.24

But the mysql startup reads the db directory, logically under the db data file or 5.6, should be complains ah


Version compatibility

CodePudding user response:

Kill the host process this step is wrong, if memory data haven't brush to disk, will drop the data, if lost the data, even promotion can also have risks,
1, the first innodb_fast_shutdown set to 0, (my) also write this sentence in the CNF),
2, the library and read lock (be prepared machine is broken off synchronization, I usually used to put a load to the database ahead and use it every time the load or directly to the VIP stopped, then the library and read lock, can much better),
No. 3, check the SCN, if the first three number does not change, the last number nine big Numbers, show that no data is written to, can turn it off
4, normally closed (such as normal finish off and restart again, this time don't open load or VIP, ensure no business data in), check the error log (if there is the instance crash recovery hints that it shut not clean, to repeat 1-4),
5, clean off, copy your files to a different machine backup;
6, to prepare the machine upgrade replacement;
7, perform consistency check;
8, try to start and check the log, there is no problem, open business connection, test monitoring and a half hours;
  • Related