{"id":80,"date":"2007-09-04T22:30:34","date_gmt":"2007-09-05T06:30:34","guid":{"rendered":"http:\/\/learnbyblogging.com\/?p=80"},"modified":"2007-09-04T22:30:34","modified_gmt":"2007-09-05T06:30:34","slug":"installing-mysql-on-solaris-10","status":"publish","type":"post","link":"https:\/\/learnbyblogging.com\/?p=80","title":{"rendered":"Installing MySql on Solaris 10"},"content":{"rendered":"<p>I followed the <a href=\"http:\/\/meljr.com\/~meljr\/mysql_Sol10.html\">Mel Lester Jr.&#8217;s instructions<\/a> with some minor tweaks on the paths.<\/p>\n<p>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. <\/p>\n<p>1. Log in as root and initialise the database tables.<br \/>\n# \/usr\/local\/mysql\/bin\/mysql_install_db<br \/>\nPreparing db table<br \/>\nPreparing host table<br \/>\nPreparing user table<br \/>\nPreparing func table<br \/>\nPreparing tables_priv table<br \/>\nPreparing columns_priv table<br \/>\nInstalling all prepared tables<br \/>\n060118 21:24:03 \/usr\/local\/mysql\/bin\/mysqld: Shutdown Complete<br \/>\n<snip...><\/p>\n<p>2. Create mysql user and group and change data directory group.<br \/>\n# groupadd mysql<br \/>\n# useradd -g mysql mysql<br \/>\n# chgrp -R mysql \/var\/mysql<br \/>\n# chmod -R 770 \/var\/mysql<br \/>\n# installf SUNWmysqlr \/var\/mysql d 770 root mysql<br \/>\n# chown -R mysql:mysql \/usr\/local\/mysql\/var (critical step or you may end up with &#8220;[1]   Exit 127&#8221;<br \/>\n(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)<\/p>\n<p>\/usr\/local\/bin\/mysqld_safe &#8211;user=mysql<br \/>\n# Starting mysqld daemon with databases from \/usr\/local\/mysql\/var<br \/>\nSTOPPING server from pid file \/usr\/local\/mysql\/var\/tsai86.pid<br \/>\n070902 23:39:39  mysqld ended<\/p>\n<p>3. MySQL reads configuration files from different places in the following order:<br \/>\nFilename Purpose<br \/>\n&#8212;&#8212;&#8212; &#8212;&#8212;&#8212;<br \/>\n\/etc\/my.cnf Global options<br \/>\nDATADIR\/my.cnf Server-specific options<br \/>\ndefaults-extra-file\tThe file specified with &#8211;defaults-extra-file=path<br \/>\n~\/.my.cnf User-specific options<\/p>\n<p>4. Optionally copy a mysql daemon configuration file to configuration directory.<br \/>\nNote: there are other configuration profiles available.<br \/>\nFor default solaris installation DATADIR is \/var\/mysql.<br \/>\n# cp \/usr\/local\/mysql\/share\/mysql\/my-medium.cnf \/var\/mysql\/my.cnf<\/p>\n<p>5. Start mysql daemon as mysql user manually<br \/>\n# \/usr\/local\/mysql\/bin\/mysqld_safe &#8211;user=mysql &#038;<\/p>\n<p>6. Set the root MySQL user password (Substitute a unique password for &#8220;new-password&#8221;)<br \/>\n# cd \/usr\/local\/mysql\/bin<\/p>\n<p>Note the use of single quotes surrounding your new-password and the back ticks surrounding the hostname command &#8212; they are not the same!<br \/>\n# .\/mysqladmin -u root password &#8216;new-password&#8217;<br \/>\n# .\/mysqladmin -u root -h `hostname` password &#8216;new-password&#8217;<\/p>\n<p>7. Test the server:<br \/>\n# .\/mysqlshow -p<br \/>\nEnter password: new-password<br \/>\n+&#8212;&#8212;&#8212;&#8211;+<br \/>\n| Databases |<br \/>\n+&#8212;&#8212;&#8212;&#8211;+<br \/>\n| mysql |<br \/>\n| test |<br \/>\n+&#8212;&#8212;&#8212;&#8211;+<br \/>\n# .\/mysql -u root -p<br \/>\nEnter password: new-password<br \/>\nWelcome to the MySQL monitor. Commands end with ; or \\g.<br \/>\nYour MySQL connection id is 3 to server version: 4.0.20-standard<br \/>\nType &#8216;help;&#8217; or &#8216;\\h&#8217; for help. Type &#8216;\\c&#8217; to clear the buffer.<br \/>\nmysql> show databases;<\/p>\n<p>\t+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br \/>\n\t| Database<br \/>\n\t\t|<br \/>\n\t+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br \/>\n\t| information_schema |<br \/>\n\t| mysql\t\t\t|<br \/>\n\t| test\t\t\t|<br \/>\n\t+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br \/>\n\t3 rows in set (0.00 sec)<br \/>\n8. mysql> quit;<br \/>\nBye<\/p>\n<p>9. Optionally perform the following steps for automatic start and stop of mysql daemon at boot and shutdown: (This doesn&#8217;t quite work for me and I haven&#8217;t figured out how to use the svc service to do this automatically.) Stay tuned&#8230;<br \/>\nLink boot time start up script from rc3.d and rc[012S].d<br \/>\n# ln \/usr\/local\/mysql\/share\/mysql\/mysql.server \/etc\/rc3.d\/S99mysql<br \/>\n# ln \/usr\/local\/mysql\/share\/mysql\/mysql.server \/etc\/rc0.d\/K00mysql<br \/>\n# ln \/usr\/local\/mysql\/share\/mysql\/mysql.server \/etc\/rc1.d\/K00mysql<br \/>\n# ln \/usr\/local\/mysql\/share\/mysql\/mysql.server \/etc\/rc2.d\/K00mysql<br \/>\n# ln \/usr\/local\/mysql\/share\/mysql\/mysql.server \/etc\/rcS.d\/K00mysql<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I followed the Mel Lester Jr.&#8217;s instructions with some minor tweaks on the paths. 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 &hellip; <a href=\"https:\/\/learnbyblogging.com\/?p=80\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Installing MySql on Solaris 10<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-80","post","type-post","status-publish","format-standard","hentry","category-tips-for-computer"],"_links":{"self":[{"href":"https:\/\/learnbyblogging.com\/index.php?rest_route=\/wp\/v2\/posts\/80","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/learnbyblogging.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/learnbyblogging.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/learnbyblogging.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/learnbyblogging.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=80"}],"version-history":[{"count":0,"href":"https:\/\/learnbyblogging.com\/index.php?rest_route=\/wp\/v2\/posts\/80\/revisions"}],"wp:attachment":[{"href":"https:\/\/learnbyblogging.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=80"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/learnbyblogging.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=80"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/learnbyblogging.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=80"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}