install 5.7 version of mysql

Subject:

http://www.tecmint.com/install-latest-mysql-on-rhel-centos-and-fedora/#

2016-04-24 17:55:38gstlouis

Adding the MySQL Yum Repository

--------------- On RHEL/CentOS 7 --------------- # wget http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm

--------------- On RHEL/CentOS 6 --------------- # wget http://dev.mysql.com/get/mysql57-community-release-el6-7.noarch.rpm

--------------- On RHEL/CentOS 5 --------------- # wget http://dev.mysql.com/get/mysql57-community-release-el5-7.noarch.rpm

--------------- On Fedora 23 --------------- # wget http://dev.mysql.com/get/mysql57-community-release-fc23-7.noarch.rpm

--------------- On Fedora 22 --------------- # wget http://dev.mysql.com/get/mysql57-community-release-fc22-7.noarch.rpm

--------------- On Fedora 21 --------------- # wget http://dev.mysql.com/get/mysql57-community-release-fc21-7.noarch.rpm

 

After downloading the package for your Linux platform, now install the downloaded package with the following command.

--------------- On RHEL/CentOS 7 --------------- # yum localinstall mysql57-community-release-el7-7.noarch.rpm

--------------- On RHEL/CentOS 6 --------------- # yum localinstall mysql57-community-release-el6-7.noarch.rpm

--------------- On RHEL/CentOS 5 --------------- # yum localinstall mysql57-community-release-el5-7.noarch.rpm

--------------- On Fedora 23 --------------- # dnf localinstall mysql57-community-release-fc23-7.noarch.rpm

--------------- On Fedora 22 --------------- # dnf localinstall mysql57-community-release-fc22-7.noarch.rpm

--------------- On Fedora 21 --------------- # yum localinstall mysql57-community-release-fc21-7.noarch.rpm

 

Step 2: Installing Latest MySQL Version

5. Install latest version of MySQL (currently 5.7) using the following command.

# yum install mysql-community-server

 

Step 5: Securing the MySQL Installation

9. The command mysql_secure_installation allows you to secure your MySQL installation by performing important settings like setting the root password, removing anonymous users, removing root login, and so on.

Note: MySQL version 5.7 or higher generates a temporary random password in/var/log/mysqld.log after installation.

Use below command to see the password before running mysql secure command.

# grep 'temporary password' /var/log/mysqld.log

Once you know the password you can now run following command to secure your MySQL installation.

# mysql_secure_installation

sample output

Securing the MySQL server deployment. Enter password for user root: Enter New Root Password VALIDATE PASSWORD PLUGIN can be used to test passwords and improve security. It checks the strength of password and allows the users to set only those passwords which are secure enough. Would you like to setup VALIDATE PASSWORD plugin? Press y|Y for Yes, any other key for No: y There are three levels of password validation policy: LOW Length >= 8 MEDIUM Length >= 8, numeric, mixed case, and special characters STRONG Length >= 8, numeric, mixed case, special characters and dictionary file Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 2 Using existing password for root. Estimated strength of the password: 50 Change the password for root ? ((Press y|Y for Yes, any other key for No) : y New password: Set New MySQL Password Re-enter new password: Re-enter New MySQL Password Estimated strength of the password: 100 Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? (Press y|Y for Yes, any other key for No) : y Success. Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y Success. By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y - Dropping test database... Success. - Removing privileges on test database... Success. Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y Success. All done!

gstlouis
vote
2016-04-24 17:57:12

centos 6.8 final
with a previous version install mysql 5.3 (I beleive)

  • on start received 
    • Error: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
  • UNINSTALL AND REINSTALL MySQL 5.6
    • Uninstall MySQL
    • mv /var/lib/mysql /var/lib/mysql_old
    • Reinstall MySQL 
gstlouis
vote
2016-12-02 12:00:14

virtualmin had problems creating a mysql user after this.  The problem was the DB tables where old

Creating MySQL login ..
.. MySQL database failed! : SQL insert into user (host, user, ssl_type, ssl_cipher, x509_issuer, x509_subject, plugin, authentication_string) values ('localhost', 'smbservices', '', '', '', '', 'mysql_native_password', password('G$tlouis78')) failed : Unknown column 'plugin' in 'field list' at /usr/libexec/webmin/web-lib-funcs.pl line 1427.

mysql_upgrade -uroot -p corrected this problem

ref: http://dba.stackexchange.com/questions/78923/mysql-service-stops-after-trying-to-grant-privileges-to-a-user/78927#78927

your problem boils down to a misalignment of grants.

When you run this query

SELECT COUNT(1) column_count FROM information_schema.columns WHERE table_schema='mysql' AND table_name='user';

You should the following number

  • If you get 43, MySQL 5.6
  • If you get 42, MySQL 5.5
  • If you get 39, MySQL 5.1
  • If you get 37, MySQL 5.0

It simply means you forgot one more upgrade step

# mysql_upgrade --upgrade-system-tables

This should fill in the missing columns.

I had also followed the DB back which I re-executed after upgrade

ref: http://mysqlserverteam.com/upgrading-directly-from-mysql-5-0-to-5-6-with-mysqldump/

 

gstlouis
vote
2016-12-02 14:06:54

I went through this installation another time on a new system.  I ran into the problem with the winsock.  This time it was simply because mysqld wasn't started.  on mysql_secure_installation the password wasn't even created yet in grep 'temporary password' /var/log/mysqld.log

once I started mysqld, pass was created and the winsock error didn't exist

gstlouis
vote
2017-07-01 13:15:10