Technical article 126347

OSR6:How do I install and start to use MYSQL Community v5.0.18?

OpenServer 6.0.0

Written · Last revised

Problem

How do I download and use MySQL Community version 5.0.18 for OpenServer6?

Solution

1.  Download the software from:
http://dev.mysql.com/downloads/mysql/5.0.html
into /local/mysql.  You may need to run "mkdir -p /local/mysql".
2.  Un-gzip and un-tar the file:
mysql-standard-5.0.18-sco-osr6-i686.tar.gz
3.  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.
4.  Run the following commands:
# mkdir /usr/local
# cd /local/mysql
# ln -s /local/mysql/mysql-standard-5.0.18-sco-osr6-i686
/usr/local/mysql
# groupadd mysql
# useradd -g mysql mysql
# cd /usr/local/mysql
# chown -R root:sys *
# chown -R mysql:mysql data
# ./scripts/mysql_install_db --user=mysql
# ./bin/mysqld_safe &
5.  Now ensure the server starts and stops at each boot time:
# cd /usr/local/mysql/support-files
# cp mysql.server /etc/init.d
# ln /etc/init.d/mysql.server /etc/rc2.d/S99mysql
# ln /etc/init.d/mysql.server /etc/rc0.d/K01mysql
6.  Add /usr/local/mysql/bin to the $PATH
7.  Run:
# mysql --version (or mysql -V)
mysql  Ver 14.12 Distrib 5.0.18, for unknown-sysv5SCO_SV6.0.0 (i686)
using readline 5.0
8.  mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 6 to server version:
5.0.18-standard

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

mysql>
Enter:
mysql> STATUS;
mysql> quit;
9.  Download the world.sql example database from:
http://dev.mysql.com/get/Downloads/Manual/world.sql.gz/fro
m/pick
10.  At the mysql prompt enter:
mysql> CREATE DATABASE world;
11.  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.

12.  Once loaded, within the MySQL client run "mysql":
mysql> USE world;
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:
my.cnf
------
For new starters to MySQL 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

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.

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.

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.

Disk Space
----------
Your databases are created in /usr/local/mysql/data

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

See also

Download from:  http://www.mysql.com/support/
Support for MySQL
-----------------
Community versions of MySQL are not supported by SCO.

To obtain full support of MySQL version 4.1 and 5.0 for OpenServer6 from SCO then visit MySQL Network at:

http://www.mysql.com/network/
http://www.sco.com/products/openserver6/mysql.html
NOTES:    For information on MySQL's Support policies and products visit:
http://www.mysql.com/company/legal/supportpolicies/

From the Xinuos technical article database, record 126347. Reproduced with permission. The original is at www.sco.com/ta/126347, 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.