Compiling MySQL on Solaris Machines MORE RECENT NOTE: This document is no longer relevant when compiling modern versions of MySQL 3.23. Also, the advent of MySQL 4 has done well to take care of almost all compiling concerns on Solaris. Kudos to the MySQL team for a great product and support.
Preface: I have used this technique to compile MySQL on Sparc Solaris machines running 2.4, 2.5.1, 2.6, and 7, as well as Intel Solaris machines running Solaris 8. Make sure you're using at least gcc 2.95.2 (2.95.3 will work, also.)
NOTE: As of a few versions back, none of the cache file editing described within is unnecessary. As of 3.23.something, (including the latest version,) you can just skip to the ./configure section below, and not worry about anything else. Simply put, you only have to worry about the parts below in GREEN
First, get the source archive from www.mysql.com/downloads/index.html
* DO NOT DOWNLOAD THE PACKAGES! THEY HAVE BEEN COMPILED AND CONFIGURED * FOR AND BY PSYCHOTIC HIPPIES FROM NEPTUNE AND WILL ERASE YOUR CD'S!!Once you've downloaded it, do the following (of course, use the proper filename for the version you're using):
gunzip mysql-3.23.43.tar.gz
gtar xf mysql-3.23.43.tar
cd mysql-3.23.43
OR
gunzip -c mysql-3.23.43.tar.gz | gtar xf -
cd mysql-3.23.43
The first thing you'll need to do is add a line to the
config.cache
(which doesn't exist at this point):
ac_cv_sys_restartable_syscalls=${ac_cv_sys_restartable_syscalls='no'}
Save it, then let's start the configuration process (remove the without-server clause if you want to compile client and server):
CC=gcc CFLAGS="-O6" \
CXX=gcc CXXFLAGS="-O6 -felide-constructors -fno-exceptions -fno-rtti" \
./configure --prefix=/usr/local/mysql --with-low-memory --without-server
Some other considerable options:
--with-innodb
--with-berkeleydb
--with-libwrap=/path/to/libwrap.a
It's gonna take a while. Next, we get to edit yet another file:
config.h
Find and comment out these lines (note they are not together in the file, just find them both):
#define HAVE_TERM_H 1
and
#define HAVE_CURSES_H 1
Now, run the compiler:
make
make installThat's it. See the section on PHP for compiling MySQL support into PHP/Apache.
[Oct 20, 2005] Installing MySQL 3.23 - Solaris
The following article provides the steps necessary to successfully install the binary version of MySQL, release 3.23, on Solaris 2.8 and higher. These procedures should work as well on versions of Solaris as early as version 2.6.
I typically install MySQL in /usr/local/mysql as the UNIX root account. I then create a UNIX mysql account that will have access to manage databases.
Once you've installed MySQL, you will need to initialize the grant tables, start the server, and make sure that the server works okay. You may also elect to arrange for the server to be started and stopped automatically when your system starts up and shuts down.
Installing the grant tables is accomplished by running the
mysql_install_db
script. This creates themysql
database which will hold all database privileges, thetest
database which you can use to test MySQL, and also privilege entries for the user that runmysql_install_db
and aroot
user (without any passwords).
MySQL DBA Tips Corner |
Installing MySQL 3.23 - (Solaris)
by Jeff Hunter, Sr. Database Administrator
Overview
The following article provides the steps necessary to successfully install the binary version of MySQL, release 3.23, on Solaris 2.8 and higher. These procedures should work as well on versions of Solaris as early as version 2.6.Operating System AccountI typically install MySQL in /usr/local/mysql as the UNIX root account. I then create a UNIX mysql account that will have access to manage databases.
Once you've installed MySQL, you will need to initialize the grant tables, start the server, and make sure that the server works okay. You may also elect to arrange for the server to be started and stopped automatically when your system starts up and shuts down.
Installing the grant tables is accomplished by running the
mysql_install_db
script. This creates themysql
database which will hold all database privileges, thetest
database which you can use to test MySQL, and also privilege entries for the user that runmysql_install_db
and aroot
user (without any passwords).
Create MySQL User Account:% groupadd -g 116 mysql % useradd -u 174 -c "MySQL Software Owner" \ -d /u01/app/mysql -g "mysql" -m -s /bin/bash mysql % passwd mysqlCreate MySQL UserID:
% mkdir /u01 % mkdir /u01/app % mkdir /u01/app/mysql % chown -R mysql:mysql /u01/app/mysql
Uncompress / Installing Binary Version of MySQL
NOTE: Because of a bug in Solaris tar, Solaris users should use gnu tar to unpack archives.% su - % cp mysql-3.23.54-sun-solaris2.8-sparc.tar /usr/local % cd /usr/local % gunzip mysql-3.23.54-sun-solaris2.8-sparc.tar.gz % gtar xvf mysql-3.23.54-sun-solaris2.8-sparc.tar % ln -s mysql-3.23.54-sun-solaris2.8-sparc mysql % cd mysql % scripts/mysql_install_db % chown -R root . % chown -R mysql data % chgrp -R mysql .
Starting and Stopping the MySQL Database Software
Starting the MySQL Database% bin/safe_mysqld --user=mysql &Stopping the MySQL Database% bin/mysqladmin -u root shutdown
NOTE:
Thesafe_mysqld
startup script of MySQL 3.23.54 includes a small bug that leads to a "syntax error" message on startup. Here is a quick hint on how to fix it:Open
bin/safe_mysqld
with a text editor. Go to line 162 and look for the following text:if $NOHUP_NICENESS -gt 0 then $NOHUP_NICENESS="nice --$NOHUP_NICENESS nohup"Change it to look like this:if test $NOHUP_NICENESS -gt 0 then NOHUP_NICENESS="nice --$NOHUP_NICENESS nohup"(Make sure to add "test" to the if-statement and remove the dollar sign from the $NOHUP_NICENESS= line)This error will be fixed for MySQL 3.23.54a, which will be released shortly.
Testing the Installation
Ensure that the MySQL Software, theConfiguration Files / Scriptsmysqld
server, is running and you have set up the initial MySQL grant tables containing the privileges that determine how users are allowed to connect to the server. This is normally done with themysql_install_db
script.
- Using
mysqladmin
% mysqladmin ping mysqld is alive% mysqladmin version mysqladmin Ver 8.23 Distrib 3.23.54, for pc-linux on i686 Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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 3.23.54 Protocol version 10 Connection Localhost via UNIX socket UNIX socket /tmp/mysql.sock Uptime: 59 min 45 sec Threads: 1 Questions: 2 Slow queries: 0 Opens: 6 Flush tables: 1 Open tables: 0 Queries per second avg: 0.001- Ensure you can shutdown and startup the server
Starting the MySQL Database
% bin/safe_mysqld --user=mysql &Stopping the MySQL Database% bin/mysqladmin -u root shutdown- Try several simple tests
% mysqlshow +-----------+ | Databases | +-----------+ | mysql | | test | +-----------+% mysqlshow -u root mysql Database: mysql +--------------+ | Tables | +--------------+ | columns_priv | | db | | func | | host | | tables_priv | | user | +--------------+% mysql -u root -e "select host, db, user from db" mysql +------+---------+------+ | host | db | user | +------+---------+------+ | % | test | | | % | test\_% | | +------+---------+------+% mysql -u root mysql Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 15 to server version: 3.23.54 Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> select host, db, user from db; +------+---------+------+ | host | db | user | +------+---------+------+ | % | test | | | % | test\_% | | +------+---------+------+ 2 rows in set (0.00 sec)
Example: .bash_profile $HOME/.bash_profile for the "mysql" user account.gtarBecause of a bug in Solaris tar, Solaris users should use gnu tar to unpack archives. Right-click the above link and choose "Save Target As..." to download
All articles, scripts and material located at the
Internet address of http://www.idevelopment.info/ is the copyright of Jeffrey M.
Hunter and is protected under copyright laws of the United States. These
document may not be hosted on any other site without my express, prior, written
permission. Application to host any of the material elsewhere can be made by
contacting me at mailto:%20%20%20%20%20%20%20%20%20%20jhunter@idevelopment.info.
I have made every effort and taken great care in making sure that the
material included on my web site is technically accurate, but I disclaim any and
all responsibility for any loss, damage or destruction of data or any other
property which may arise from relying on it. I will in no case be liable for any
monetary damages arising from such loss, damage or destruction.
Google matched content |
MySQL AB Sun Solaris Downloads
Solaris 10