Ошибка 08s01 bad handshake

We recently upgraded from MySQL 5.1.41 to 5.1.61 on our Ubuntu 10.04LTS server. We have an ancient RoR web app that’s now giving a bad handshake error:

Mysql::Error in MainController#index

#08S01Bad handshake

/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/vendor/mysql.rb:523:in `read'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/vendor/mysql.rb:153:in `real_connect'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/mysql_adapter.rb:389:in `connect'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/mysql_adapter.rb:152:in `initialize'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/mysql_adapter.rb:82:in `new'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/mysql_adapter.rb:82:in `mysql_connection'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:262:in `send'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:262:in `connection_without_query_cache='
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/query_cache.rb:54:in `connection='
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:230:in `retrieve_connection'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:78:in `connection'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:763:in `columns'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:2060:in `attributes_from_column_definition_without_lock'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/locking/optimistic.rb:45:in `attributes_from_column_definition'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1502:in `initialize_without_callbacks'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/callbacks.rb:225:in `initialize'
#{RAILS_ROOT}/app/controllers/application.rb:48:in `new'
#{RAILS_ROOT}/app/controllers/application.rb:48:in `log_info'
/usr/local/bin/mongrel_rails:19:in `load'
/usr/local/bin/mongrel_rails:19

I googled around and stumbled onto http://bugs.ruby-lang.org/issues/5017 which tells me it’s a Ruby MySQL extension bug. We aren’t using the MySQL gem. Our web app is incredibly old and fragile (Ruby v1.8.7, Rails v1.2.3, Mongrel 1.1.5). We’re in the process of replacing it with a Django rewrite, so we just need to get this functional for the next few weeks until we will replace it with the new site.

How can we get past this error? I’m thinking that downgrading to MySQL 5.1.41 is the best way to handle this, and then when we begin using the new site in a few weeks, we can re-upgrade to 5.1.61. However, I’m having an issue downgrading mysql. This is the command I’m using:

sudo aptitude install mysql-server-5.1=5.1.41-3ubuntu12.10

However, this tells me Unable to find a version "5.1.41-3ubuntu12.10" for the package "mysql-server-5.1". I’ve tried sudo aptitude install mysql-server-5.1=5.1.41 also, but that didn’t work either. How can I have aptitude install the correct version of MySQL?

Bug description

Hi, I’ve been trying to set up SSL for my prisma connection but I’m getting a «Bad Handshake» error, even though on MySQL Workbench, tableplus… my connection works fine with certificates.
I’ve followed the guide on the prisma docs website here. And placed both client-identity.p12 and rootca.cert inside my ./prisma folder.
The connection string i’m using is:
'mysql://user:password@ip:port/database?sslidentity=client-identity.p12&sslpassword=mypassword&sslcert=rootca.cart'

Prisma information

generator client {
  provider = "prisma-client-js"
}

datasource db {
  provider = "mysql"
  url      = env("DATABASE_URL")
}

Environment & setup

Trying to connect to: MySQL Server V8.0.31 @ Ubuntu 22.04

Prisma Version

prisma                  : 4.7.1
@prisma/client          : 4.7.1

I’m having problem to connect to the remote DB from the terminal as follow

mysql -u db_user -p -h 10.100.1.100
Enter password:

afer entering password I’m getting that error:

ERROR 1043 (08S01): Bad handshake

and I can connect to the DB from a PC using MySQL Workbench.

Running MySQL Ver 14.14 Distrib 5.1.73 for CentOS6

Rick James's user avatar

Rick James

2,4631 gold badge6 silver badges13 bronze badges

asked Jun 28, 2019 at 19:54

JackTheKnife's user avatar

6

Is connector are compatible with your version? (if you upgraded db recently this may be case) Or Possibly bug try with upgraded version on both db and connector. I can see some similar bugs on mysql portals. Bad handshake most of the time mean both master and clients are not compatible.

answered Jun 29, 2019 at 4:58

asktyagi's user avatar

asktyagiasktyagi

2,8602 gold badges8 silver badges25 bronze badges

You must log in to answer this question.

Not the answer you’re looking for? Browse other questions tagged

.

If you have encountered the error message “#08S01Bad handshake” while using Ruby on Rails with MySQL, it might be because of a version mismatch between them. In this guide, we will walk you through the steps to downgrade MySQL to resolve this issue.

Step 1: Check your current MySQL version

Open your terminal and enter the following command to check your current MySQL version:

mysql --version

If your MySQL version is higher than 5.7.5, then this could be the reason for the handshake error.

Step 2: Uninstall current MySQL version

To uninstall the current version of MySQL, enter the following command in your terminal:

brew uninstall mysql

This command will uninstall the current version of MySQL from your system.

Step 3: Install MySQL version 5.7.5

To install MySQL version 5.7.5, enter the following command in your terminal:

brew install mysql@5.7.5

This command will install MySQL version 5.7.5 on your system.

Step 4: Start MySQL service

To start the MySQL service, enter the following command in your terminal:

brew services start mysql@5.7.5

This command will start the MySQL service on your system.

Step 5: Verify MySQL version

To verify that MySQL version 5.7.5 has been installed successfully, enter the following command in your terminal:

mysql --version

This command should now display the installed version of MySQL.

Step 6: Update database.yml file

Update the `database.yml` file to use the new MySQL version. Open the file and update the `adapter` and `socket` fields as follows:

development:
  adapter: mysql2
  encoding: utf8mb4
  pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
  username: root
  password:
  host: localhost
  port: 3306
  socket: /tmp/mysql.sock

Change the `adapter` field to `mysql2` and the `socket` field to `/tmp/mysql.sock`.

Step 7: Restart Rails server

Restart the Rails server to apply the changes made to the `database.yml` file. Enter the following command in your terminal:

rails server

You have now downgraded MySQL to version 5.7.5 and resolved the “#08S01Bad handshake” error. Your Ruby on Rails application should now work without any issues.

Bug description

Hi, I’ve been trying to set up SSL for my prisma connection but I’m getting a «Bad Handshake» error, even though on MySQL Workbench, tableplus… my connection works fine with certificates.
I’ve followed the guide on the prisma docs website here. And placed both client-identity.p12 and rootca.cert inside my ./prisma folder.
The connection string i’m using is:
'mysql://user:password@ip:port/database?sslidentity=client-identity.p12&sslpassword=mypassword&sslcert=rootca.cart'

Prisma information

generator client {
  provider = "prisma-client-js"
}

datasource db {
  provider = "mysql"
  url      = env("DATABASE_URL")
}

Environment & setup

Trying to connect to: MySQL Server V8.0.31 @ Ubuntu 22.04

Prisma Version

prisma                  : 4.7.1
@prisma/client          : 4.7.1

When starting a new connection to MySQL database, all database credentials are correct, then you get an error saying “Bad Handshake when trying to connect”.

This is likely because of the version mismatch of MySQL server that leads to the failed authentication. You are either:

  • Using an old version of MySQL on your client to connect to the server with a newer MySQL version.
  • Using a new version of MySQL on your client to connect to the server with an old MySQL version.

The newer MySQL versions might use a different protocol for the connection, thus causes the bad handshake issue when there’s a version mismatch. For example, using MySQL 8.0 on your local environment might not be able to connect to the server using MySQL 5.7.

To solve this problem, you should:

  • Check the versions of both your local and remote server, then install the same version on both environments.
  • Use a client that supports multiple versions of MySQL to avoid the risk of updating the server and potentially damaging data.

TablePlus includes multiple MySQL binaries in the GUI client so you should be able to connect to any the MySQL server of any versions.

MySQL multiple versions

That should fix the problem now.


Need a good GUI tool for databases? TablePlus provides a native client that allows you to access and manage Oracle, MySQL, SQL Server, PostgreSQL, and many other databases simultaneously using an intuitive and powerful graphical interface.

Download TablePlus for Mac.

Not on Mac? Download TablePlus for Windows.

On Linux? Download TablePlus for Linux

Need a quick edit on the go? Download TablePlus for iOS

TablePlus in Dark mode

Answer by Lauryn Wise

make sure you’ve installed mysql-connector and not mysql-connector-python, to make this sure just run the following commands: pip3 uninstall mysql-connector-python pip3 install mysql-connector,

2

This was my problem, I was using pyCharm and it installed mysql-connector-python so I had to follow your recommendation to uninstall it and install the right one in my venv environment.

– fanbondi

Mar 1 at 9:18

,I am trying to connect to a mysql database (hosted on media temple) with my python script (ran locally) but I am receiving an error when I run it. ,Connect and share knowledge within a single location that is structured and easy to search.

The error is:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/mysql/connector/connection_cext.py", line 179, in _open_connection
    self._cmysql.connect(**cnx_kwargs)
_mysql_connector.MySQLInterfaceError: Bad handshake

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/Charlie/Documents/python/myscript/mysql_insert.py", line 8, in <module>
    port="3306"
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/mysql/connector/__init__.py", line 172, in connect
    return CMySQLConnection(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/mysql/connector/connection_cext.py", line 78, in __init__
    self.connect(**kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/mysql/connector/abstracts.py", line 735, in connect
    self._open_connection()
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/mysql/connector/connection_cext.py", line 182, in _open_connection
    sqlstate=exc.sqlstate)
mysql.connector.errors.OperationalError: 1043 (08S01): Bad handshake

Here is the code from the script

import mysql.connector

mydb = mysql.connector.connect(
  host="external-db.s157688.gridserver.com",
  user="myusername",
  passwd="mypassword",
  database="mydatabase",
  port="3306"
)

mycursor = mydb.cursor()

sql = "INSERT INTO test (post_id, title) VALUES (%s, %s)"
val = [
  ('Peter', 'Lowstreet 4'),
  ('Amy', 'Apple st 652'),
  ('Hannah', 'Mountain 21'),
  ('Michael', 'Valley 345'),
  ('Sandy', 'Ocean blvd 2'),
  ('Betty', 'Green Grass 1'),
  ('Richard', 'Sky st 331'),
  ('Susan', 'One way 98'),
  ('Vicky', 'Yellow Garden 2'),
  ('Ben', 'Park Lane 38'),
  ('William', 'Central st 954'),
  ('Chuck', 'Main Road 989'),
  ('Viola', 'Sideway 1633')
]

mycursor.executemany(sql, val)

mydb.commit()

print(mycursor.rowcount, "was inserted.")

Answer by Clayton Rice

After updating mysql-connector-python to 8.0.11 (released April 19, 2018), I received an «OperationalError: 1043 (08S01): Bad handshake» error when querying a MySQL database. I found that I needed to set ‘use_pure: True’ in the connection string.,The C extension was added in version 2.1.1 and is enabled by default as of 8.0.11. The use_pure option determines whether the Python or C version of this connector is enabled and used.1,Since I don’t have the C extension installed on my server, I reverted back to the Python implementation. Though it is good to know that the C extension can improve performance for large queries—something to tuck away for future use.

For example2:

import mysql.connector

config = {
  'user': 'scott',
  'password': 'password',
  'host': '127.0.0.1',
  'database': 'employees',
  'use_pure': True,
}

cnx = mysql.connector.connect(**config)

Answer by Conner Choi

afer entering password I’m getting that error:,There is old Bug Report about MySQL Workbench connecting to older databases.,When you google the subject of «mysql bad handshake», you will see two basic issues:,

Help Center

Detailed answers to any questions you might have

I’m having problem to connect to the remote DB from the terminal as follow

mysql -u db_user -p -h 10.100.1.100
Enter password:

afer entering password I’m getting that error:

ERROR 1043 (08S01): Bad handshake

Answer by Axl Freeman

Trying to connect to the database and getting a really weird error. Tried doing this without aiomysql but rather directly with PyMySQL and the connection worked fine. Would greatly appreciate some help.,

The text was updated successfully, but these errors were encountered:
,
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
,

Sorry, something went wrong.

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/aiomysql/connection.py", line 447, in _connect
    yield from self._request_authentication()
  File "/usr/local/lib/python3.5/dist-packages/aiomysql/connection.py", line 615, in _request_authentication
    auth_packet = yield from self._read_packet()
  File "/usr/local/lib/python3.5/dist-packages/aiomysql/connection.py", line 500, in _read_packet
    packet.check_error()
  File "/usr/local/lib/python3.5/dist-packages/pymysql/connections.py", line 393, in check_error
    err.raise_mysql_exception(self._data)
  File "/usr/local/lib/python3.5/dist-packages/pymysql/err.py", line 120, in raise_mysql_exception
    _check_mysql_exception(errinfo)
  File "/usr/local/lib/python3.5/dist-packages/pymysql/err.py", line 115, in _check_mysql_exception
    raise InternalError(errno, errorvalue)
pymysql.err.InternalError: (1043, 'Bad handshake')

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3.5/code.py", line 91, in runcode
    exec(code, self.locals)
  File "<input>", line 22, in <module>
  File "/usr/lib/python3.5/asyncio/base_events.py", line 373, in run_until_complete
    return future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result
    raise self._exception
  File "/usr/lib/python3.5/asyncio/tasks.py", line 240, in _step
    result = coro.send(None)
  File "<input>", line 11, in test_example
  File "/usr/local/lib/python3.5/dist-packages/aiomysql/utils.py", line 57, in __await__
    resp = yield from self._coro
  File "/usr/local/lib/python3.5/dist-packages/aiomysql/pool.py", line 28, in _create_pool
    yield from pool._fill_free_pool(False)
  File "/usr/local/lib/python3.5/dist-packages/aiomysql/pool.py", line 163, in _fill_free_pool
    **self._conn_kwargs)
  File "/usr/local/lib/python3.5/dist-packages/aiomysql/utils.py", line 52, in __iter__
    resp = yield from self._coro
  File "/usr/local/lib/python3.5/dist-packages/aiomysql/connection.py", line 76, in _connect
    yield from conn._connect()
  File "/usr/local/lib/python3.5/dist-packages/aiomysql/connection.py", line 467, in _connect
    self._host) from e
pymysql.err.OperationalError: (2003, "Can't connect to MySQL server on 'XXX.XXX.XXX.XXX'")

Answer by Rosalia Macdonald

Content reproduced on this site is the property of the
respective copyright holders.It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.

The file you have requested (bug.php?id=91828)
does not exist.

bug.php?id=91828

I’m having problem to connect to the remote DB from the terminal as follow

mysql -u db_user -p -h 10.100.1.100
Enter password:

afer entering password I’m getting that error:

ERROR 1043 (08S01): Bad handshake

and I can connect to the DB from a PC using MySQL Workbench.

Running MySQL Ver 14.14 Distrib 5.1.73 for CentOS6

RolandoMySQLDBA's user avatar

asked Jun 28, 2019 at 20:21

JackTheKnife's user avatar

There is old Bug Report about MySQL Workbench connecting to older databases.

  • Bug #91828 : Bad handshake since 8.0.12

Others have come across this

  • Can’t connect to MySQL server on MySQLCC ERROR 1043 Bad Handshake
  • SOLVED: Bad Handshake – MySQL Workbench Failed To Connect To SQL
  • Devart Forums : Bad Handshake

When you google the subject of «mysql bad handshake», you will see two basic issues:

  • Older Versions of MySQL
  • Older Versions of ODBC/JDBC Drivers

The second post I referred to actually recommends «dummying down» and using an older product (MySQL Administrator for you Old School DBAs like myself).

Main thing to do is to make sure your drivers match the version of Workbench you are using. BTW Don’t feel bad about using MySQL 5.1. There are still a lot of die-hards out there that are using (I hope you sitting down), MySQL 3.23.58.

WHAT TO DO

Use Older Versions of MySQL Workbench, Navicat, SquirrelSQL.

Hey, that worked in the second post (Click Here for Those Tools)

Please remember that MySQL 5.1 made allowances for MySQL 4.1 password authentication. Newer ODBC/JDBC drivers may not understand MySQL 5.1’s way of authenticating and other network-related things, colloquially called «BAD HANDSHAKE».

Community's user avatar

answered Jun 28, 2019 at 22:42

RolandoMySQLDBA's user avatar

RolandoMySQLDBARolandoMySQLDBA

177k32 gold badges307 silver badges505 bronze badges

We recently upgraded from MySQL 5.1.41 to 5.1.61 on our Ubuntu 10.04LTS server. We have an ancient RoR web app that’s now giving a bad handshake error:

Mysql::Error in MainController#index

#08S01Bad handshake

/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/vendor/mysql.rb:523:in `read'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/vendor/mysql.rb:153:in `real_connect'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/mysql_adapter.rb:389:in `connect'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/mysql_adapter.rb:152:in `initialize'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/mysql_adapter.rb:82:in `new'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/mysql_adapter.rb:82:in `mysql_connection'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:262:in `send'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:262:in `connection_without_query_cache='
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/query_cache.rb:54:in `connection='
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:230:in `retrieve_connection'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:78:in `connection'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:763:in `columns'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:2060:in `attributes_from_column_definition_without_lock'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/locking/optimistic.rb:45:in `attributes_from_column_definition'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1502:in `initialize_without_callbacks'
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/callbacks.rb:225:in `initialize'
#{RAILS_ROOT}/app/controllers/application.rb:48:in `new'
#{RAILS_ROOT}/app/controllers/application.rb:48:in `log_info'
/usr/local/bin/mongrel_rails:19:in `load'
/usr/local/bin/mongrel_rails:19

I googled around and stumbled onto http://bugs.ruby-lang.org/issues/5017 which tells me it’s a Ruby MySQL extension bug. We aren’t using the MySQL gem. Our web app is incredibly old and fragile (Ruby v1.8.7, Rails v1.2.3, Mongrel 1.1.5). We’re in the process of replacing it with a Django rewrite, so we just need to get this functional for the next few weeks until we will replace it with the new site.

How can we get past this error? I’m thinking that downgrading to MySQL 5.1.41 is the best way to handle this, and then when we begin using the new site in a few weeks, we can re-upgrade to 5.1.61. However, I’m having an issue downgrading mysql. This is the command I’m using:

sudo aptitude install mysql-server-5.1=5.1.41-3ubuntu12.10

However, this tells me Unable to find a version "5.1.41-3ubuntu12.10" for the package "mysql-server-5.1". I’ve tried sudo aptitude install mysql-server-5.1=5.1.41 also, but that didn’t work either. How can I have aptitude install the correct version of MySQL?

I’m having problem to connect to the remote DB from the terminal as follow

mysql -u db_user -p -h 10.100.1.100
Enter password:

afer entering password I’m getting that error:

ERROR 1043 (08S01): Bad handshake

and I can connect to the DB from a PC using MySQL Workbench.

Running MySQL Ver 14.14 Distrib 5.1.73 for CentOS6

Rick James's user avatar

asked Jun 28, 2019 at 19:54

JackTheKnife's user avatar

6

Is connector are compatible with your version? (if you upgraded db recently this may be case) Or Possibly bug try with upgraded version on both db and connector. I can see some similar bugs on mysql portals. Bad handshake most of the time mean both master and clients are not compatible.

answered Jun 29, 2019 at 4:58

asktyagi's user avatar

asktyagiasktyagi

2,5711 gold badge5 silver badges22 bronze badges

C

I upgraded an old server from 5.1.34sp1 to 5.1.67 some time back… that was about the same amount of «jump» in minor versions as you are contemplating. In this case, the system worked without incident.
Within the same major release of MySQL (e.g. 5.1.x to 5.1.y), assuming the versions involved are after the GA milestone, upgrading should be relatively straightforward.

For upgrades between versions of a MySQL release series that has reached General Availability status, you can move the MySQL format files and data files between different versions on systems with the same architecture.
— http://dev.mysql.com/doc/refman/5.1/en/upgrading.html

Nevertheless, a complete backup is essential.
Importantly, if you haven’t tried restoring your backup on a different server, then for all practical purposes, you don’t actually have a backup.
Giving you the «ssh commands» (actually, shell commands) to do the upgrade isn’t possible, since there are variations in installation that make it impossible to provide a list of «type these things and it will work» commands. Assuming your current installation is using an Oracle tarball binary distribution, you’ll need to download and extract the binaries into a new directory, stop the server, move or relink the data files where the new copy of MySQL can see them, and rename a couple of directories or change a couple of symlinks. There’s not really a concept of «uninstalling» the old version, since the old version can live harmlessly on your server in a different directory. You just move it out of the way, and if the upgraded version doesn’t start up properly, will often still be able to start the old version back up, if needed. Eventually, you can remove the old directory, with caution, to avoid removing the wrong things.
You’ll need to read the documentation.
http://dev.mysql.com/doc/refman/5.1/en/upgrading.html
http://dev.mysql.com/doc/refman/5.1/en/upgrading-from-previous-series.html
After you do the upgrade, don’t forget to run the mysql_upgrade utility. This utility does not upgrade the version of your server; instead, it upgrades your data files to be fully compatible with the new version you’ve just installed. You run this after you do the upgrade, and after you restart the MySQL server daemon.
http://dev.mysql.com/doc/refman/5.1/en/mysql-upgrade.html
Depending on how well the server was maintained in the past, if it was upgraded in the past, then it’s possible that this was not done when it was upgraded previously. If so, it would actually be a good idea to run it before doing the upgrade, so that all of your structures are all consistent. Two important points, here: The version of the mysql_upgrade utility that you run needs to be the version bundled with the currently running version of the server, and you need to make your backup before you run this. If you have some serious latent structural corruption that can’t be automatically fixed, this can be theoretically be uncovered by mysql_upgrade and the server may shut down to prevent the detected corruption from causing even more serious problems. This is because mysql_upgrade uses CHECK TABLE as part of its work, and:

If CHECK TABLE finds a problem for an InnoDB table, the server may shut down to prevent error propagation. Details of the error will be written to the error log.
— http://dev.mysql.com/doc/refman/5.1/en/check-table.html

This is not a likely scenario, but it’s a documented possibility of which you need to be aware.
As a general rule, the slave server should be upgraded before the master, not after. This is somewhat less critical when remaining within 5.1 (if you were upgrading to 5.5, you absolutely need to upgrade the slaves first) but upgrading the master last is most definitely the most correct approach.
Upgrading the slave first will also give you a better idea of what to expect, and if the slave’s data is consistent with the master, you can always promote it to master if your upgrade of the actual master fails.

Понравилась статья? Поделить с друзьями:
  • Ошибка 080004005 при извлечении
  • Ошибка 08eb пежо 308
  • Ошибка 08p canon g3411
  • Ошибка 080 ивеко дейли
  • Ошибка 0856 volkswagen