mysql5.5 To upgrade to 5.7

1. download mysql5.7.32

Official download address


tar xvf mysql.tar.gz mysql/

2. Enter the old mysql Of bin Export under Directory mysql The data of

./mysql -uroot -pxxxx -h127.0.0.1 -P3306 </home/mysql5.5/bin/all.sql

3. Enter the new mysql Create a file under the root directory to store data data Catalog

mkdir data

4. For the new database just decompressed , First, execute the initialization command

cd bin
./mysql_install_db --basedir=../ --datadir=../data

PS: The above upgrade is in Cent OS Upper , But when I won Kirin's promotion , I don't know the above sentence , You need to replace it with the following initialization statement

./mysqld --defaults-file=../my.cnf --basedir=../ --datadir=../data --user=root --initialize

5. Set skip password login

stay my.cnf Medium [mysqld] Add skip-grant-tables

my.cnf Configuration file for database

6. Start the service

./mysqld --defaults-file=../my.cnf --basedir=../ --datadir=../data --user=root

7. Set the password

Login in a new command line window mysql

./mysql -uroot
use mysql;
update mysql.user set authentication_string=password('xxxx') where user='root';

8. Out of Service

Comment out... In the configuration file skip-grant-tables


9. Start the service


./mysqld --defaults-file=../my.cnf --basedir=../ --datadir=../data --user=root


10. New command line login

./mysql -uroot -pxxxx
use mysql;

This is the time : No matter what command you run , Always prompt this You must reset your password using ALTER USER statement before executing this statement.

Now execute the following statement


11. Set other ip Can be connected mysql

use mysql;
grant all privileges on *.* to "root"@"%" identified by "xxxx";

12. Import historical data

cd bin
./mysql -uroot -pxxxx -h127.0.0.1 -P3306 </home/mysql5.5/bin/all.sql

12. Perform the update

cd bin

13. After upgrading, the query statement may report an error , You can execute the following statement


mysql5.5 To upgrade to 5.7 More articles about

  1. mysql5.x To upgrade to mysql5.7 After importing before database date Solutions to errors !

    mysql5.x To upgrade to mysql5.7 After importing before database date Solutions to errors ! modify mysql5.7 The configuration file of , The method is as follows : linux edition : find mysql The default installation path is /usr/shar ...

  2. CentOS6.4 take MySQL5.1 To upgrade to 5.5.36

    1. For safety , First, you need to back up the original data 2. Uninstall the original MySQL, First stop the original MySQL service , To find the find / -name mysql [root@qxyw /]# find / -name mys ...

  3. Linux CentOS6 In the environment MySQL5.1 To upgrade to MySQL5.5 Version process

    Reprinted address : Lao Zuo is helping his friend's blog move to another one today VPS Host environment , The environment is LLSMP Architecturally , The original server was LNMP Website environment , Its ...

  4. MySQL5.5 To upgrade to 5.7

    One . Download install free MySQL5.7 package The download page Download link Two . Replace mysql Installation directory decompression mysql5.7 tar -zxf mysql-5.7.23-linux-glibc2.12-x86_64.ta ...

  5. mysql5.x Upgrade to mysql5.7 After importing before database date Quick solutions to errors 【mysql The solution to the problem of importing low version data to high version 】

    mysql5.x To upgrade to mysql5.7 After importing before database date error , This is because MySQL Of sql_mode Influence , The solution is as follows : [ Specific reference :mysql Of sql_mode Detailed explanation ] modify mysql5.7 Of ...

  6. MySQL Database upgrade

    At present, the database of many systems is still MySQL5.6, because MySQL5.7 And MySQL8.0 There is a big improvement in performance and safety , So you need to upgrade the database . In this paper, through the logical way . Physical upgrade to introduce MySQL5.6 To upgrade to M ...

  7. centos6.5 Environmental access OA database mysql5.0.67 To upgrade to mysql5.5.48 programme

    centos6.5 Environmental access OA database mysql5.0.67 To upgrade to mysql5.5.42 programme The overall plan : Environmental preparation , Install... On standby server mysql5.5 database 1. Disable application access to the production environment Directly modifying web A visit to ...

  8. phpstudy Of mysql Version upgrade to 5.7

    phpstudy Installed mysql The version is usually 5.5 or 5.4 Of , But sometimes you have to use mysql5.7 edition , So let's take a look at how to phpstudy In this environment, we will mysql Version upgrade to 5.7 Warm reminder : ...

  9. original :mysql5 Restore to mysql 8.0.11 Database link configuration error ( There are three changes

    original :mysql5 Restore to mysql 8.0.11 There are three errors in database link configuration : a) mysql Connect jar Package version modification b) Class path modification c) Configure connection pool address modification Due to version upgrade , First of all, we need to modify 1:mysql- ...

  10. CENTOS 6.5 Platform offline compilation and installation Mysql5.6.22

    One . Download source package Two . preparation This machine comes with before unloading MYSQL install  cmake, Ed ...

Random recommendation

  1. C And a pointer 3.9 Scope 、 Examples of storage types

    ; extern int b; static int c; int d( int e ) { ; register int b; ; extern int a; ... { int e; int a; ...

  2. IOS Development of —— Login encryption may be used , Reverse string

    - (NSString *)stringByReversed{//    NSMutableString *s = [NSMutableString string];//    for (NSUInt ...

  3. linux What about forgetting the password , How to reset the password

    Article transferred from : Here's how to do it online , I used the first method , It has been tested to be effective . Method 1 :# /etc/init.d/mysql stop ...

  4. BZOJ 1449 Team revenue ( Minimum cost and maximum flow )

    Topic link : The question : Ideas : First , Let's assume the following M It's a game where both sides lose , That is, at the beginning lose[i] Again ...

  5. safari Cross to chrome

    tell application "Safari" set theURL to URL of front document set the clipboard to theURL ...

  6. Very simple problem - SGU 111( The square root of a large number )

    analysis : Using the method of constructing new numbers to continuously construct , And then close to every digit , And then use c++ I knocked with my bare hands 240 Many lines of code , It's over ........................ A great sense of accomplishment . The code is as follows : ========== ...

  7. About auto refresh CSS

    Due to the recent system adjustment, a lot of css, I hope users can see it immediately when browsing css Change of , Instead of continuing to see the cache on the client css. I found it on the Internet , I found that a lot of people recommended one called cssrefresh Gadgets . http://w ...

  8. 2733: Judgement of leap year -poj

    2733: Judgement of leap year Total time limit :  1000ms Memory limit :  65536kB describe Judge whether a year is a leap year . Input There is only one line of input , Contains an integer a(0 < a < 3000) Output a line , If ...

  9. android emulator Two ways to start

    android emulator Two ways to start     turn about android Learners' , model ...

  10. SharePoint PowerShell Start workflow

    Preface lately , There is a need. , You need to update the contents of the list in batch , Usually these operations , Use both powershell To complete , however ,powershell Need to operate on the server , And the server authority needs to be checked by the customer , therefore , This time, we'll consider not using orders ...