Configure the Mysql that comes with Solaris

Source: Internet
Author: User
Tags mysql manual
Installing MySql on Solaris 10

To start using the mysql bundled with Solaris 10, a number of post-install procedures need to be made by root. this configuration has been successfully tested in a Sparce Root Local Zone. the following steps are derived from the mysql manual (manual. ps, manual.txt or manual_toc.html) found in the/usr/sfw/src/mysql/Docs directory.

1. Log in as root and initialise the database tables. First install the system table
#/Usr/local/mysql/bin/mysql_install_db
Preparing db table
Preparing host table
Preparing user table
Preparing func table
Preparing tables_priv table
Preparing columns_priv table
Installing all prepared tables
060118 21:24:03/usr/local/mysql/bin/mysqld: Shutdown Complete

2. Create mysql user and group and change data directory group. Create a directory for mysql users and configuration files.
# Groupadd mysql
# Useradd-g mysql
# Chgrp-R mysql/var/mysql
# Chmod-R 770/var/mysql
# Installf SUNWmysqlr/var/mysql d 770 root mysql
# Chown-R mysql: mysql/usr/local/mysql/var (critical step or you may end up with "[1] Exit 127 ″
(This took me a while to figure out, this directory is where the database is stored. Good to know if you want to back up)

/Usr/local/bin/mysqld_safe-user = mysql
# Starting mysqld daemon with databases from/usr/local/mysql/var
STOPPING server from pid file/usr/local/mysql/var/tsai86.pid
070902 23:39:39 mysqld ended

3. MySQL reads configuration files from different places in the following order:
Filename Purpose Configuration File Modification
------
/Etc/my. cnf Global options
DATADIR/my. cnf Server-specific options
Defaults-extra-file The file specified with-defaults-extra-file = path
~ /. My. cnf User-specific options

4. Optionally copy a mysql daemon configuration file to configuration directory.
Note: there are other configuration profiles available. Optional. Configure the default path
For default solaris installation DATADIR is/var/mysql.
# Cp/usr/local/mysql/share/mysql/my-medium.cnf/var/mysql/my. cnf

5. Start mysql daemon as mysql user manually to Start
/Usr/local/mysql/bin/mysqld_safe-user = mysql &

6. Set the root MySQL user password (Substitute a unique password for "new-password ")
Set Password
# Cd/usr/local/mysql/bin

Note the use of single quotes surrounding your new-password and the back ticks surrounding the hostname command-they are not the same!
#./Mysqladmin-u root password 'new-password'
#./Mysqladmin-u root-h 'hostname' password 'new-password'

7. Test the server: Test
#./Mysqlshow-p
Enter password: new-password
+ ---- +
| Databases |
+ ---- +
| Mysql |
| Test |
+ ---- +
#./Mysql-u root-p
Enter password: new-password
Welcome to the MySQL monitor. Commands end with; or \ g.
Your MySQL connection id is 3 to server version: 4.0.20-standard
Type 'help; 'or' \ H' for help. Type '\ C' to clear the buffer.
Mysql> show databases;

+ ------- +
| Database
|
+ ------- +
| Information_schema |
| Mysql |
| Test |
+ ------- +
3 rows in set (0.00 sec)
8. mysql> quit;
Bye

9. optionally perform the following steps for automatic start and stop of mysql daemon at boot and shutdown: (This doesn't quite work for me and I haven't figured out how to use the svc service to do this automatically .) stay tuned... Set the automatic cooperation switch server.
Link boot time start up script from rc3.d and rc [012 S]. d
# Ln/usr/local/mysql/share/mysql. server/etc/rc3.d/S99mysql
# Ln/usr/local/mysql/share/mysql. server/etc/rc0.d/K00mysql
# Ln/usr/local/mysql/share/mysql. server/etc/rc1.d/K00mysql
# Ln/usr/local/mysql/share/mysql. server/etc/rc2.d/K00mysql
# Ln/usr/local/mysql/share/mysql. server/etc/rcS. d/K00mysql

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.