Translate

Friday, 16 May 2014

Installing MySQL on AIX

I am always looking for ways to improve the integration of AIX systems into open-source and Linux environments and thought MySQL would be particularly useful.

1. Start by downloading the following RPMs from http://www.perzl.org/:

mysql-5.1.73-1.aix5.1.ppc.rpm
mysql-bench-5.1.73-1.aix5.1.ppc.rpm
mysql-devel-5.1.73-1.aix5.1.ppc.rpm
mysql-libs-5.1.73-1.aix5.1.ppc.rpm
mysql-server-5.1.73-1.aix5.1.ppc.rpm
mysql-test-5.1.73-1.aix5.1.ppc.rpm
perl-5.8.8-2.aix5.1.ppc.rpm
perl-DBD-MySQL-4.022-1.aix5.1.ppc.rpm
perl-DBI-1.622-1.aix5.1.ppc.rpm
perl-suidperl-5.8.8-2.aix5.1.ppc.rpm
unixODBC-devel-2.3.2-1.aix5.1.ppc.rpm

NOTE: You may need some others to satisfy the RPM prereqs

2. Install the RPMs

# rpm -Uvh perl-5.8.8-2.aix5.1.ppc.rpm
# rpm -Uvh perl-suidperl-5.8.8-2.aix5.1.ppc.rpm
# rpm -Uvh ./perl-DBD-MySQL-4.022-1.aix5.1.ppc.rpm ./perl-DBI-1.622-1.aix5.1.ppc.rpm ./mysql-libs-5.1.73-1.aix5.1.ppc.rpm ./mysql-5.1.73-1.aix5.1.ppc.rpm ./mysql-libs-5.1.73-1.aix5.1.ppc.rpm --nodeps
# rpm -Uvh ./mysql-server-5.1.73-1.aix5.1.ppc.rpm ./mysql-test-5.1.73-1.aix5.1.ppc.rpm ./mysql-bench-5.1.73-1.aix5.1.ppc.rpm

3. Start the MYSQL server:

# /opt/freeware/libexec/mysqld &
Note: you can use lsof or netstat -an to check that the listener is up

# lsof -i :3306
lsof: WARNING: compiled for AIX version 6.1.3.0; this is 6.1.0.0.
COMMAND       PID  USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
mysqld_64 9044136 mysql    4u  IPv4 0xf1000500012793b8      0t0  TCP *:mysql (LISTEN)
lsof: WARNING: /home/root/.lsof_p520-aix61 was updated.


4. Create the MySQL admin user passwords
# /opt/freeware/bin/mysqladmin -u root password 'password'
# /opt/freeware/bin/mysqladmin -u root -h p520-aix61 password 'password'

5. Test the databases have been correctly installed:

# su - mysql
$ /opt/freeware/bin/mysqlcheck --databases mysql -p
Enter password:
mysql.columns_priv                                 OK
mysql.db                                           OK
mysql.event                                        OK
mysql.func                                         OK
mysql.general_log
Error    : You can't use locks with log tables.
status   : OK
mysql.help_category                                OK
mysql.help_keyword                                 OK
mysql.help_relation                                OK
mysql.help_topic                                   OK
mysql.host                                         OK
mysql.ndb_binlog_index                             OK
mysql.plugin                                       OK
mysql.proc                                         OK
mysql.procs_priv                                   OK
mysql.servers                                      OK
mysql.slow_log
Error    : You can't use locks with log tables.
status   : OK
mysql.tables_priv                                  OK
mysql.time_zone                                    OK
mysql.time_zone_leap_second                        OK
mysql.time_zone_name                               OK
mysql.time_zone_transition                         OK
mysql.time_zone_transition_type                    OK
mysql.user                                         OK


6. Ensure that the database server is configured as per your requirements:

# cat /opt/freeware/etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

# To allow mysqld to connect to a MySQL Cluster management daemon, uncomment
# these lines and adjust the connectstring as needed.
#ndbcluster
#ndb-connectstring="nodeid=4;host=localhost:1186"

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

[ndbd]
# If you are running a MySQL Cluster storage daemon (ndbd) on this machine,
# adjust its connection to the management daemon here.
# Note: ndbd init script requires this to include nodeid!
connect-string="nodeid=2;host=localhost:1186"

[ndb_mgm]
# connection string for MySQL Cluster management tool
connect-string="host=localhost:1186"


7. Attempt to run a query:

# ./bin/mysql -p mysql
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.1.73 MySQL Community Server (GPL)

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>
show tables;
+---------------------------+
| Tables_in_mysql           |
+---------------------------+
| columns_priv              |
| db                        |
| event                     |
| func                      |
| general_log               |
| help_category             |
| help_keyword              |
| help_relation             |
| help_topic                |
| host                      |
| ndb_binlog_index          |
| plugin                    |
| proc                      |
| procs_priv                |
| servers                   |
| slow_log                  |
| tables_priv               |
| time_zone                 |
| time_zone_leap_second     |
| time_zone_name            |
| time_zone_transition      |
| time_zone_transition_type |
| user                      |
+---------------------------+
23 rows in set (0.00 sec)

mysql> select * from db;
+------+---------+------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----------------+------------+------------+-----------------------+------------------+------------------+----------------+---------------------+--------------------+--------------+------------+--------------+
| Host | Db      | User | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Grant_priv | References_priv | Index_priv | Alter_priv | Create_tmp_table_priv | Lock_tables_priv | Create_view_priv | Show_view_priv | Create_routine_priv | Alter_routine_priv | Execute_priv | Event_priv | Trigger_priv |
+------+---------+------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----------------+------------+------------+-----------------------+------------------+------------------+----------------+---------------------+--------------------+--------------+------------+--------------+
| %    | test    |      | Y           | Y           | Y           | Y           | Y           | Y         | N          | Y               | Y          | Y          | Y                     | Y                | Y                | Y              | Y                   | N                  | N            | Y          | Y            |
| %    | test\_% |      | Y           | Y           | Y           | Y           | Y           | Y         | N          | Y               | Y          | Y          | Y                     | Y                | Y                | Y              | Y                   | N                  | N            | Y          | Y            |
+------+---------+------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----------------+------------+------------+-----------------------+------------------+------------------+----------------+---------------------+--------------------+--------------+------------+--------------+
2 rows in set (0.00 sec)

mysql> bye;





8. To shutdown MySQL run:

# /opt/freeware/bin/mysqladmin shutdown -p
Enter password:
140516  9:18:07 [Note] /opt/freeware/libexec/mysqld: Normal shutdown

140516  9:18:07 [Note] Event Scheduler: Purging the queue. 0 events
140516  9:18:07 [Note] /opt/freeware/libexec/mysqld: Shutdown complete

[1] +  Done                    /opt/freeware/libexec/mysqld &





Here is the official MySQL installation page:
http://dev.mysql.com/doc/refman/5.1/en/binary-installation.html

4 comments:

  1. Thanks for providing this information.you may also refer-http://www.s4techno.com/blog/2016/07/17/mysql-connection-command/

    ReplyDelete
  2. good evening i have a problem to execute the last instruction when try to install

    error: failed dependencies:
    libcrypto.a(libcrypto.so.1.0.1) is needed by mysql-server-5.1.73-1
    libssl.a(libssl.so.1.0.1) is needed by mysql-server-5.1.73-1
    libcrypto.a(libcrypto.so.1.0.1) is needed by mysql-test-5.1.73-1

    can you help to find the rpm to install ?????

    ReplyDelete
    Replies
    1. the question its about this:
      rpm -Uvh ./mysql-server-5.1.73-1.aix5.1.ppc.rpm ./mysql-test-5.1.73-1.aix5.1.ppc.rpm ./mysql-bench-5.1.73-1.aix5.1.ppc.rpm

      whe run this script apper the message up mentioned

      Delete