Creation Zone

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Friday, 13 June 2008

Installing MySQL 5.0.51b from the Source Code on Sun Solaris

Posted on 01:48 by Unknown
Building and installing the MySQL server from the source code is relatively very easy when compared to many other OSS applications. At least that was my experience. The following simplified installation instructions were based on the MySQL 5.0 Reference Manual .

Steps for setting up the MySQL 5.x environment on Sun Solaris

  1. Create 'mysql' group, then 'mysql' user.

    eg.,

    # mkdir /export/software/mysql
    # groupadd mysql
    # useradd -g mysql -d /export/software/mysql -s /bin/bash mysql
    # passwd mysql
    New Password: mysql
    Re-enter new Password: mysql
    # chown mysql:mysql /export/software/mysql


  2. Login as 'mysql' user; and add the following directories to the PATH environment variable:

    eg.,

    % cat ~/.bashrc

    PATH=/usr/bin:/usr/sbin:/usr/openwin/bin:/usr/ccs/bin:/usr/ucb:/usr/sfw/bin:/opt/csw/bin:/usr/local/bin:.:$PATH
    export PATH


  3. Download MySQL 5.0.51b source code from the location: http://dev.mysql.com/downloads/mysql/5.0.html#source. Download the compressed GNU TAR archive (tar.gz).

  4. Run "configure" with the following options.

    eg.,

    % ./configure --prefix=~/MySQL5051b --enable-shared --enable-thread-safe-client --with-pic --with-debug=no


  5. Run "make all" to build MySQL

    eg.,

    % make all


  6. Run "make install" to install MySQL either in /usr/local directory or the directory specified in "--prefix" during the "configure" task.
    eg.,

    % make install


  7. Initialize the grant tables. "mysql_install_db" program sets up the initial MySQL grant tables containing the privileges that determine how users are allowed to connect to the server. mysql_install_db needs to be run only the first time you install MySQL on Solaris from the source code.

    eg.,

    % pwd
    /export/software/mysql/MySQL5051b/bin

    % ./mysql_install_db --user=mysql

    Installing MySQL system tables...
    OK
    Filling help tables...
    OK

    To start mysqld at boot time you have to copy
    support-files/mysql.server to the right place for your system

    PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
    To do so, start the server, then issue the following commands:
    /export/software/mysql/MySQL5051b/bin/mysqladmin -u root password 'new-password'
    /export/software/mysql/MySQL5051b/bin/mysqladmin -u root -h unknown password 'new-password'

    Alternatively you can run:
    /export/software/mysql/MySQL5051b/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.

    ...
    ...


  8. Start the MySQL server

    eg.,

    % ./mysqld_safe &
    Starting mysqld daemon with databases from /export/software/mysql/MySQL5051b/var


  9. Verify that the server is running

    eg.,

    % ./mysqladmin version
    ./mysqladmin Ver 8.41 Distrib 5.0.51b, for pc-solaris2.11 on i386
    Copyright (C) 2000-2006 MySQL AB
    This software comes with ABSOLUTELY NO WARRANTY. This is free software,
    and you are welcome to modify and redistribute it under the GPL license

    Server version 5.0.51b
    Protocol version 10
    Connection Localhost via UNIX socket
    UNIX socket /tmp/mysql.sock
    Uptime: 4 min 28 sec

    Threads: 1 Questions: 1 Slow queries: 0 Opens: 12 Flush tables: 1 Open tables: 6 Queries per second avg: 0.004


  10. Verify that you can retrieve information from the server.

    • List the existing databases

      eg.,

      % mysqlshow
      +--------------------+
      | Databases |
      +--------------------+
      | information_schema |
      | test |
      +--------------------+


    • List the tables in one of the existing databases.

      eg.,

      % mysqlshow information_schema
      Database: information_schema
      +---------------------------------------+
      | Tables |
      +---------------------------------------+
      | CHARACTER_SETS |
      | COLLATIONS |
      | COLLATION_CHARACTER_SET_APPLICABILITY |
      | COLUMNS |
      | COLUMN_PRIVILEGES |
      | KEY_COLUMN_USAGE |
      | PROFILING |
      | ROUTINES |
      | SCHEMATA |
      | SCHEMA_PRIVILEGES |
      | STATISTICS |
      | TABLES |
      | TABLE_CONSTRAINTS |
      | TABLE_PRIVILEGES |
      | TRIGGERS |
      | USER_PRIVILEGES |
      | VIEWS |
      +---------------------------------------+


    • Retrieve the row count from one of the tables in the "information_schema" database.

      eg.,

      % mysql -e "SELECT COUNT(*) FROM TABLES" information_schema
      +----------+
      | COUNT(*) |
      +----------+
      | 17 |
      +----------+



  11. Finally shutdown the MySQL server. Only privileged MySQL users can shutdown the MySQL server. The grant tables (step #7) step creates a superuser account with username 'root'. This account pertains to MySQL only. It is no way related to the OS username. The initial 'root' account password is empty, so anyone can connect to the MySQL server as 'root' without a password; and be granted all privileges.

    eg.,

    % id
    uid=65539(mysql) gid=104(mysql)

    % ./mysqladmin shutdown
    ./mysqladmin: shutdown failed; error: 'Access denied; you need the SHUTDOWN privilege for this operation'

    % ./mysqladmin -u root shutdown


    Check the other window for the shutdown confirmation where you started the MySQL server.

    % ./mysqld_safe
    Starting mysqld daemon with databases from /export/software/mysql/MySQL5051b/var

    STOPPING server from pid file /export/software/mysql/MySQL5051b/var/unknown.pid
    080612 13:59:09 mysqld ended


    At this point "mysqladmin version" should return an error.

    % ./mysqladmin version
    ./mysqladmin: connect to server at 'localhost' failed
    error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
    Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!

________________
Technorati Tags:
 Sun Solaris |  OpenSolaris |  MySQL
Email ThisBlogThis!Share to XShare to Facebook
Posted in | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • *nix: Workaround to cannot find zipfile directory in one of file.zip or file.zip.zip ..
    Symptom: You are trying to extract the archived files off of a huge (any file with size > 2 GB or 4GB, depending on the OS) ZIP file with...
  • C/C++: Printing Stack Trace with printstack() on Solaris
    libc on Solaris 9 and later, provides a useful function called printstack , to print a symbolic stack trace to the specified file descripto...
  • JDS: Installing Sun Java Desktop System 2.0
    This document will guide you through the process of installing JDS 2.0 on a PC from integrated CDROM images Requirements I...
  • Binary compatibility
    What's It? "Binary compatibility" (BC) is the ability of one machine to run software that was written for another without hav...
  • Solaris: NULL pointer bugs & /usr/lib/0@0.so.1 library
    Some programmers assume that a NULL character pointer is the same as a pointer to a NULL string. However de-referencing a NULL pointer (ie.,...
  • Database: Oracle Server Architecture (overview)
    Oracle server consists of the following core components: 1) database(s) & 2) instance(s) 1) database consists of: 1) datafil...
  • Sun: OpenJDK
    Open source JDK, that is. Sun Microsystems did it again -- As promised during JavaOne event back in May 2006, Sun made the implementation of...
  • Consolidating Siebel CRM 8.0 on a Single Sun SPARC Enterprise Server, T5440
    .. blueprint document is now available on wikis.sun.com . Here is the direct link to the blueprint:              Consolidating Oracle Siebel...
  • Oracle Internet Directory 11g Benchmark on SPARC T5
    SUMMARY System Under Test (SUT)     Oracle's SPARC T5-2 server Software     Oracle Internet Directory 11 g R1-PS6 Target Load     50...
  • Fix to Firefox 3 Crash on Solaris 10 x86
    Symptom : Firefox 3 crashes on Solaris 10 x86 when the web browser tries to render some of the HTML pages with SWF content in them. For exam...

Categories

  • 80s music playlist
  • bandwidth iperf network solaris
  • best
  • black friday
  • breakdown database groups locality oracle pmap sga solaris
  • buy
  • deal
  • ebiz ebs hrms oracle payroll
  • emca oracle rdbms database ORA-01034
  • friday
  • Garmin
  • generic+discussion software installer
  • GPS
  • how-to solaris mmap
  • impdp ora-01089 oracle rdbms solaris tips upgrade workarounds zombie
  • Magellan
  • music
  • Navigation
  • OATS Oracle
  • Oracle Business+Intelligence Analytics Solaris SPARC T4
  • oracle database flashback FDA
  • Oracle Database RDBMS Redo Flash+Storage
  • oracle database solaris
  • oracle database solaris resource manager virtualization consolidation
  • Oracle EBS E-Business+Suite SPARC SuperCluster Optimized+Solution
  • Oracle EBS E-Business+Suite Workaround Tip
  • oracle lob bfile blob securefile rdbms database tips performance clob
  • oracle obiee analytics presentation+services
  • Oracle OID LDAP ADS
  • Oracle OID LDAP SPARC T5 T5-2 Benchmark
  • oracle pls-00201 dbms_system
  • oracle siebel CRM SCBroker load+balancing
  • Oracle Siebel Sun SPARC T4 Benchmark
  • Oracle Siebel Sun SPARC T5 Benchmark T5-2
  • Oracle Solaris
  • Oracle Solaris Database RDBMS Redo Flash F40 AWR
  • oracle solaris rpc statd RPC troubleshooting
  • oracle solaris svm solaris+volume+manager
  • Oracle Solaris Tips
  • oracle+solaris
  • RDC
  • sale
  • Smartphone Samsung Galaxy S2 Phone+Shutter Tip Android ICS
  • solaris oracle database fmw weblogic java dfw
  • SuperCluster Oracle Database RDBMS RAC Solaris Zones
  • tee
  • thanksgiving sale
  • tips
  • TomTom
  • windows

Blog Archive

  • ►  2013 (16)
    • ►  December (3)
    • ►  November (2)
    • ►  October (1)
    • ►  September (1)
    • ►  August (1)
    • ►  July (1)
    • ►  June (1)
    • ►  May (1)
    • ►  April (1)
    • ►  March (1)
    • ►  February (2)
    • ►  January (1)
  • ►  2012 (14)
    • ►  December (1)
    • ►  November (1)
    • ►  October (1)
    • ►  September (1)
    • ►  August (1)
    • ►  July (1)
    • ►  June (2)
    • ►  May (1)
    • ►  April (1)
    • ►  March (1)
    • ►  February (1)
    • ►  January (2)
  • ►  2011 (15)
    • ►  December (2)
    • ►  November (1)
    • ►  October (2)
    • ►  September (1)
    • ►  August (2)
    • ►  July (1)
    • ►  May (2)
    • ►  April (1)
    • ►  March (1)
    • ►  February (1)
    • ►  January (1)
  • ►  2010 (19)
    • ►  December (3)
    • ►  November (1)
    • ►  October (2)
    • ►  September (1)
    • ►  August (1)
    • ►  July (1)
    • ►  June (1)
    • ►  May (5)
    • ►  April (1)
    • ►  March (1)
    • ►  February (1)
    • ►  January (1)
  • ►  2009 (25)
    • ►  December (1)
    • ►  November (2)
    • ►  October (1)
    • ►  September (1)
    • ►  August (2)
    • ►  July (2)
    • ►  June (1)
    • ►  May (2)
    • ►  April (3)
    • ►  March (1)
    • ►  February (5)
    • ►  January (4)
  • ▼  2008 (34)
    • ►  December (2)
    • ►  November (2)
    • ►  October (2)
    • ►  September (1)
    • ►  August (4)
    • ►  July (2)
    • ▼  June (3)
      • {Sun Studio, Solaris} { Blog Posts, White Papers} ...
      • QuickTest Pro Performance : VNC or Remote Desktop?
      • Installing MySQL 5.0.51b from the Source Code on S...
    • ►  May (3)
    • ►  April (2)
    • ►  March (5)
    • ►  February (4)
    • ►  January (4)
  • ►  2007 (33)
    • ►  December (2)
    • ►  November (4)
    • ►  October (2)
    • ►  September (5)
    • ►  August (3)
    • ►  June (2)
    • ►  May (3)
    • ►  April (5)
    • ►  March (3)
    • ►  February (1)
    • ►  January (3)
  • ►  2006 (40)
    • ►  December (2)
    • ►  November (6)
    • ►  October (2)
    • ►  September (2)
    • ►  August (1)
    • ►  July (2)
    • ►  June (2)
    • ►  May (4)
    • ►  April (5)
    • ►  March (5)
    • ►  February (3)
    • ►  January (6)
  • ►  2005 (72)
    • ►  December (5)
    • ►  November (2)
    • ►  October (6)
    • ►  September (5)
    • ►  August (5)
    • ►  July (10)
    • ►  June (8)
    • ►  May (9)
    • ►  April (6)
    • ►  March (6)
    • ►  February (5)
    • ►  January (5)
  • ►  2004 (36)
    • ►  December (1)
    • ►  November (5)
    • ►  October (12)
    • ►  September (18)
Powered by Blogger.

About Me

Unknown
View my complete profile