Thursday, November 6, 2014

Issue with installing mysql 5.6 on RHel 6.1.


Installing mysql failed half way through. I found out updating the yum get the installation going again.

ERROR with rpm_check_debug vs depsolve:
libmysqlclient.so.16()(64bit) is needed by postfix-2:2.6.6-6.el6_5.x86_64
libmysqlclient.so.16(libmysqlclient_16)(64bit) is needed by postfix-2:2.6.6-6.el6_5.x86_64
You could try running: rpm -Va --nofiles --nodigest
Your transaction was saved, rerun it with: yum load-transaction /tmp/yum_save_tx-2014-11-04-14-043H0I1S.yumtx


Symptom
##################################################################

uname -a
Linux baja 2.6.32-220.el6.x86_64 #1 SMP Wed Nov 9 08:03:13 EST 2011 x86_64 x86_64 x86_64 GNU/Linux

[root@baja Downloads]# ls -lrt
total 227192
-rw-r--r--. 1 root root 232632160 Nov  4 12:56 V47181-01.zip
drwxr-xr-x. 2 root root      4096 Nov  4 13:40 mysql_commercial
-rw-r--r--. 1 root root      5824 Nov  4 13:57 mysql-community-release-el6-5.noarch.rpm
[root@baja Downloads]# rpm -Uvh mysql-community-release-el6-5.noarch.rpm
Preparing...                ########################################### [100%]
   1:mysql-community-release########################################### [100%]
[root@baja Downloads]#



[root@baja Downloads]# yum repolist all|grep mysql
mysql-connectors-community        MySQL Connectors Community     enabled:     12
mysql-connectors-community-source MySQL Connectors Community - S disabled
mysql-tools-community             MySQL Tools Community          enabled:     15
mysql-tools-community-source      MySQL Tools Community - Source disabled
mysql55-community                 MySQL 5.5 Community Server     disabled
mysql55-community-source          MySQL 5.5 Community Server - S disabled
mysql56-community                 MySQL 5.6 Community Server     enabled:     95
mysql56-community-source          MySQL 5.6 Community Server - S disabled
mysql57-community-dmr             MySQL 5.7 Community Server Dev disabled
mysql57-community-dmr-source      MySQL 5.7 Community Server Dev disabled
[root@baja Downloads]#



[root@baja Downloads]# yum install mysql-community-server
Loaded plugins: product-id, refresh-packagekit, rhnplugin, security, subscription-manager
Updating certificate-based repositories.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-server.x86_64 0:5.6.21-2.el6 will be installed
--> Processing Dependency: mysql-community-common(x86-64) = 5.6.21-2.el6 for package: mysql-community-server-5.6.21-2.el6.x86_64
--> Processing Dependency: mysql-community-client(x86-64) = 5.6.21-2.el6 for package: mysql-community-server-5.6.21-2.el6.x86_64
--> Running transaction check
---> Package mysql-community-client.x86_64 0:5.6.21-2.el6 will be installed
--> Processing Dependency: mysql-community-libs(x86-64) = 5.6.21-2.el6 for package: mysql-community-client-5.6.21-2.el6.x86_64
---> Package mysql-community-common.x86_64 0:5.6.21-2.el6 will be installed
--> Running transaction check
---> Package mysql-community-libs.x86_64 0:5.6.21-2.el6 will be obsoleting
---> Package mysql-libs.x86_64 0:5.1.52-1.el6_0.1 will be obsoleted
--> Processing Dependency: libmysqlclient.so.16()(64bit) for package: 2:postfix-2.6.6-2.2.el6_1.x86_64
--> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for package: 2:postfix-2.6.6-2.2.el6_1.x86_64
--> Running transaction check
---> Package postfix.x86_64 2:2.6.6-2.2.el6_1 will be updated
---> Package postfix.x86_64 2:2.6.6-6.el6_5 will be an update
--> Processing Dependency: libssl.so.10(libssl.so.10)(64bit) for package: 2:postfix-2.6.6-6.el6_5.x86_64
--> Processing Dependency: libcrypto.so.10(libcrypto.so.10)(64bit) for package: 2:postfix-2.6.6-6.el6_5.x86_64
--> Processing Dependency: libcrypto.so.10(OPENSSL_1.0.1_EC)(64bit) for package: 2:postfix-2.6.6-6.el6_5.x86_64
--> Processing Dependency: libcrypto.so.10(OPENSSL_1.0.1)(64bit) for package: 2:postfix-2.6.6-6.el6_5.x86_64
--> Running transaction check
---> Package openssl.x86_64 0:1.0.0-20.el6 will be updated
---> Package openssl.x86_64 0:1.0.1e-30.el6_6.2 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================================
Package                                             Arch     Version       Repository             Size
==============================================================================================================

Installing:
mysql-community-libs                                    x86_64  5.6.21-2.el6 mysql56-community     1.9 M
 replacing  mysql-libs.x86_64 5.1.52-1.el6_0.1
mysql-community-server                             x86_64 5.6.21-2.el6   mysql56-community       53 M
Installing for dependencies:
mysql-community-client                             x86_64  5.6.21-2.el6   mysql56-community     18 M
mysql-community-common                             x86_64  5.6.21-2.el6   mysql56-community     299 k
Updating for dependencies:
openssl                                         x86_64  1.0.1e-30.el6_6.2   rhel-x86_64-server-6    1.5 M
postfix                                         x86_64 2:2.6.6-6.el6_5     rhel-x86_64-server-6   2.0 M

Transaction Summary
==============================================================================================================

Install   4 Package(s)
Upgrade   2 Package(s)  
  
  
  

Total download size: 76 M
Is this ok [y/N]: y
Downloading Packages:
Downloading Packages:
(1/6): mysql-community-client-5.6.21-2.el6.x86_64.rpm     |  18 MB 03:16
(2/6): mysql-community-common-5.6.21-2.el6.x86_64.rpm       | 299 kB 00:01
(3/6): mysql-community-libs-5.6.21-2.el6.x86_64.rpm       | 1.9 MB 00:13
(4/6): mysql-community-server-5.6.21-2.el6.x86_64.rpm     |  53 MB 08:46
(5/6): openssl-1.0.1e-30.el6_6.2.x86_64.rpm               | 1.5 MB 00:16
(6/6): postfix-2.6.6-6.el6_5.x86_64.rpm                         | 2.0 MB 00:20
-----------------------------------------------------------------------------------

Total                                           98 kB/s |  76 MB 13:16


warning: rpmts_HdrFromFdno: V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Retrieving key from file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Importing GPG key 0x5072E1F5:
Userid : MySQL Release Engineering <mysql-build@oss.oracle.com>
Package: mysql-community-release-el6-5.noarch (installed)
From   : file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Is this ok [y/N]: y
Running rpm_check_debug
ERROR with rpm_check_debug vs depsolve:
libmysqlclient.so.16()(64bit) is needed by postfix-2:2.6.6-6.el6_5.x86_64
libmysqlclient.so.16(libmysqlclient_16)(64bit) is needed by postfix-2:2.6.6-6.el6_5.x86_64
You could try running: rpm -Va --nofiles --nodigest
Your transaction was saved, rerun it with: yum load-transaction /tmp/yum_save_tx-2014-11-04-14-043H0I1S.yumtx


#################################################################################

Update the yum. I use RHel Update Manager to update all dependencies.






Rerun the installation.

#################################################################################

[root@baja Downloads]# yum install mysql-community-server
Loaded plugins: product-id, refresh-packagekit, rhnplugin, security, subscription-manager
This system is receiving updates from RHN Classic or RHN Satellite.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-server.x86_64 0:5.6.21-2.el6 will be installed
--> Processing Dependency: mysql-community-client(x86-64) = 5.6.21-2.el6 for package: mysql-community-server-5.6.21-2.el6.x86_64
--> Running transaction check
---> Package mysql-community-client.x86_64 0:5.6.21-2.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===============================================================================================
Package                           Arch       Version         Repository             Size
===============================================================================================
Installing:
mysql-community-server             x86_64      5.6.21-2.el6    ysql56-community       53 M
Installing for dependencies:
mysql-community-client             x86_64      5.6.21-2.el6   mysql56-community      18 M

Transaction Summary
===============================================================================================
Install   2 Package(s)

Total size: 70 M
Installed size: 317 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : mysql-community-client-5.6.21-2.el6.x86_64       1/2
  Installing : mysql-community-server-5.6.21-2.el6.x86_64   2/2
  Verifying  : mysql-community-client-5.6.21-2.el6.x86_64     1/2
  Verifying  : mysql-community-server-5.6.21-2.el6.x86_64     2/2

  

Installed:
  mysql-community-server.x86_64 0:5.6.21-2.el6

Dependency Installed:
  mysql-community-client.x86_64 0:5.6.21-2.el6

Complete!
[root@baja Downloads]#



Success installs on RHel! The key is making sure the YUM did get updated. Before stumbled into this, I have tried a lot of other things and messing with the libraries due to bogus dependencies messages.

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

mysql listener not started yet


ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)



[root@baja ~]# service mysqld start
Initializing MySQL database:  2014-11-05 15:37:33 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-11-05 15:37:33 17834 [Note] InnoDB: Using atomics to ref count buffer pool pages
2014-11-05 15:37:33 17834 [Note] InnoDB: The InnoDB memory heap is disabled
2014-11-05 15:37:33 17834 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-11-05 15:37:33 17834 [Note] InnoDB: Memory barrier is not used
2014-11-05 15:37:33 17834 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-11-05 15:37:33 17834 [Note] InnoDB: Using Linux native AIO
2014-11-05 15:37:33 17834 [Note] InnoDB: Using CPU crc32 instructions
2014-11-05 15:37:33 17834 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2014-11-05 15:37:33 17834 [Note] InnoDB: Completed initialization of buffer pool
2014-11-05 15:37:33 17834 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2014-11-05 15:37:33 17834 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2014-11-05 15:37:33 17834 [Note] InnoDB: Database physically writes the file full: wait...
2014-11-05 15:37:33 17834 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2014-11-05 15:37:35 17834 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2014-11-05 15:37:36 17834 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2014-11-05 15:37:36 17834 [Warning] InnoDB: New log files created, LSN=45781
2014-11-05 15:37:36 17834 [Note] InnoDB: Doublewrite buffer not found: creating new
2014-11-05 15:37:36 17834 [Note] InnoDB: Doublewrite buffer created
2014-11-05 15:37:36 17834 [Note] InnoDB: 128 rollback segment(s) are active.
2014-11-05 15:37:36 17834 [Warning] InnoDB: Creating foreign key constraint system tables.
2014-11-05 15:37:36 17834 [Note] InnoDB: Foreign key constraint system tables created
2014-11-05 15:37:36 17834 [Note] InnoDB: Creating tablespace and datafile system tables.
2014-11-05 15:37:36 17834 [Note] InnoDB: Tablespace and datafile system tables created.
2014-11-05 15:37:36 17834 [Note] InnoDB: Waiting for purge to start
2014-11-05 15:37:36 17834 [Note] InnoDB: 5.6.21 started; log sequence number 0
2014-11-05 15:37:37 17834 [Note] Binlog end
2014-11-05 15:37:37 17834 [Note] InnoDB: FTS optimize thread exiting.
2014-11-05 15:37:37 17834 [Note] InnoDB: Starting shutdown...
2014-11-05 15:37:39 17834 [Note] InnoDB: Shutdown completed; log sequence number 1625977


2014-11-05 15:37:39 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-11-05 15:37:39 17857 [Note] InnoDB: Using atomics to ref count buffer pool pages
2014-11-05 15:37:39 17857 [Note] InnoDB: The InnoDB memory heap is disabled
2014-11-05 15:37:39 17857 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-11-05 15:37:39 17857 [Note] InnoDB: Memory barrier is not used
2014-11-05 15:37:39 17857 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-11-05 15:37:39 17857 [Note] InnoDB: Using Linux native AIO
2014-11-05 15:37:39 17857 [Note] InnoDB: Using CPU crc32 instructions
2014-11-05 15:37:39 17857 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2014-11-05 15:37:39 17857 [Note] InnoDB: Completed initialization of buffer pool
2014-11-05 15:37:39 17857 [Note] InnoDB: Highest supported file format is Barracuda.
2014-11-05 15:37:39 17857 [Note] InnoDB: 128 rollback segment(s) are active.
2014-11-05 15:37:39 17857 [Note] InnoDB: Waiting for purge to start
2014-11-05 15:37:39 17857 [Note] InnoDB: 5.6.21 started; log sequence number 1625977
2014-11-05 15:37:39 17857 [Note] Binlog end
2014-11-05 15:37:39 17857 [Note] InnoDB: FTS optimize thread exiting.
2014-11-05 15:37:39 17857 [Note] InnoDB: Starting shutdown...
2014-11-05 15:37:41 17857 [Note] InnoDB: Shutdown completed; log sequence number 1625987




PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

  /usr/bin/mysqladmin -u root password 'new-password'
  /usr/bin/mysqladmin -u root -h baja password 'new-password'

Alternatively you can run:

  /usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

Please report any problems at http://bugs.mysql.com/

The latest information about MySQL is available on the web at

  http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

Note: new default config file not created.
Please make sure your config file is current

WARNING: Default config file /etc/my.cnf exists on the system
This file will be read by default by the MySQL server
If you do not want to use this, either remove it, or use the
--defaults-file argument to mysqld_safe when starting the server

                                                           [  OK  ]
Starting mysqld:                                           [  OK  ]
[root@baja ~]#

That resolved the issue. If it does not try this.
sudo chmod -R 777 /var/lib/mysql/

mySql user/schema

#checking current user
mysql> select current_user();
+----------------+
| current_user() |
+----------------+
| root@localhost |
+----------------+


# find user
mysql> select distinct user from mysql.user;
+-------+
| user  |
+-------+
| myone |
| root  |
|       |
+-------+
3 rows in set (0.00 sec)



## needs the tick
mysql> create user mytwo identified by mypassword;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mypassword' at line 1


## create user successfully.
mysql> create user mytwo identified by 'mypassword';;
Query OK, 0 rows affected (0.00 sec)



#new user created
mysql> select distinct user from mysql.user;
+-------+
| user  |
+-------+
| myone |
| mytwo |
| root  |
|       |
+-------+
4 rows in set (0.00 sec)


#changing user password
mysql> set password for mytwo = password('mypassword123');
Query OK, 0 rows affected (0.00 sec)


##drop user
mysql> drop user myone;
Query OK, 0 rows affected (0.00 sec)



## select user
mysql> select distinct user from mysql.user;
+-------+
| user  |
+-------+
| mytwo |
| root  |
|       |
+-------+
3 rows in set (0.00 sec)



## rename user, Oracle can't do this.
mysql> rename user mytwo to myone;
Query OK, 0 rows affected (0.00 sec)



## verify user has been renamed.
mysql> select distinct user from mysql.user;
+-------+
| user  |
+-------+
| myone |
| root  |
|       |
+-------+
3 rows in set (0.00 sec)

## where all history stored.
$HOME/.mysql_history


mysqld - works in any platform. It just startup mysql