Technical article 126457

How do I install and start to use MYSQL Community v5.0.90?

OpenServer 6.0.0OpenServer 5.0.7UnixWare 7.1.4

Written · Last revised

Problem

How do I download and use MySQL Community version 5.0.90 for OpenServer or UnixWare7?

Solution

v5.0.19 is used here as an example, later versions of MySQL, such as v5.0.21, v5.0.45, v5.0.51a/b, v5.0.85 and v5.0.90 install in the same way.

It is assumed that no other MySQL has been installed.  If it has then
please stop it before upgrading the version.
For OpenServer5:
---------------
Please note that there is no supported version for SCO OpenServer
5.0.7.

It is recommended to upgrade to SCO OpenServer 6.0.0 to take advantage of the faster speed of this later platform.

Alternatively, consider PostgreSQL which is provided with OpenServer5's latest maintenance.

For OpenServer6:
----------------
a.  Download the software from:
http://dev.mysql.com/downloads/mysql/5.0.html
into /local/mysql, for example.

You may need to run "mkdir -p /local/mysql".

Earlier versions are available from the Archive at:

http://downloads.mysql.com/archives.php?p=mysql-5.0
b.  If you have installed using the OpenServer6 media, prior to Mar
    2006 then MySQL is likely to have been installed at installation
    time.  If this is the case then run "custom" and from SCO
    OpenServer6 select Database Services and remove the 4.x version
    of MySQL currently installed.
c.  Note the following changes to the default MySQL file locations:
Path to mysqlshow command     /opt/mysql/bin/mysqlshow
Path to mysqladmin command    /opt/mysql/bin/mysqladmin
Path to mysql command         /usr/bin/mysql
Path to mysqldump command     /opt/mysql/bin/mysqldump
Path to mysqlimport command   /opt/mysql/bin/mysqlimport
Command to start MySQL server /etc/rc2.d/S99mysql start
Command to stop MySQL server  /etc/rc0.d/K01mysql stop
Path to MySQL shared libraries directory  /usr/lib
Path to MySQL databases directory         /var/lib/mysql
For UnixWare7:
-------------
a.  You can download, either the latest version of MySQL as per the
    SCO OpenServer6 section above or download the pre-built version
    for UnixWare7 of MySQL v5.0.19 from:
https://ftp.scoexpert.com/unixware7/714/other/mysql_5.0.19-01
b.  Note the following changes to the default MySQL file locations:
Path to mysqlshow command     /usr/bin/mysqlshow
Path to mysqladmin command    /usr/bin/mysqladmin
Path to mysql command         /usr/bin/mysql
Path to mysqldump command     /usr/bin/mysqldump
Path to mysqlimport command   /usr/bin/mysqlimport
Command to start MySQL server /etc/rc2.d/S99mysql start
Command to stop MySQL server  /etc/rc0.d/K01mysql stop
Path to MySQL shared libraries directory  /usr/lib
Path to MySQL databases directory         /var/lib/mysql
Pre-Installation:
----------------
Databases will be created in the MySQL database directory, which is
shown above, and by default, this will be /var/lib/mysql.

Ensure you have sufficient disk capacity for your database size or alternatively add sufficient disk and have /var/lib/mysql as a mount point.

To Install:
----------
1.  Create the MySQL user and groups with:
# groupadd mysql
# useradd -g mysql mysql
2.  Run the following commands:
# cd /local/mysql
# gunzip mysql-standard-5.0.19-sco-osr6-i686.pkg.gz
# pkgadd -d /local/mysql/mysql-standard-5.0.19-sco-osr6-i686.pkg

If you did not create the "mysql" user and group first then you will get the following error:

This install require that the user 'mysql' and group 'mysql' exists UX:pkginstall: ERROR: request script did not complete successfully

A successful install will report:
## Executing postinstall script.
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/opt/mysql/mysql/bin/mysqladmin -u root password
'new-password'
/opt/mysql/mysql/bin/mysqladmin -u root -h
tiger7.sboard.uk.sco.com password 'new-password'
See the manual for more instructions.
Please report any problems with the ./bin/mysqlbug script!

The latest information about MySQL is available on the web at http://www.mysql.com Support MySQL by buying support/licenses at https://order.mysql.com

Installation of MySQL Community Edition - Standard (GPL) (mysql) was successful.

The MySQL root password is set automatically as part of the post installation, see above.

3.  Now ensure the server starts and stops at each boot time:
# cd /etc/init.d
# ln /etc/init.d/mysql /etc/rc2.d/S99mysql
# ln /etc/init.d/mysql /etc/rc0.d/K01mysql
4.  Start MySQL with:
# /etc/init.d/mysql start
5.  Check MySQL has started ok with:
# ps -ef | grep mysql
You should see:
   mysql  4660  4637  0 12:59:20 ttyp1        00:00:00
/opt/mysql/mysql/bin/mysqld --basedir=/opt/mysql/mysql
--datadir=/var/lib/mysql
    root  4637     1  0 12:59:20 ttyp1        00:00:00
/opt/mysql/mysql/bin/mysqld_safe --datadir=/var/lib/mysql
--pid-file=/var/lib/m
6.  To run MySQL, run:
# mysql --version (or mysql -V)
mysql  Ver 14.12 Distrib 5.0.19, for unknown-sysv5SCO_SV6.0.0
(i686) using readline 5.0
7.  Run:
# mysql (/bin/mysql):
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 6 to server version: 5.0.19-standard

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>
Enter:
mysql> STATUS;
mysql> quit;
8.  Download the world.sql example database from:
http://dev.mysql.com/get/Downloads/Manual/world.sql.gz/from/pick
9.  At the mysql prompt enter:
mysql> CREATE DATABASE world;
10.  There are two ways to import the MySQL Source SQL file:
Either from the shell run with:
mysql> quit<RETURN>   - ie. with or without the ;
or:
mysql> exit<RETURN>
# mysql world < world.sql

OR from within the MySQL client run:

mysql> USE world;
mysql> SOURCE world.sql;

NOTE: The opposite command to output or backup a database would be to use the "mysqldump" client program as:

mysql> mysqldump world > world.backup.sql

world.sql and world.backup.sql contain the same data but were produced from different MySQL databases with different mysqldump client programs so the file size and content is different.

NOTE: To import data into a table from a Comma Separated Value
      file,  for example, use the commands "LOAD DATA INFILE" or
      "mysqlimport" client program.
11.  Once loaded, within the MySQL client run "mysql":

mysql> USE world; mysql> SHOW tables; mysql> SELECT * from Country;

to see your first SELECT statement.

Press the UP and DOWN arrows to browse and change your most recent commands.

NOTE: the default line terminator is ";" which is the same as \g. You can also use \G to change the format of the output.

TROUBLESHOOTING:
a.   For OpenServer6, to keep a link to the MySQL default locations:
# ln -s /opt/mysql/mysql /usr/local/mysql
b.   my.cnf
     ------
     For new starters to MySQL it is recommended to run MySQL with
     the safe updates option as "mysql --safe-updates".

This can be included in a $HOME or global /etc/my.cnf file as:

[client]
compress
[mysql]
safe-updates

Alternatively, use the my.cnf location defined in:

mysql  3249  3220   TS  80  0 12:40:49 pts/1 0:00
/opt/mysql/mysql/bin/mysqld --defaults-extra-
 file=/opt/mysql/mysql/data/my.cnf
above.

Any changes made to the my.cnf file require you to stop and start MySQL;

# /etc/init.d/mysql restart
NOTE: The compress is an example to show that any clients connecting
      from other than localhost would use the compression to send
      traffic over the network between clients/server for slower
      networks on port 3306.
c.    Syntax Error:
      ------------
      mysql> This is an invalid statement;

Will display the most common error message: ERROR 1064: You have an error in your SQL syntax.

d.    Checking a Database:
      -------------------
      Use "mysqlcheck" and "myisamchk" to check the integrity of your
      database, for example:
# mysqlcheck world;
world.City                            OK
world.Country                         OK
world.CountryLanguage                 OK
# cd /usr/local/mysql/data/world
# myisamchk City
Checking MyISAM file: City
Data records:    4079   Deleted blocks:       0
- check file-size
- check record delete-chain
- check key delete-chain
- check index reference
- check data record references index: 1

NOTE: that "mysqlcheck" is a client program (See CHECK & REPAIR TABLE) and so can be run when the database is running, whereas myisamchk is not a client program and performs operations on tables by accessing the table files directly.

e.    Disk Space
      ----------
      Your databases are created in /var/lib/mysql

It is recommended to store this on a separate filesystem, other than root to ensure the root filesystem does not become congested.

See: /etc/init.d/mysql.in to show an example of where the data directory is changed.

f.    MySQL comes with its own test suite.
/opt/mysql/mysql/mysql-test/README

It is suggested to run the tests as the "mysql" user.

./mysql-test-run --force

NOTE: Should the "rpl_rotate_logs" test fail then this is a known issue and is caused by running the tests as "root". It can be resolved by removing the "var" directory in:

/opt/mysql/mysql/mysql-tests/var

and running the tests as the "mysql" user.

It is recommended to change the default "mysql" user in "scoadmin account" and change the default shell to /usr/bin/bash and then running:

# mkdir /home/mysql
# chown mysql:mysql /home/mysql
g.    MySQL won't start - getting in the .err file in /usr/lib/mysql:

[ERROR] Can't start server Bind or unix socket: permission denied

- Check the permissions of /tmp are set to 1777.

h.    I am seeing Dynamic linker symbol binder errors when I try to
      run "mysql".
- What version of the SCO Unix operating system are you trying
  to install on?  v5.0.51a and below is known to work on
  UnixWare 7.1.3 but later versions, such as v5.0.85 doesn't.
i.    Seeing the following during installation:
ERROR: 1136  Column count doesn't match value count at row 1
100324 10:07:08 [ERROR] Aborting
100324 10:07:08 [Note] /opt/mysql/mysql/bin/mysqld: Shutdown complete
Installation of system tables failed!
Examine the logs in /var/lib/mysql for more information.

- You are trying to install a newer version over an older version which is not supporting an upgrade.

Remove the current version in 'custom' or 'pkgrm' and also check the following directories which may need to have their contents manually removed:

/usr/bin/mysql*
/var/lib/mysql
/usr/lib/mysql
/opt/mysql
/etc/my.cnf
NOTES:    These packages don't have the shared libraries that SCO shipped in
          the 4.10 package, only static versions.

See also

TA125755, "How do I create a database in MySQL and populate it with some data? "

From the Xinuos technical article database, record 126457. Reproduced with permission. The original is at www.sco.com/ta/126457, which is reachable but blocked from search engines.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.