AddThis Social Bookmark Button

Listen Print Discuss

Apache Web-Serving With Mac OS X, Part 5
Pages: 1, 2, 3

Hello, MySQL!

If the above went smoothly, it's time to make a quick PHP script to make sure database communication is possible. Copy the following code into your favorite text editor (like BBEdit), and save the file as test.php within a Web site directory (either /Library/WebServer/Documents/ or /Users/morbus/Sites, for example).


<?
   print "<pre>";

   // log into our local server using the MySQL root user.
   $dbh = mysql_connect( "localhost", "root", "" );


   // select the 'test' database created during installation.
   mysql_select_db( "test" ) or die ( mysql_error() . "\n" );
   print "Connection to the database has been established.\n";


   // create a simplistic table.
   $table = "CREATE table wisdom (
             id int(4) PRIMARY KEY AUTO_INCREMENT,
             wisdom char(255), author char(125) );";

   $response = mysql_query( $table, $dbh );
   if ($response) { print "The table was created correctly!\n"; }
   else { print mysql_error () . "\n"; }


   // now, we'll add some data to our newly created table.
   // to add different wisdom, just change the 'values'.
   $insert_data = "INSERT into wisdom ( wisdom, author ) 
                   values ( 'Must... remain... awake!', 'Morbus' );";

   $response = mysql_query( $insert_data, $dbh );
   if ($response) { print "The data was inserted correctly!\n"; }
   else { print mysql_error () . "\n"; }


   // and read it back for printing purposes.
   $get_table_data = "SELECT * FROM wisdom;";
   $response = mysql_query( $get_table_data, $dbh );
   if ($response) { print "We successfully got all the table data.\n"; }
   else { print mysql_error () . "\n"; }


   // now print it out for the user.
   while ( $one_line_of_data = mysql_fetch_array( $response ) ) {
       extract ( $one_line_of_data );
       print "#$id: $author sez: \"$wisdom\"\n"; 
   }

   print "</pre>";
?>

Note: Again, we're not going to explore the syntax of the PHP script, or the SQL commands that are used. Suffice it to say that this script will create a table in the MySQL 'test' database, add some data, and then spit back the total contents of the 'wisdom' table. If you need a brush-up on PHP or MySQL, be sure to check out ONLamp.com.

After you've saved the file, load it in your Web browser. I saved my copy in /Users/morbus/Sites/test.php, so I loaded http://127.0.0.1/~morbus/test.php in my browser. After the first run, this is what I saw:


    Connection to the database has been established.
    The table was created correctly!
    The data was inserted correctly!
    We successfully got all the table data.
    #1: Morbus sez: "Must... remain... awake!"

If I continue running the script, changing the INSERT line each time, my output will start to look like:


    Connection to the database has been established.
    Table 'wisdom' already exists
    The data was inserted correctly!
    We successfully got all the table data.
    #1: Morbus sez: "Must... remain... awake!"
    #2: Morbus sez: "Sleeping makes Derrick angry!"
    #3: Morbus sez: "And I'm 23 minutes away from 3 o'clock!"

The above output certifies that our PHP-to-MySQL communication is working perfectly. With 23 minutes to spare before the boss and his goons come, we've got just enough time to chow down the last remnants of our ketchup potato chips and wash them down with a swig of Moxie.

Two minor additions

Previously in the Series

Apache Web-Serving with Mac OS X, Part 6

Apache Web-Serving with Mac OS X, Part 4

Apache Web-Serving with Mac OS X: Part 3

Apache Web-Serving with Mac OS X: Part 2

Apache Web-Serving with Mac OS X: Part 1

When we turn on our Web server (through the Sharing preference panel), OS X will happily restart Apache if our machine ever needs a reboot. Out of the box, MySQL doesn't restart automatically. Thankfully, there's a double-clickable solution, again from Marc Liyanage. Upon installing this StartupItem, MySQL will be at your beck and call after every reboot.

With the above instructions, MySQL is woefully unsecured. Anyone can become the administrative MySQL user and wreak havoc with our data. This may not be an issue if you're using MySQL on a development machine, but publicly accessible servers need protection. Much like OS X has a root user with ultimate control over the machine, MySQL also has a root user that has ultimate control over the database server.

By default, the MySQL root user has no password assigned to it. If you take a gander back at our PHP script, you'll see that we connect to our database with that field blank:


   // log into our local server using the MySQL root user.
   $dbh = mysql_connect( "localhost", "root", "" );

The simplest step in beginning to secure our database server is to set a password for MySQL's root user. To do so, enter the following in a Terminal:


    mysqladmin -u root password new_password_here

Once we do that, we'll have to modify our PHP code as well:


   // log into our local server using the MySQL root user.
   $dbh = mysql_connect( "localhost", "root", "new_password_here" );

This is just the start of securing a MySQL installation. You can go much deeper, like restricting access to certain databases by host name, much like we restricted access to certain Web directories with Apache's Allow and Deny directives (see "Choosing Who Sees What" in Part 3 of this series).

After the demonstration . . .

Thankfully, the meeting only lasted half an hour. The wide-eyed wonder boys have left and the redheaded stepchildren have wandered off. You're sitting, once again, with a smug look on your face, complemented by the realization that worrying about job security is a thing of the past. (Just be careful of netslavery.)

You've got databases stored, features adored, and requests explored [1]. Yet you realize there's so much more to Apache lurking beneath the surface, yelling out, "Discover me!" with a glee normally unfounded in typical Mac software. Where would you like to be taken next?


[1] Along with the bosses abhorred, benefits scored, and welcome awards, mouths floored and derision ignored, nothing deplored and happiness poured, computer love has been restored, and with no principles discord! Hail the mighty Fnord! (Yes, I could go on.)

Kevin Hemenway is the coauthor of Mac OS X Hacks, author of Spidering Hacks, and the alter ego of the pervasively strange Morbus Iff, creator of disobey.com, which bills itself as "content for the discontented."


Return to the Mac DevCenter.


  • error on test.php
    2002-06-05 17:33:03  union144 [Reply | View]

    As directed, I copied the php code in this tutorial and then saved into "library/webserver/documents" as test.php. When I run it through the web browser, however, I get the following result :

    Connection to the database has been established.
    Can't create/write to file './test/wisdom.frm' (Errcode: 13)
    Table 'test.wisdom' doesn't exist
    Table 'test.wisdom' doesn't exist

    Warning: Supplied argument is not a valid MySQL result resource in /Users/yaniv/Sites/test.php on line 42


    line 42 in the php is :
    while ( $one_line_of_data = mysql_fetch_array( $response ) ) {


    help? thank you. and my apologies for the dreadful grammar on my previous post.
    • error on test.php
      2002-06-06 14:33:16  union144 [Reply | View]

      fixed after reading advice from errcode 13 thread.

      solution :

      sudo chown -R mysql /usr/local/mysql/*
  • MySQL must be have admin priveleges
    2002-06-05 16:49:32  union144 [Reply | View]

    I encountered a problems when I followed your instructions for installing mySQL. When I first created the "MySQL User", I did not give the user administration priveleges, and encountered problems until I corrected that. I think - in this tutorial - you should more explicitly tell people that the "MySQL User" needs to be an admin. Thank you so much for this series of articles - they are immensely useful.
  • Problems with decompression
    2002-05-22 12:49:19  dhtmlkitchen [Reply | View]

    I noticed that you had me download a tar.gz, but decompress a .gz (see page 2 of your article).

    I attempted to decompress the tar.gz file, but I had some problems, or so it seems:

    tar: Unable to create mysql-3.23.49/mit-pthreads/gen/ttyname.c <No such file or directory>
    mysql-3.23.49/mit-pthreads/gen/getwd.c
    tar: Unable to create mysql-3.23.49/mit-pthreads/gen/getwd.c <No such file or directory>
    mysql-3.23.49/mit-pthreads/gen/pwd_internal.c
    tar: Unable to create mysql-3.23.49/mit-pthreads/gen/pwd_internal.c <No such file or directory>
    mysql-3.23.49/mit-pthreads/gen/Makefile.inc
    tar: Unable to create mysql-3.23.49/mit-pthreads/gen/Makefile.inc <No such file or directory>
    mysql-3.23.49/mit-pthreads/gen/getpwent.c
    tar: Unable to create mysql-3.23.49/mit-pthreads/gen/getpwent.c <No such file or directory>
    mysql-3.23.49/mit-pthreads/gen/getcwd.c
    tar: Unable to create mysql-3.23.49/mit-pthreads/gen/getcwd.c <No such file or directory>
    mysql-3.23.49/mit-pthreads/gen/time.c
    tar: Unable to create mysql-3.23.49/mit-pthreads/gen/time.c <No such file or directory>
    mysql-3.23.49/mit-pthreads/gen/directory.c
    tar: Unable to create mysql-3.23.49/mit-pthreads/gen/directory.c <No such file or directory>
    mysql-3.23.49/mit-pthreads/gen/syslog.c
    tar: Unable to create mysql-3.23.49/mit-pthreads/gen/syslog.c <No such file or directory>
    mysql-3.23.49/mit-pthreads/gen/ctime.c
    tar: Unable to create mysql-3.23.49/mit-pthreads/gen/ctime.c <No such file or directory>
    mysql-3.23.49/mit-pthreads/gen/eprintf.c
    tar: Unable to create mysql-3.23.49/mit-pthreads/gen/eprintf.c <No such file or directory>
    mysql-3.23.49/mit-pthreads/gen/difftime.c
    tar: Unable to create mysql-3.23.49/mit-pthreads/gen/difftime.c <No such file or directory>
    mysql-3.23.49/mit-pthreads/gen/getpwnamuid.c
    tar: Unable to create mysql-3.23.49/mit-pthreads/gen/getpwnamuid.c <No such file or directory>
    mysql-3.23.49/mit-pthreads/gen/isatty.c
    tar: Unable to create mysql-3.23.49/mit-pthreads/gen/isatty.c <No such file or directory>
    mysql-3.23.49/mit-pthreads/gen/popen.c
    tar: Unable to create mysql-3.23.49/mit-pthreads/gen/popen.c <No such file or directory>
    mysql-3.23.49/mit-pthreads/gen/pwd_internal.h
    tar: Unable to create mysql-3.23.49/mit-pthreads/gen/pwd_internal.h <No such file or directory>
    mysql-3.23.49/mit-pthreads/string
    tar: Could not create: mysql-3.23.49/mit-pthreads/string <No such file or directory>
    mysql-3.23.49/mit-pthreads/string/Makefile.inc
    tar: Unable to create mysql-3.23.49/mit-pthreads/string/Makefile.inc <No such file or directory>
    mysql-3.23.49/mit-pthreads/string/strtok.c
    tar: Unable to create mysql-3.23.49/mit-pthreads/string/strtok.c <No such file or directory>
    mysql-3.23.49/mit-pthreads/string/GNUmakefile.inc
    tar: Unable to create mysql-3.23.49/mit-pthreads/string/GNUmakefile.inc <No such file or directory>
    mysql-3.23.49/mit-pthreads/bin
    tar: Could not create: mysql-3.23.49/mit-pthreads/bin <No such file or directory>
    mysql-3.23.49/mit-pthreads/bin/finger
    tar: Could not create: mysql-3.23.49/mit-pthreads/bin/finger <No such file or directory>
    mysql-3.23.49/mit-pthreads/bin/finger/net.c
    tar: Unable to create mysql-3.23.49/mit-pthreads/bin/finger/net.c <No such file or directory>
    mysql-3.23.49/mit-pthreads/bin/finger/finger.c
    tar: Unable to create mysql-3.23.49/mit-pthreads/bin/finger/finger.c <No such file or directory>
    mysql-3.23.49/mit-pthreads/bin/finger/Makefile.in
    tar: Unable to create mysql-3.23.49/mit-pthreads/bin/finger/Makefile.in <No such file or directory>
    mysql-3.23.49/mit-pthreads/bin/finger/.cvsignore
    tar: Unable to create mysql-3.23.49/mit-pthreads/bin/finger/.cvsignore <No such file or directory>
    mysql-3.23.49/mit-pthreads/bin/finger/Makefile
    tar: Unable to create mysql-3.23.49/mit-pthreads/bin/finger/Makefile <No such file or directory>
    mysql-3.23.49/mit-pthreads/bin/.cvsignore
    tar: Unable to create mysql-3.23.49/mit-pthreads/bin/.cvsignore <No such file or directory>
    mysql-3.23.49/mit-pthreads/bin/Makefile.in
    tar: Unable to create mysql-3.23.49/mit-pthreads/bin/Makefile.in <No such file or directory>
    mysql-3.23.49/mit-pthreads/bin/Makefile
    tar: Unable to create mysql-3.23.49/mit-pthreads/bin/Makefile <No such file or directory>
    mysql-3.23.49/mit-pthreads/lib
    tar: Could not create: mysql-3.23.49/mit-pthreads/lib <No such file or directory>
    mysql-3.23.49/mit-pthreads/lib/.cvsignore
    tar: Unable to create mysql-3.23.49/mit-pthreads/lib/.cvsignore <No such file or directory>
    mysql-3.23.49/mit-pthreads/lib/libpthreadutil
    tar: Could not create: mysql-3.23.49/mit-pthreads/lib/libpthreadutil <No such file or directory>
    mysql-3.23.49/mit-pthreads/lib/libpthreadutil/Makefile.in
    tar: Unable to create mysql-3.23.49/mit-pthreads/lib/libpthreadutil/Makefile.in <No such file or directory>
    mysql-3.23.49/mit-pthreads/lib/libpthreadutil/pthread_atexit.c
    tar: Unable to create mysql-3.23.49/mit-pthreads/lib/libpthreadutil/pthread_atexit.c <No such file or directory>
    mysql-3.23.49/mit-pthreads/lib/libpthreadutil/pthread_tad.c
    tar: Unable to create mysql-3.23.49/mit-pthreads/lib/libpthreadutil/pthread_tad.c <No such file or directory>
    mysql-3.23.49/mit-pthreads/lib/libpthreadutil/pthreadutil.h
    tar: Unable to create mysql-3.23.49/mit-pthreads/lib/libpthreadutil/pthreadutil.h <No such file or directory>
    mysql-3.23.49/mit-pthreads/lib/libpthreadutil/.cvsignore
    tar: Unable to create mysql-3.23.49/mit-pthreads/lib/libpthreadutil/.cvsignore <No such file or directory>
    mysql-3.23.49/mit-pthreads/lib/libpthreadutil/Makefile
    tar: Unable to create mysql-3.23.49/mit-pthreads/lib/libpthreadutil/Makefile <No such file or directory>
    mysql-3.23.49/mit-pthreads/lib/Makefile.in
    tar: Unable to create mysql-3.23.49/mit-pthreads/lib/Makefile.in <No such file or directory>
    mysql-3.23.49/mit-pthreads/lib/Makefile
    tar: Unable to create mysql-3.23.49/mit-pthreads/lib/Makefile <No such file or directory>
    mysql-3.23.49/mit-pthreads/patches
    tar: Could not create: mysql-3.23.49/mit-pthreads/patches <No such file or directory>
    mysql-3.23.49/mit-pthreads/patches/p155
    tar: Unable to create mysql-3.23.49/mit-pthreads/patches/p155 <No such file or directory>
    mysql-3.23.49/mit-pthreads/patches/Streepy.html
    tar: Unable to create mysql-3.23.49/mit-pthreads/patches/Streepy.html <No such file or directory>
    mysql-3.23.49/mit-pthreads/patches/bill_lear
    tar: Unable to create mysql-3.23.49/mit-pthreads/patches/bill_lear <No such file or directory>
    mysql-3.23.49/mit-pthreads/patches/chris_demetriou
    tar: Unable to create mysql-3.23.49/mit-pthreads/patches/chris_demetriou <No such file or directory>
    mysql-3.23.49/mit-pthreads/patches/p153
    tar: Unable to create mysql-3.23.49/mit-pthreads/patches/p153 <No such file or directory>
    mysql-3.23.49/mit-pthreads/patches/mevans
    tar: Unable to create mysql-3.23.49/mit-pthreads/patches/mevans <No such file or directory>
    mysql-3.23.49/mit-pthreads/patches/Streepy2.html
    tar: Unable to create mysql-3.23.49/mit-pthreads/patches/Streepy2.html <No such file or directory>
    mysql-3.23.49/mit-pthreads/Whats_New
    tar: Unable to create mysql-3.23.49/mit-pthreads/Whats_New <No such file or directory>
    mysql-3.23.49/mit-pthreads/README
    tar: Unable to create mysql-3.23.49/mit-pthreads/README <No such file or directory>
    mysql-3.23.49/mit-pthreads/NOTES
    tar: Unable to create mysql-3.23.49/mit-pthreads/NOTES <No such file or directory>
    mysql-3.23.49/mit-pthreads/NOTES_OSR5_BUILD_SKUNKWARE97
    tar: Unable to create mysql-3.23.49/mit-pthreads/NOTES_OSR5_BUILD_SKUNKWARE97 <No such file or directory>
    mysql-3.23.49/mit-pthreads/pg++
    tar: Unable to create mysql-3.23.49/mit-pthreads/pg++ <No such file or directory>
    mysql-3.23.49/mit-pthreads/FAQ
    tar: Unable to create mysql-3.23.49/mit-pthreads/FAQ <No such file or directory>
    mysql-3.23.49/mit-pthreads/TODO-mysql
    tar: Unable to create mysql-3.23.49/mit-pthreads/TODO-mysql <No such file or directory>
    mysql-3.23.49/mit-pthreads/GNUmakefile
    tar: Unable to create mysql-3.23.49/mit-pthreads/GNUmakefile <No such file or directory>
    mysql-3.23.49/mit-pthreads/pgcc
    tar: Unable to create mysql-3.23.49/mit-pthreads/pgcc <No such file or directory>
    mysql-3.23.49/mit-pthreads/.cvsignore
    tar: Unable to create mysql-3.23.49/mit-pthreads/.cvsignore <No such file or directory>
    mysql-3.23.49/mit-pthreads/COPYRIGHT
    tar: Unable to create mysql-3.23.49/mit-pthreads/COPYRIGHT <No such file or directory>
    mysql-3.23.49/mit-pthreads/configure
    tar: Unable to create mysql-3.23.49/mit-pthreads/configure <No such file or directory>
    mysql-3.23.49/mit-pthreads/Changes-mysql
    tar: Unable to create mysql-3.23.49/mit-pthreads/Changes-mysql <No such file or directory>
    mysql-3.23.49/mit-pthreads/config.log
    tar: Unable to create mysql-3.23.49/mit-pthreads/config.log <No such file or directory>
    mysql-3.23.49/mit-pthreads/config.h
    tar: Unable to create mysql-3.23.49/mit-pthreads/config.h <No such file or directory>
    mysql-3.23.49/mit-pthreads/config.status
    tar: Unable to create mysql-3.23.49/mit-pthreads/config.status <No such file or directory>
    mysql-3.23.49/mit-pthreads/config.flags
    tar: Unable to create mysql-3.23.49/mit-pthreads/config.flags <No such file or directory>
    mysql-3.23.49/mit-pthreads/Makefile
    tar: Unable to create mysql-3.23.49/mit-pthreads/Makefile <No such file or directory>
    mysql-3.23.49/libmysql_r
    tar: Could not create: mysql-3.23.49/libmysql_r <No such file or directory>
    mysql-3.23.49/libmysql_r/Makefile.in
    tar: Unable to create mysql-3.23.49/libmysql_r/Makefile.in <No such file or directory>
    mysql-3.23.49/libmysql_r/Makefile.am
    tar: Unable to create mysql-3.23.49/libmysql_r/Makefile.am <No such file or directory>
    mysql-3.23.49/libmysql_r/libmysql.c
    tar: Unable to create mysql-3.23.49/libmysql_r/libmysql.c <No such file or directory>
    mysql-3.23.49/libmysql_r/net.c
    tar: Unable to create mysql-3.23.49/libmysql_r/net.c <No such file or directory>
    mysql-3.23.49/libmysql_r/violite.c
    tar: Unable to create mysql-3.23.49/libmysql_r/violite.c <No such file or directory>
    mysql-3.23.49/libmysql_r/password.c
    tar: Unable to create mysql-3.23.49/libmysql_r/password.c <No such file or directory>
    mysql-3.23.49/libmysql_r/get_password.c
    tar: Unable to create mysql-3.23.49/libmysql_r/get_password.c <No such file or directory>
    mysql-3.23.49/libmysql_r/errmsg.c
    tar: Unable to create mysql-3.23.49/libmysql_r/errmsg.c <No such file or directory>
    mysql-3.23.49/libmysql_r/conf_to_src.c
    tar: Unable to create mysql-3.23.49/libmysql_r/conf_to_src.c <No such file or directory>
    mysql-3.23.49/libmysql
    tar: Could not create: mysql-3.23.49/libmysql <No such file or directory>
    mysql-3.23.49/libmysql/Makefile.in
    tar: Unable to create mysql-3.23.49/libmysql/Makefile.in <No such file or directory>
    mysql-3.23.49/libmysql/Makefile.am
    tar: Unable to create mysql-3.23.49/libmysql/Makefile.am <No such file or directory>
    mysql-3.23.49/libmysql/acinclude.m4
    tar: Unable to create mysql-3.23.49/libmysql/acinclude.m4 <No such file or directory>
    mysql-3.23.49/libmysql/libmysql.c
    tar: Unable to link to mysql-3.23.49/libmysql_r/libmysql.c from mysql-3.23.49/libmysql/libmysql.c <No such file or directory>
    mysql-3.23.49/libmysql/net.c
    tar: Unable to link to mysql-3.23.49/libmysql_r/net.c from mysql-3.23.49/libmysql/net.c <No such file or directory>
    mysql-3.23.49/libmysql/violite.c
    tar: Unable to link to mysql-3.23.49/libmysql_r/violite.c from mysql-3.23.49/libmysql/violite.c <No such file or directory>
    mysql-3.23.49/libmysql/password.c
    tar: Unable to link to mysql-3.23.49/libmysql_r/password.c from mysql-3.23.49/libmysql/password.c <No such file or directory>
    mysql-3.23.49/libmysql/get_password.c
    tar: Unable to link to mysql-3.23.49/libmysql_r/get_password.c from mysql-3.23.49/libmysql/get_password.c <No such file or directory>
    mysql-3.23.49/libmysql/errmsg.c
    tar: Unable to link to mysql-3.23.49/libmysql_r/errmsg.c from mysql-3.23.49/libmysql/errmsg.c <No such file or directory>
    mysql-3.23.49/libmysql/conf_to_src.c
    tar: Unable to link to mysql-3.23.49/libmysql_r/conf_to_src.c from mysql-3.23.49/libmysql/conf_to_src.c <No such file or directory>
    mysql-3.23.49/libmysql/Makefile.shared
    tar: Unable to create mysql-3.23.49/libmysql/Makefile.shared <No such file or directory>
    mysql-3.23.49/client
    tar: Could not create: mysql-3.23.49/client <No such file or directory>
    mysql-3.23.49/client/Makefile.in
    tar: Unable to create mysql-3.23.49/client/Makefile.in <No such file or directory>
    mysql-3.23.49/client/Makefile.am
    tar: Unable to create mysql-3.23.49/client/Makefile.am <No such file or directory>
    mysql-3.23.49/client/mysql.cc
    tar: Unable to create mysql-3.23.49/client/mysql.cc <No such file or directory>
    mysql-3.23.49/client/readline.cc
    tar: Unable to create mysql-3.23.49/client/readline.cc <No such file or directory>
    mysql-3.23.49/client/sql_string.cc
    tar: Unable to create mysql-3.23.49/client/sql_string.cc <No such file or directory>
    mysql-3.23.49/client/completion_hash.cc
    tar: Unable to create mysql-3.23.49/client/completion_hash.cc <No such file or directory>
    mysql-3.23.49/client/mysqladmin.c
    tar: Unable to create mysql-3.23.49/client/mysqladmin.c <No such file or directory>
    mysql-3.23.49/client/mysqlcheck.c
    tar: Unable to create mysql-3.23.49/client/mysqlcheck.c <No such file or directory>
    mysql-3.23.49/client/mysqlshow.c
    tar: Unable to create mysql-3.23.49/client/mysqlshow.c <No such file or directory>
    mysql-3.23.49/client/mysqldump.c
    tar: Unable to create mysql-3.23.49/client/mysqldump.c <No such file or directory>
    mysql-3.23.49/client/mysqlimport.c
    tar: Unable to create mysql-3.23.49/client/mysqlimport.c <No such file or directory>
    mysql-3.23.49/client/mysqltest.c
    tar: Unable to create mysql-3.23.49/client/mysqltest.c <No such file or directory>
    mysql-3.23.49/client/mysqlbinlog.cc
    tar: Unable to create mysql-3.23.49/client/mysqlbinlog.cc <No such file or directory>
    mysql-3.23.49/client/insert_test.c
    tar: Unable to create mysql-3.23.49/client/insert_test.c <No such file or directory>
    mysql-3.23.49/client/select_test.c
    tar: Unable to create mysql-3.23.49/client/select_test.c <No such file or directory>
    mysql-3.23.49/client/thread_test.c
    tar: Unable to create mysql-3.23.49/client/thread_test.c <No such file or directory>
    mysql-3.23.49/client/sql_string.h
    tar: Unable to create mysql-3.23.49/client/sql_string.h <No such file or directory>
    mysql-3.23.49/client/completion_hash.h
    tar: Unable to create mysql-3.23.49/client/completion_hash.h <No such file or directory>
    mysql-3.23.49/client/my_readline.h
    tar: Unable to create mysql-3.23.49/client/my_readline.h <No such file or directory>
    mysql-3.23.49/client/client_priv.h
    tar: Unable to create mysql-3.23.49/client/client_priv.h <No such file or directory>
    mysql-3.23.49/innobase
    tar: Could not create: mysql-3.23.49/innobase <No such file or directory>
    mysql-3.23.49/innobase/Makefile.in
    tar: Unable to create mysql-3.23.49/innobase/Makefile.in <No such file or directory>
    mysql-3.23.49/innobase/stamp-h.in
    tar: Unable to create mysql-3.23.49/innobase/stamp-h.in <No such file or directory>
    mysql-3.23.49/innobase/Makefile.am
    tar: Unable to create mysql-3.23.49/innobase/Makefile.am <No such file or directory>
    mysql-3.23.49/innobase/aclocal.m4
    tar: Unable to create mysql-3.23.49/innobase/aclocal.m4 <No such file or directory>
    mysql-3.23.49/innobase/configure
    tar: Unable to create mysql-3.23.49/innobase/configure <No such file or directory>
    mysql-3.23.49/innobase/configure.in
    tar: Unable to create mysql-3.23.49/innobase/configure.in <No such file or directory>
    mysql-3.23.49/innobase/ib_config.h.in
    tar: Unable to create mysql-3.23.49/innobase/ib_config.h.in <No such file or directory>
    mysql-3.23.49/innobase/ib_config.h
    tar: Unable to create mysql-3.23.49/innobase/ib_config.h <No such file or directory>
    mysql-3.23.49/innobase/os
    tar: Could not create: mysql-3.23.49/innobase/os <No such file or directory>
    mysql-3.23.49/innobase/os/Makefile.in
    tar: Unable to create mysql-3.23.49/innobase/os/Makefile.in <No such file or directory>
    mysql-3.23.49/innobase/os/Makefile.am
    tar: Unable to create mysql-3.23.49/innobase/os/Makefile.am <No such file or directory>
    mysql-3.23.49/innobase/os/os0proc.c
    tar: Unable to create mysql-3.23.49/innobase/os/os0proc.c <No such file or directory>
    mysql-3.23.49/innobase/os/os0shm.c
    tar: Unable to create mysql-3.23.49/innobase/os/os0shm.c <No such file or directory>
    mysql-3.23.49/innobase/os/os0sync.c
    tar: Unable to create mysql-3.23.49/innobase/os/os0sync.c <No such file or directory>
    mysql-3.23.49/innobase/os/os0thread.c
    tar: Unable to create mysql-3.23.49/innobase/os/os0thread.c <No such file or directory>
    mysql-3.23.49/innobase/os/os0file.c
    tar: Unable to create mysql-3.23.49/innobase/os/os0file.c <No such file or directory>
    mysql-3.23.49/innobase/ut
    tar: Could not create: mysql-3.23.49/innobase/ut <No such file or directory>
    mysql-3.23.49/innobase/ut/Makefile.in
    tar: Unable to create mysql-3.23.49/innobase/ut/Makefile.in <No such file or directory>
    mysql-3.23.49/innobase/ut/Makefile.am
    tar: Unable to create mysql-3.23.49/innobase/ut/Makefile.am <No such file or directory>
    mysql-3.23.49/innobase/ut/ut0byte.c
    tar: Unable to create mysql-3.23.49/innobase/ut/ut0byte.c <No such file or directory>
    mysql-3.23.49/innobase/ut/ut0dbg.c
    tar: Unable to create mysql-3.23.49/innobase/ut/ut0dbg.c <No such file or directory>
    mysql-3.23.49/innobase/ut/ut0mem.c
    tar: Unable to create mysql-3.23.49/innobase/ut/ut0mem.c <No such file or directory>
    mysql-3.23.49/innobase/ut/ut0rnd.c
    tar: Unable to create mysql-3.23.49/innobase/ut/ut0rnd.c <No such file or directory>
    mysql-3.23.49/innobase/ut/ut0ut.c
    tar: Unable to create mysql-3.23.49/innobase/ut/ut0ut.c <No such file or directory>
    mysql-3.23.49/innobase/btr
    tar: Could not create: mysql-3.23.49/innobase/btr <No such file or directory>
    mysql-3.23.49/innobase/btr/Makefile.in
    tar: Unable to create mysql-3.23.49/innobase/btr/Makefile.in <No such file or directory>
    mysql-3.23.49/innobase/btr/Makefile.am
    tar: Unable to create mysql-3.23.49/innobase/btr/Makefile.am <No such file or directory>
    mysql-3.23.49/innobase/btr/btr0btr.c
    tar: Unable to create mysql-3.23.49/innobase/btr/btr0btr.c <No such file or directory>
    mysql-3.23.49/innobase/btr/btr0cur.c
    tar: Unable to create mysql-3.23.49/innobase/btr/btr0cur.c <No such file or directory>
    mysql-3.23.49/innobase/btr/btr0pcur.c
    tar: Unable to create mysql-3.23.49/innobase/btr/btr0pcur.c <No such file or directory>
    mysql-3.23.49/innobase/btr/btr0sea.c
    tar: Unable to create mysql-3.23.49/innobase/btr/btr0sea.c <No such file or directory>
    mysql-3.23.49/innobase/buf
    tar: Could not create: mysql-3.23.49/innobase/buf <No such file or directory>
    mysql-3.23.49/innobase/buf/Makefile.in
    tar: Unable to create mysql-3.23.49/innobase/buf/Makefile.in <No such file or directory>
    mysql-3.23.49/innobase/buf/Makefile.am
    tar: Unable to create mysql-3.23.49/innobase/buf/Makefile.am <No such file or directory>
    mysql-3.23.49/innobase/buf/buf0buf.c
    tar: Unable to create mysql-3.23.49/innobase/buf/buf0buf.c <No such file or directory>
    mysql-3.23.49/innobase/buf/buf0flu.c
    tar: Unable to create mysql-3.23.49/innobase/buf/buf0flu.c <No such file or directory>
    mysql-3.23.49/innobase/buf/buf0lru.c
    tar: Unable to create mysql-3.23.49/innobase/buf/buf0lru.c <No such file or directory>
    mysql-3.23.49/innobase/buf/buf0rea.c
    tar: Unable to create mysql-3.23.49/innobase/buf/buf0rea.c <No such file or directory>
    mysql-3.23.49/innobase/com
    tar: Could not create: mysql-3.23.49/innobase/com <No such file or directory>
    mysql-3.23.49/innobase/com/Makefile.in
    tar: Unable to create mysql-3.23.49/innobase/com/Makefile.in <No such file or directory>
    mysql-3.23.49/innobase/com/Makefile.am
    tar: Unable to create mysql-3.23.49/innobase/com/Makefile.am <No such file or directory>
    mysql-3.23.49/innobase/com/com0com.c
    tar: Unable to create mysql-3.23.49/innobase/com/com0com.c <No such file or directory>
    mysql-3.23.49/innobase/com/com0shm.c
    tar: Unable to create mysql-3.23.49/innobase/com/com0shm.c <No such file or directory>
    mysql-3.23.49/innobase/data
    tar: Could not create: mysql-3.23.49/innobase/data <No such file or directory>
    mysql-3.23.49/innobase/data/Makefile.in
    tar: Unable to create mysql-3.23.49/innobase/data/Makefile.in <No such file or directory>
    mysql-3.23.49/innobase/data/Makefile.am
    tar: Unable to create mysql-3.23.49/innobase/data/Makefile.am <No such file or directory>
    mysql-3.23.49/innobase/data/data0data.c
    tar: Unable to create mysql-3.23.49/innobase/data/data0data.c <No such file or directory>
    mysql-3.23.49/innobase/data/data0type.c
    tar: Unable to create mysql-3.23.49/innobase/data/data0type.c <No such file or directory>
    mysql-3.23.49/innobase/dict
    tar: Could not create: mysql-3.23.49/innobase/dict <No such file or directory>
    mysql-3.23.49/innobase/dict/Makefile.in
    tar: Unable to create mysql-3.23.49/innobase/dict/Makefile.in <No such file or directory>
    mysql-3.23.49/innobase/dict/Makefile.am
    tar: Unable to create mysql-3.23.49/innobase/dict/Makefile.am <No such file or directory>
    mysql-3.23.49/innobase/dict/dict0boot.c
    tar: Unable to create mysql-3.23.49/innobase/dict/dict0boot.c <No such file or directory>
    mysql-3.23.49/innobase/dict/dict0crea.c
    tar: Unable to create mysql-3.23.49/innobase/dict/dict0crea.c <No such file or directory>
    mysql-3.23.49/innobase/dict/dict0dict.c
    tar: Unable to create mysql-3.23.49/innobase/dict/dict0dict.c <No such file or directory>
    mysql-3.23.49/innobase/dict/dict0load.c
    tar: Unable to create mysql-3.23.49/innobase/dict/dict0load.c <No such file or directory>
    mysql-3.23.49/innobase/dict/dict0mem.c
    tar: Unable to create mysql-3.23.49/innobase/dict/dict0mem.c <No such file or directory>
    mysql-3.23.49/innobase/dyn
    tar: Could not create: mysql-3.23.49/innobase/dyn <No such file or directory>
    mysql-3.23.49/innobase/dyn/Makefile.in
    tar: Unable to create mysql-3.23.49/innobase/dyn/Makefile.in <No such file or directory>
    mysql-3.23.49/innobase/dyn/Makefile.am
    tar: Unable to create mysql-3.23.49/innobase/dyn/Makefile.am <No such file or directory>
    mysql-3.23.49/innobase/dyn/dyn0dyn.c
    tar: Unable to create mysql-3.23.49/innobase/dyn/dyn0dyn.c <No such file or directory>
    mysql-3.23.49/innobase/eval
    tar: Could not create: mysql-3.23.49/innobase/eval <No such file or directory>
    mysql-3.23.49/innobase/eval/Makefile.in
    tar: Unable to create mysql-3.23.49/innobase/eval/Makefile.in <No such file or directory>
    mysql-3.23.49/innobase/eval/Makefile.am
    tar: Unable to create mysql-3.23.49/innobase/eval/Makefile.am <No such file or directory>
    mysql-3.23.49/innobase/eval/eval0eval.c
    tar: Unable to create mysql-3.23.49/innobase/eval/eval0eval.c <No such file or directory>
    mysql-3.23.49/innobase/eval/eval0proc.c
    tar: Unable to create mysql-3.23.49/innobase/eval/eval0proc.c <No such file or directory>
    mysql-3.23.49/innobase/fil
    tar: Could not create: mysql-3.23.49/innobase/fil <No such file or directory>
    mysql-3.23.49/innobase/fil/Makefile.in
    tar: Unable to create mysql-3.23.49/innobase/fil/Makefile.in <No such file or directory>
    mysql-3.23.49/innobase/fil/Makefile.am
    tar: Unable to create mysql-3.23.49/innobase/fil/Makefile.am <No such file or directory>
    mysql-3.23.49/innobase/fil/fil0fil.c
    tar: Unable to create mysql-3.23.49/innobase/fil/fil0fil.c <No such file or directory>
    mysql-3.23.49/innobase/fsp
    tar: Could not create: mysql-3.23.49/innobase/fsp <No such file or directory>
    mysql-3.23.49/innobase/fsp/Makefile.in
    tar: Unable to create mysql-3.23.49/innobase/fsp/Makefile.in <No such file or directory>
    mysql-3.23.49/innobase/fsp/Makefile.am
    tar: Unable to create mysql-3.23.49/innobase/fsp/Makefile.am <No such file or directory>
    mysql-3.23.49/innobase/fsp/fsp0fsp.c
    tar: Unable to create mysql-3.23.49/innobase/fsp/fsp0fsp.c <No such file or directory>
    mysql-3.23.49/innobase/fut
    tar: Could not create: mysql-3.23.49/innobase/fut <No such file or directory>
    mysql-3.23.49/innobase/fut/Makefile.in
    tar: Unable to create mysql-3.23.49/innobase/fut/Makefile.in <No such file or directory>
    mysql-3.23.49/innobase/fut/Makefile.am
    tar: Unable to create mysql-3.23.49/innobase/fut/Makefile.am <No such file or directory>
    mysql-3.23.49/innobase/fut/fut0fut.c
    tar: Unable to create mysql-3.23.49/innobase/fut/fut0fut.c <No such file or directory>
    mysql-3.23.49/innobase/fut/fut0lst.c
    tar: Unable to create mysql-3.23.49/innobase/fut/fut0lst.c <No such file or directory>
    mysql-3.23.49/innobase/ha
    tar: Could not create: mysql-3.23.49/innobase/ha <No such file or directory>
    mysql-3.23.49/innobase/ha/Makefile.in
    tar: Unable to create mysql-3.23.49/innobase/ha/Makefile.in <No such file or directory>
    mysql-3.23.49/innobase/ha/Makefile.am
    tar: Unable to create mysql-3.23.49/innobase/ha/Makefile.am <No such file or directory>
    mysql-3.23.49/innobase/ha/ha0ha.c
    tar: Unable to create mysql-3.23.49/innobase/ha/ha0ha.c <No such file or directory>
    mysql-3.23.49/innobase/ha/hash0hash.c
    tar: Unable to create mysql-3.23.49/innobase/ha/hash0hash.c <No such file or directory>
    mysql-3.23.49/innobase/ibuf
    tar: Could not create: mysql-3.23.49/innobase/ibuf <No such file or directory>
    mysql-3.23.49/innobase/ibuf/Makefile.in
    tar: Unable to create mysql-3.23.49/innobase/ibuf/Makefile.in <No such file or directory>
    mysql-3.23.49/innobase/ibuf/Makefile.am
    tar: Unable to create mysql-3.23.49/innobase/ibuf/Makefile.am <No such file or directory>
    mysql-3.23.49/innobase/ibuf/ibuf0ibuf.c
    tar: Unable to create mysql-3.23.49/innobase/ibuf/ibuf0ibuf.c <No such file or directory>
    mysql-3.23.49/innobase/include
    tar: Could not create: mysql-3.23.49/innobase/include <No such file or directory>
    mysql-3.23.49/innobase/include/Makefile.in
    tar: Unable to create mysql-3.23.49/innobase/include/Makefile.in <No such file or directory>
    mysql-3.23.49/innobase/include/Makefile.am
    tar: Unable to create mysql-3.23.49/innobase/include/Makefile.am <No such file or directory>
    mysql-3.23.49/innobase/include/btr0btr.h
    tar: Unable to create mysql-3.23.49/innobase/include/btr0btr.h <No such file or directory>
    mysql-3.23.49/innobase/include/btr0btr.ic
    tar: Unable to create mysql-3.23.49/innobase/include/btr0btr.ic <No such file or directory>
    mysql-3.23.49/innobase/include/btr0cur.h
    tar: Unable to create mysql-3.23.49/innobase/include/btr0cur.h <No such file or directory>
    mysql-3.23.49/innobase/include/btr0cur.ic
    tar: Unable to create mysql-3.23.49/innobase/include/btr0cur.ic <No such file or directory>
    mysql-3.23.49/innobase/include/btr0pcur.h
    tar: Unable to create mysql-3.23.49/innobase/include/btr0pcur.h <No such file or directory>
    mysql-3.23.49/innobase/include/btr0pcur.ic
    tar: Unable to create mysql-3.23.49/innobase/include/btr0pcur.ic <No such file or directory>
    mysql-3.23.49/innobase/include/btr0sea.h
    tar: Unable to create mysql-3.23.49/innobase/include/btr0sea.h <No such file or directory>
    mysql-3.23.49/innobase/include/btr0sea.ic
    tar: Unable to create mysql-3.23.49/innobase/include/btr0sea.ic <No such file or directory>
    mysql-3.23.49/innobase/include/btr0types.h
    tar: Unable to create mysql-3.23.49/innobase/include/btr0types.h <No such file or directory>
    mysql-3.23.49/innobase/include/buf0buf.h
    tar: Unable to create mysql-3.23.49/innobase/include/buf0buf.h <No such file or directory>
    mysql-3.23.49/innobase/include/buf0buf.ic
    tar: Unable to create mysql-3.23.49/innobase/include/buf0buf.ic <No such file or directory>
    mysql-3.23.49/innobase/include/buf0flu.h
    tar: Unable to create mysql-3.23.49/innobase/include/buf0flu.h <No such file or directory>
    mysql-3.23.49/innobase/include/buf0flu.ic
    tar: Unable to create mysql-3.23.49/innobase/include/buf0flu.ic <No such file or directory>
    mysql-3.23.49/innobase/include/buf0lru.h
    tar: Unable to create mysql-3.23.49/innobase/include/buf0lru.h <No such file or directory>
    mysql-3.23.49/innobase/include/buf0lru.ic
    tar: Unable to create mysql-3.23.49/innobase/include/buf0lru.ic <No such file or directory>
    mysql-3.23.49/innobase/include/buf0rea.h
    tar: Unable to create mysql-3.23.49/innobase/include/buf0rea.h <No such file or directory>
    mysql-3.23.49/innobase/include/buf0types.h
    tar: Unable to create mysql-3.23.49/innobase/include/buf0types.h <No such file or directory>
    mysql-3.23.49/innobase/include/com0com.h
    tar: Unable to create mysql-3.23.49/innobase/include/com0com.h <No such file or directory>
    mysql-3.23.49/innobase/include/com0com.ic
    tar: Unable to create mysql-3.23.49/innobase/include/com0com.ic <No such file or directory>
    mysql-3.23.49/innobase/include/com0shm.h
    tar: Unable to create mysql-3.23.49/innobase/include/com0shm.h <No such file or directory>
    mysql-3.23.49/innobase/include/com0shm.ic
    tar: Unable to create mysql-3.23.49/innobase/include/com0shm.ic <No such file or directory>
    mysql-3.23.49/innobase/include/data0data.h
    tar: Unable to create mysql-3.23.49/innobase/include/data0data.h <No such file or directory>
    mysql-3.23.49/innobase/include/data0data.ic
    tar: Unable to create mysql-3.23.49/innobase/include/data0data.ic <No such file or directory>
    mysql-3.23.49/innobase/include/data0type.h
    tar: Unable to create mysql-3.23.49/innobase/include/data0type.h <No such file or directory>
    mysql-3.23.49/innobase/include/data0type.ic
    tar: Unable to create mysql-3.23.49/innobase/include/data0type.ic <No such file or directory>
    mysql-3.23.49/innobase/include/data0types.h
    tar: Unable to create mysql-3.23.49/innobase/include/data0types.h <No such file or directory>
    mysql-3.23.49/innobase/include/db0err.h
    tar: Unable to create mysql-3.23.49/innobase/include/db0err.h <No such file or directory>
    mysql-3.23.49/innobase/include/dict0boot.h
    tar: Unable to create mysql-3.23.49/innobase/include/dict0boot.h <No such file or directory>
    mysql-3.23.49/innobase/include/dict0boot.ic
    tar: Unable to create mysql-3.23.49/innobase/include/dict0boot.ic <No such file or directory>
    mysql-3.23.49/innobase/include/dict0crea.h
    tar: Unable to create mysql-3.23.49/innobase/include/dict0crea.h <No such file or directory>
    mysql-3.23.49/innobase/include/dict0crea.ic
    tar: Unable to create mysql-3.23.49/innobase/include/dict0crea.ic <No such file or directory>
    mysql-3.23.49/innobase/include/dict0dict.h
    tar: Unable to create mysql-3.23.49/innobase/include/dict0dict.h <No such file or directory>
    mysql-3.23.49/innobase/include/dict0dict.ic
    tar: Unable to create mysql-3.23.49/innobase/include/dict0dict.ic <No such file or directory>
    mysql-3.23.49/innobase/include/dict0load.h
    tar: Unable to create mysql-3.23.49/innobase/include/dict0load.h <No such file or directory>
    mysql-3.23.49/innobase/include/dict0load.ic
    tar: Unable to create mysql-3.23.49/innobase/include/dict0load.ic <No such file or directory>
    mysql-3.23.49/innobase/include/dict0mem.h
    tar: Unable to create mysql-3.23.49/innobase/include/dict0mem.h <No such file or directory>
    mysql-3.23.49/innobase/include/dict0mem.ic
    tar: Unable to create mysql-3.23.49/innobase/include/dict0mem.ic <No such file or directory>
    mysql-3.23.49/innobase/include/dict0types.h
    tar: Unable to create mysql-3.23.49/innobase/include/dict0types.h <No such file or directory>
    mysql-3.23.49/innobase/include/dyn0dyn.h
    tar: Unable to create mysql-3.23.49/innobase/include/dyn0dyn.h <No such file or directory>
    mysql-3.23.49/innobase/include/dyn0dyn.ic
    tar: Unable to create mysql-3.23.49/innobase/include/dyn0dyn.ic <No such file or directory>
    mysql-3.23.49/innobase/include/eval0eval.h
    tar: Unable to create mysql-3.23.49/innobase/include/eval0eval.h <No such file or directory>
    mysql-3.23.49/innobase/include/eval0eval.ic
    tar: Unable to create mysql-3.23.49/innobase/include/eval0eval.ic <No such file or directory>
    mysql-3.23.49/innobase/include/eval0proc.h
    tar: Unable to create mysql-3.23.49/innobase/include/eval0proc.h <No such file or directory>
    mysql-3.23.49/innobase/include/eval0proc.ic
    tar: Unable to create mysql-3.23.49/innobase/include/eval0proc.ic <No such file or directory>
    mysql-3.23.49/innobase/include/fil0fil.h
    tar: Unable to create mysql-3.23.49/innobase/include/fil0fil.h <No such file or directory>
    mysql-3.23.49/innobase/include/fsp0fsp.h
    tar: Unable to create mysql-3.23.49/innobase/include/fsp0fsp.h <No such file or directory>

    -- truncated --
  • Unable to define the MySQL User
    2002-05-19 16:21:56  michele [Reply | View]

    Sorry to come so late. I've begun the tutorial part I yesterday and passed through the first 4 parts painless.

    With part 5, I simply cannot create the MySQL Account, since I have already a MySQL Database Server account with short name mysql.

    I don't know where it comes from (likely from one package I installed), but I have not created it by myself.

    I'm running system 10.1.4 with WebObjects 5.1.2 and JavaWebStart 1.0.1 if it matters. And I'm the only user of this PowerMacintosh G3.

    Any help would be much appreciated.

    Michèle
  • Yeah, but how do you shut it down
    2002-05-10 17:33:27  hembeck [Reply | View]

    How does one shut down the sql server, either via the terminal or a script similar to the start-up script mentioned in the article.

    Thanks,
    Fernando
  • .pkg MySQL installation won't start
    2002-05-09 10:22:19  cmessley [Reply | View]

    I too am getting hung up on initializing the core MySQL database. Here's what I'm seeing:


    [localhost:/usr/local/mysql] root# sudo ./scripts/mysql_install_db
    Installing all prepared tables
    020509 12:11:49 ./bin/mysqld: Shutdown Complete


    To start mysqld at boot time you have to copy support-files/mysql.server
    to the right place for your system

    PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
    This is done with:
    ./bin/mysqladmin -u root -p password 'new-password'
    ./bin/mysqladmin -u root -h localhost -p password 'new-password'
    See the manual for more instructions.

    NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run
    the ./bin/mysql_fix_privilege_tables. Otherwise you will not be
    able to use the new GRANT command!

    You can start the MySQL daemon with:
    cd . ; ./bin/safe_mysqld &

    You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
    cd sql-bench ; run-all-tests

    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

    [localhost:/usr/local/mysql] root# sudo chown -R mysql /usr/local/mysql
    [localhost:/usr/local/mysql] root# sudo ./bin/safe_mysqld --user=mysql &
    [1] 1424
    [localhost:/usr/local/mysql] root# Starting mysqld daemon with databases from /usr/local/mysql/data
    020509 12:12:48 mysqld ended


    I'm also loosing the command prompt at this point. I've tried running this several times with the same results.

    Sorry about redundantly posting about this problem but I haven't found a solution to this from others comments. Any insight would be appreciated.

    - Chris
    • .pkg MySQL installation won't start
      2002-05-10 10:47:03  cmessley [Reply | View]

      I went back to Marc Liyanage's site (http://www.entropy.ch) to see if he had anything posted about this problem and noticed that his install instructions were the same except for the chown command:

      sudo chown -R /usr/local/mysql/*

      This did the trick. Must... remain... awake...
  • Errcode: 13
    2002-05-07 04:26:23  anthropos9 [Reply | View]

    I ran the pkg install of MySQL and everything seemed to be working until I ran the test.php script. Here's what I got:

    Connection to the database has been established.
    Can't create/write to file './test/wisdom.frm' (Errcode: 13)
    Table 'test.wisdom' doesn't exist
    Table 'test.wisdom' doesn't exist


    Warning: Supplied argument is not a valid MySQL result resource in /Users/seandean/Sites/test1.php on line 41

    Can anyone help me with what I may have done wrong here?
    • Errcode: 13
      2002-05-07 15:27:28  jmillr [Reply | View]

      I had exactly the same problem. Looking at all the posts here I saw one clue:

      sudo chown -R mysql /usr/local/mysql/*

      After running this command, the php script runs as advertised. (The instructions in the article are still wrong; they omit the trailing '/*').
  • Apache giving 405 errors for POST requests.
    2002-05-05 13:10:47  david.parrish@buentec.com [Reply | View]

    this may not be the perfect juncture for this question / observation, but as I am confident that Morbus knows the answer, I'm going to give it a try.

    I'm getting 405 errors from Apache for any POST request. I've had a look at the access log files to verify this, and all POST requests are resulting in 405.

    This is odd, because a couple of days ago, I tried the PHP test in the article (hello.php POSTS data to action.php), and it worked fine.

    As far as I'm aware I have not changed anythingin the httpd.config file since then - but I am having my doubts.

    I've had a good look throught the Apache documentation, and I can't find anything that might cause or rectify this issue.

    Any thoughts - anyone?
    /David
    • Apache giving 405 errors for POST requests.
      2003-07-18 17:27:48  anonymous2 [Reply | View]

      I am having a similar problem. I have noticed a few other things in my situation however. That is, http://www.mydomain.com/cgi-bin/ is not available and the files at http://www.mydomain.com/CGI-Executables/ are read as text files. This suggests that the Script Alias in httpd.conf is not being set but I have checked it and it looks fine. Any other ideas folks?
  • Warning: MySQL Connection Failed: Can't connect to MySQL server on 'localhost' (61)
    2002-05-04 17:21:56  xor81 [Reply | View]

    excellent articles....did 1-5 without any problems but then i got this on MySQL.....seems it is stopping straight away after starting....any ideas

    [localhost:/usr/local/mysql] ian%
    [localhost:/usr/local/mysql] ian% Starting mysqld daemon with databases from /usr/local/mysql/data
    020505 01:15:50 mysqld ended
    • update
      2002-05-05 08:20:19  xor81 [Reply | View]

      After a days playing with the terminal I managed to get it to:

      Warning: Host 'localhost.dircon.co.uk' is not allowed to connect to this MySQL server in /Library/WebServer/Documents/test_sql.php on line 6

      can't be far off now :-(

      how about tomcat on osx
      Ian

      • Resolution?
        2002-05-22 16:32:58  sanjuanio1 [Reply | View]

        I am having the same problem. Did you find out how to resolve?

        I have the following error messages:

        Warning: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61) in /Library/WebServer/Documents/test.php on line 6

        Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61)
        in /Library/WebServer/Documents/test.php on line 6

        Warning: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61) in /Library/WebServer/Documents/test.php on line 10

        Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61)
        in /Library/WebServer/Documents/test.php on line 10

        Warning: MySQL: A link to the server could not be established in /Library/WebServer/Documents/test.php on line 10

        Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61)

        My Sequel database session keeps ending when I check it using the chown line. I also downloaded the doubleclick startup.

        Any ideas?
        • Closer
          2002-05-22 18:09:10  sanjuanio1 [Reply | View]

          I havent found the answer quite yet, but getting closer. see these links off of the mysql site if you have this problem.

          http://www.mysql.com/doc/C/a/Can_not_connect_to_server.html

          http://www.mysql.com/doc/S/t/Starting_server.html

          and let me know if it helps.

          danke
  • Can't Resolve Hostname
    2002-05-01 09:13:09  orisjt [Reply | View]

    First of all, THANKS for the tutorial. I finally got PHP and SQL up and running on my OS X Server because of your articles (btw, I am not an IT person, and I haven't used command-line UNIX since 1984).

    Even though SQL seems to be running now, I cannot seem to resolve the actual hostname of the server. The test.php page you provide for the MySQL example works as long as the hostname is entered as'localhost', but if I use the actual hostname of the server or it's IP address, I get a 'cannot connect' error. I get the same problem with another package (PowerPHlogger), except it won't even recognize the 'localhost' variable, so I can't get it to work at all.

    What's up?
  • access denied
    2002-05-01 02:06:13  bernad [Reply | View]

    I know I made it work before with a nother tutorial, now it says
    Host 'localhost.127.in-addr.arpa' is not allowed to connect to this MySQL server in ...
    • access denied
      2002-05-05 12:52:43  xor81 [Reply | View]

      yes...same error....see update post....if you find a solution can you mail a copy to xor81@yahoo.com
      thanks
  • Ugh :: Warning: Access denied...
    2002-05-01 00:31:56  gosick [Reply | View]

    In as much as I'm following the plebian way and doing what I'm told - Here's the result of my play...

    "Warning: Access denied for user: 'root@localhost' (Using password: NO) in /Library/WebServer/Documents/test.php on line 5



    Warning: MySQL Connection Failed: Access denied for user: 'root@localhost' (Using password: NO)
    in /Library/WebServer/Documents/test.php on line 5

    Connection to the database has been established.


    Warning: Supplied argument is not a valid MySQL-Link resource in /Library/WebServer/Documents/test.php on line 18




    Warning: Supplied argument is not a valid MySQL-Link resource in /Library/WebServer/Documents/test.php on line 28




    Warning: Supplied argument is not a valid MySQL-Link resource in /Library/WebServer/Documents/test.php on line 35




    Warning: Supplied argument is not a valid MySQL result resource in /Library/WebServer/Documents/test.php on line 41


    "

    What's my issue? & How might I over come it?

    All help is appreciated...

    Jj
  • gosh-darn password stuff
    2002-04-30 22:24:34  oldbenway [Reply | View]

    Okay. So I did everything, it all worked fine, I complied my own SQL, set up the service so it starts when I boot- the last thing, I went to change the password for security.
    The verbatim instructions in the tutorial did nothing (error) BUT then I notice that right above that, the final install command gave me a pointer:
    PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
    This is done with:
    "/usr/local/bin/mysqladmin -u root -p password 'new-password'
    See the manual for more instructions."

    Soooo I type it in (and below is trhe exact line grabbed from my terminal):
    [localhost:/usr/local] donny% /usr/local/bin/mysqladmin -u root -p password 'yeahRight'
    Enter password:
    /usr/local/bin/mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user: 'root@localhost' (Using password: YES)'

    So it seems to have created a password, but won't let me use it, whatever it may be- I know i messed things up, is there anyway to force a password reset in SQL????

    Thanks for helpinging the Newb (who shouldn't be allowed to run a terminal)
    -oldbenway@hotmail.com
    • gosh-darn password stuff
      2002-10-09 11:08:16  thaddaeus [Reply | View]

      My problem is very similar...

      after i am prompted to enter my password i THEN get.

      mysqladmin: command not found.

      that's kind of weird because im in /bin and I can see the executable in the directory.

      every subsequent attempt resolved in a command not found right away.

      i tried rehashing to no avail.
    • gosh-darn password stuff
      2002-06-03 17:01:40  mknauf [Reply | View]

      Hey, I did the same thing ;-(

      Help... anybody...?

      mbk@mbknauf.com
  • C compiler cannot create executables error
    2002-04-27 17:01:09  dhtmlkitchen [Reply | View]

    configure: error: installation or configuration problem: C compiler cannot create executables.

    -How to deal with this problem?
  • Problem with chown
    2002-04-26 15:11:04  mac@udigit.se [Reply | View]

    When I issue the chown command I get this error. What does it mean?

    sudo chown -R mysql /usr/local/var/*
    sudo: No match.

    /Mac
  • Incorrect chown statement
    2002-04-26 00:16:18  clatko [Reply | View]

    The article states the following line should be used to change ownership of the var directory and its contents:

    sudo chown -R mysql /usr/local/var/*

    Doing this, I was not able to successfully get mysqld to run. I had to change ownership of the var directory itself as well before mysql would start properly. This did the trick:

    sudo chown -R mysql /usr/local/var
    • Kevin Hemenway photo Incorrect chown statement
      2002-04-26 04:44:03  Kevin Hemenway | O'Reilly AuthorO'Reilly Blogger [Reply | View]

      This should be fixed in the article text soon.
  • error 1044 and 1045
    2002-04-25 20:21:48  gaga1 [Reply | View]

    No end of frustration with the "error 1044 and 1045 access denied" when I try to create a db in mysql. Permission denied. Sheesh.

    I wrote Marc Liyanage (the package version of the MySQL download) and he said I need to ask my administrator for permission.

    Uhh, it's my iBook dude. I think I should be OK for permissions.

    Please, someone, tell me what's up? (I don't think it's a chmod g+w thing. If so, where is the file to change?)

    Grateful should you answer this query.
    • Kevin Hemenway photo error 1044 and 1045
      2002-04-26 04:38:38  Kevin Hemenway | O'Reilly AuthorO'Reilly Blogger [Reply | View]

      Marc has absolutely nothing to do with the configuration of your MySQL server, even if he did make the package, since the package is a doubleclickable for of the defaults chosen by the creators of MySQL - not Marc. As for permissions, it doesn't matter if you're the only user of the computer, or if the computer is only going to be a dev box - permissions exist and are strictly enforced in the Linux world. It takes a bit of getting used to, but in the long run, they make absolutely perfect sense.

      The permissions in question have nothing to do with file permissions, like chmod or chown - they're related to the permissions that you need to modify the MySQL database. Again, it doesn't matter if you're the only person using it.

      Technically, if you ran through the instructions in the article word for word, the package version should be running marvelously for you - most of the ambiguity lied in a source install. In any case, you can find a large number of possible solutions at the MySQL site.
      • error 1044 and 1045...ok..but no CREATE
        2002-04-26 06:49:02  gaga1 [Reply | View]

        Much obliged for your response. Followed your lesson. Yep. Great. PHP works.

        But nope. No indication of how to CREATE a database in MySQL. Your example uses the "test" db in the MYSQL pkg.

        I still get 1044 when attempting to create a db in MySQL:

        mysql> CREATE DATABASE gaga;
        ERROR 1044: Access denied for user: '@localhost' to database 'gaga'
        mysql>

        Now what do to get "Access accepted" to create a new db?

        Vexing.


        • error 1044 and 1045...ok..but no CREATE
          2003-07-04 17:21:16  anonymous2 [Reply | View]

          how do i get into the 'shell' ....
        • Kevin Hemenway photo error 1044 and 1045...ok..but no CREATE
          2002-04-26 18:34:12  Kevin Hemenway | O'Reilly AuthorO'Reilly Blogger [Reply | View]

          Part 5 was intended to get MySQL up and running on your OS X box. It's not intended to teach you how to administer MySQL, or code SQL, or any of that stuff. So, your best bet is to get a book on MySQL, or start perusing MySQL tutorials around on the web.
          • error 1044 and 1045...ok..but no CREATE
            2002-04-26 20:49:58  gaga1 [Reply | View]

            Much obliged once agan for your curt reminder. Now I've gone to a dozen websites on MySQL, all say different things, and all are very cryptic, and none address the issue.

            Would it not suffice just to say "oh yeah, to create a database in MySQL you need to do X..., and be sure that you have done Y to get rid of that pesky 1044 access denied message"

            Sheesh.
  • Found a correction to final commands
    2002-04-07 22:58:37  fleafrier [Reply | View]

    Hey all,
    GREAT articles morbus. Keep them coming! Maybe and article on Tomcat?
    Anyway, As a lot of people did, I was having trouble getting mysql to start. After rustling through the posts I noticed that you had suggested to one person to try running the command:
    sudo chown -R mysql /usr/local/var

    as well as the other sudo chown command.
    This is what fixed it for me. Hope that helps someone!!

    Go Morbus!! Keep the info flowing!
  • uninstall mysql?
    2002-04-05 23:12:44  vaie [Reply | View]

    I'm so brilliant that I forgot my mysql root password. Does anyone know how I can uninstall mysql and start over? I tried to install over itself, but that didn't work.

    I used the binary version.

    thanks!
    • uninstall mysql?
      2002-04-08 21:23:05  vaie [Reply | View]

      No worries, I got it fixed! I forgot to mention in the original post that I had thought I uninstalled the binary version, and then had installed the source version, which just really messed things up.

      After some down and dirty wrestling with things I have it working again.

      And I have written down my password. *bows*

      Thank you.
      • Is it possible to uninstall source version?
        2002-06-06 15:40:33  rdez378 [Reply | View]

        This series was great. I did every step without any major problems. I was even successfully running Phpmyadmin until I deleted the root user by mistake. Now it says no users within phpmyadmn (already contacted them) and when I access mysql using the root password I am still able to login with no problem. However, when I try to administer to the databases or add new users i get the 1044/1045 errors. I've tried some of the fixes listed on mysql.com but with all of them I eventually get an access denied. What should I do?

        I think my best bet is to uninstall mysql but i did it using the source version so i don't know of any script.

        Would reinstalling apache work if worst came to worst?

        I'm at my wit's end here. I'm usually able to find answers using forums like these or just following manual instructions but I don't think too many people would do something as stupid so that's why no info on it.

        Anyone with any ideas let me know asap before i do something else more damaging to my system!

        I'm operating Mac 10.1.4, Apache 1.3.22, and mysql 3.23.29 on the localhost.

        Thanks!
  • What next?
    2002-04-03 04:31:16  bovisart [Reply | View]

    Maybe the place of WebObjects in it all?
    And maybe 4th Dimension, JaneBuilder, Macromedia and others,
    and do you really need them.....

    Thanks sofar. Only stupid that OS X costs me money again. And more, that I don't have it now
    I bought a far too expensive iMac (the original) with OS 8.1, had to pay for 8.5, 9.0 whole new again, beta'd X and just missed the free OS X 10.1.....Any tips how to proceed.

    Thanks anyway so far. Conny.
    • What next?
      2002-04-27 18:34:11  dhtmlkitchen [Reply | View]

      I could let you borrow my cd (to try out for intellectual purposes), but I really need help getting mySQL to work.

      I have done the Marc Liyanages' tutorial and also the one one developer.apple.com, and also this one --none of them worked! If you had a different result and you wanna help me out, I'll let you borrow my copy of 10.1.

      You can contact me. I don't wanna post my email address (robots and spammers will pick it up), but my site is dhtmlkitchen, so you can send email there.
    • Kevin Hemenway photo What next?
      2002-04-16 17:29:36  Kevin Hemenway | O'Reilly AuthorO'Reilly Blogger [Reply | View]

      We'll be staying pretty close to Apache in future additions to the series (another two are planned). We won't be getting into GoLive or WebObjects (or, at least, I won't).

      As for OS X costing money, I was more than happy to wait on a cold rainy morning to get my copy. The very thought that a *nix and my beloved Perl would be installed by default... god... talk about sweaty palms.
      • What next?
        2002-04-27 18:31:13  dhtmlkitchen [Reply | View]

        I could let you borrow my cd (to try out for intellectual purposes), but I really need help getting mySQL to work.

        I have done the Marc Liyanages' tutorial and also the one one developer.apple.com, and also this one --none of them worked! If you had a different result and you wanna help me out, I'll let you borrow my copy of 10.1.

        OS X does cost too much.
  • Can't connect .. compiled .. stuck on 2nd
    2002-03-31 19:26:32  pangur [Reply | View]

    (Thanks for the articles--terrific series.)
    Getting error:
    Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61)

    Going the compile route, I had problems with item 2 (sudo chown -R mysql...) and the permissions remain:
    drwx------ 5 mysql wheel 264 Mar 31 18:54 var

    Reading the messages, I tried "ps auwx" and see no mention of MySQL.

    Anticipating that I may need to start over, (and excuse my ignorance), do I need to somehow remove all the installed files in order to run thru this again?

    Thanks very much......

    • Can't connect .. compiled .. stuck on 2nd
      2002-04-01 20:53:47  pangur [Reply | View]

      Well--unless I totally gerflunked everything, it appears to be functioning now (I got the "must stay awake" message).....by logging back in as MySQL user and at Terminal entering the 3 commands from the end of page 2 of part 5. Thanks again for a great series!
  • Access Denied error
    2002-03-25 09:34:42  pedrox [Reply | View]

    Warning: Access denied for user: 'root@localhost' (Using password: NO) in /Library/WebServer/Documents/test.php on line 13



    Warning: MySQL Connection Failed: Access denied for user: 'root@localhost' (Using password: NO)
    in /Library/WebServer/Documents/test.php on line 13



    Warning: Access denied for user: 'root@localhost' (Using password: NO) in /Library/WebServer/Documents/test.php on line 17



    Warning: MySQL Connection Failed: Access denied for user: 'root@localhost' (Using password: NO)
    in /Library/WebServer/Documents/test.php on line 17



    Warning: MySQL: A link to the server could not be established in /Library/WebServer/Documents/test.php on line 17

    Access denied for user: 'root@localhost' (Using password: NO)



    Any Ideas of what I need to do to get this running?
    • Access Denied error -ignore me
      2002-03-25 09:51:57  pedrox [Reply | View]

      Ok I found it. I followed the install notes from the mysql site and had enabled the password, without adding the password to my PHP code.

      sorry for the inconvenience, delete if you wish.

      Peter
  • Adobe Golive 6 - How To - Please...
    2002-03-25 07:44:53  redleader [Reply | View]

    Hi kevin,

    Can we please have a short artcile on connecting Adobe Golive 6 to our mySQL / PHP setup as per your articles.

    I guess most of us will be developing on the same Mac as we've done your setup's here.

    The GL6 manual is a bit fuzzy and we seem to get access restrictions when connecting to mySQL via. Golive. and creating GL's PHP control files.

    I'm sure it's just an IP / Apache config thingy...but I'm a blind newbie..

    :-) Thanks.
    • Adobe Golive 6 - How To - Please...
      2002-04-24 09:46:51  medazinol [Reply | View]

      Getting Golive 6 to work with MySQL is a bit tricky. You really need to be familiar with MySQL grant tables to get the connection to work properly.

      The main thing is to run the Dynamic Content Wizard and enter the ip address of the machine running MySQL FOLLOWED by the MySQL port number (3306) like this: 127.0.0.1:3306
      I fyou used this tutorial to get MySQL up and running then use "root" as the username and the password you assigned to the root account in MySQL. Actually, its NEVER a good idea to log into MySQL as root so you really should create a specific user but for local development you should be OK. Search for "GRANT PRIVILEGES" on the mysql documentation website (www.mysql.com) for more on how to set up access permissions in MySQL. if you succeed in getting Golive to connect you'll get a small window showing you a list of the tables installed.

      Hope this helps!
  • OT:: mod_perl
    2002-03-24 21:39:53  kenyatta [Reply | View]

    Hello Kevin, it's time can we do a tutorial for an installation of mod_perl on Apache for Mac OSX?

    There is currently a nice tutorial for installing mod_perl on Oreillynet.com but it doesn't cover the Mac OSX particulars.

    Thanks Kevin!! You already helped me with so much already!!
    • Kevin Hemenway photo OT:: mod_perl
      2002-03-29 14:10:36  Kevin Hemenway | O'Reilly AuthorO'Reilly Blogger [Reply | View]

      Ultimately, mod_perl is already installed on OS X. Look in your httpd.conf file - you'll see a large listing of AddModule and LoadModule lines, and one of them will be related to Perl. Uncomment them, and all other instructions on configuring mod_perl will work as written (well, assuming you change file/directory paths).
  • Darwin Streaming Server w/ Apache
    2002-03-19 02:17:17  lauren1 [Reply | View]

    Now that I've got my Apache Web Server up & running I'd like a look at integrating it with the Darwin Streaming Server
  • still having trouble with cgi
    2002-03-15 21:50:12  bdoltens [Reply | View]

    sorry, i posted this on part 4 already
    Can someone please help me?
    I can successfully run the test-cgi from my browser, but a downloaded perldiver.cgi will not run.
    I desired to use /Users/bdoltens/Sites/cgi-bin as a folder for cgi scripts, so I made a
    <Directory "/Users/bdoltens/Sites/cgi-bin">
    Options ExecCGI
    AllowOverride None
    Order allow,deny
    Allow from all
    </Directory>
    just after the <Directory /> bit in httpd.conf. Addhandler cgi-script .cgi is uncommented. ScriptAlias is commented out.
    by typing perl /Users/bdoltens/Sites/cgi-bin/perldiver.cgi in the terminal, the program runs and outputs good html. Still, the browser reports a 500 when I attempt to access the script.
    i have chmoded the file as 755, or 775, and, not really understanding the specifics of chmod, i tried also "a+w," but nothing really works.
    the error_log tells me two things,
    (2)No such file or directory: exec of /Users/bdoltens/Sites/cgi-bin/perldiver.cgi failed
    and then, premature script headers.
    Thanks for listening. Great articles, even if I don't fix this it was fun using the terminal for something.
    • Kevin Hemenway photo still having trouble with cgi
      2002-03-19 14:10:32  Kevin Hemenway | O'Reilly AuthorO'Reilly Blogger [Reply | View]

      You say the perldiver.cgi script outputs good HTML on the command line - but, but, but, when run as a CGI, it absolutely *needs* to output:

      "Content-type: text/html\n\n"

      before, before, before any other output to the browser. If you do not output that text, then the browser has no flipping clue what data is coming to it, so it will return an error) about premature script headers.

      Generically though, "premature script headers" could be any number of problems, only one of which could be missing that Content-type line. To further debug your problem, check out the various documents at Debugging Perl - About.com (but be prepared for tons of popup advertisements).
  • mysqladmin: Command not found
    2002-03-13 19:17:39  devereld [Reply | View]

    All's well until the ending. Where does this command exist (package installation)? Do I have to add it?
    • Kevin Hemenway photo mysqladmin: Command not found
      2002-03-13 20:25:23  Kevin Hemenway | O'Reilly AuthorO'Reilly Blogger [Reply | View]

      The package installation plops this file into /usr/local/bin/mysqladmin. /usr/local/bin should be in your PATH already (meaning you don't have to specify the full path to the program), but if not, you can certainly do "/usr/local/bin/mysqladmin" without a problem.

      Or, you could "cd /usr/local/bin" and then run the "mysqladmin" command as shown.
      • Thanks, but needed to add sudo...
        2002-03-14 15:29:43  devereld [Reply | View]

        ...prior to the command in order to get it to work. Managed to complete the (very well done) tutorial. Thanks again.
        • Thanks, but needed to add sudo...tryed that no joy
          2005-05-24 04:08:44  pixel_wolf [Reply | View]

          [kirsten-wolfs-Computer:/usr/local/bin] wolf% sudo/usr/local/bin/mysqladmin
          tcsh: sudo/usr/local/bin/mysqladmin: Command not found.
          [kirsten-wolfs-Computer:/usr/local/bin] wolf% sudo mysqladmin
          Password:
          sudo: mysqladmin: command not found
          [kirsten-wolfs-Computer:/usr/local/bin] wolf%
          still comand not found- the php test is working- notes came up per tutorial but no joy with this command - how can i configure my sql -
        • Thanks, but needed to add sudo...
          2002-04-24 09:50:30  medazinol [Reply | View]

          Sometimes when you install new command line programs in OS X, the terminal (command line) will not know about the new software. Provided your shell profile has the required paths in it you can simply type:

          rehash

          in the terminal to get the shell to cache the changes...
  • MySQL won't start
    2002-03-13 17:16:40  saywake [Reply | View]

    Here's the 'localhost.err' lines everytime I try to start it....I'm pretty certain that I've done all the steps (including adding the mysql user). Thoughts?

    020313 20:11:08 mysqld started
    Cannot initialize InnoDB as 'innodb_data_file_path' is not set.
    If you do not want to use transactional InnoDB tables, add a line
    skip-innodb
    to the [mysqld] section of init parameters in your my.cnf
    or my.ini. If you want to use InnoDB tables, add for example,
    innodb_data_file_path = ibdata1:30M
    But to get good performance you should adjust for your hardware
    the InnoDB startup options listed in section 2 at
    http://www.innodb.com/ibman.html
    020313 20:11:08 /usr/local/libexec/mysqld: Can't create/write to file '/usr/local/var/localhost.pid' (Errcode: 13)
    020313 20:11:08 /usr/local/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
    020313 20:11:08 /usr/local/libexec/mysqld: Error on delete of '/usr/local/var/localhost.pid' (Errcode: 13)
    020313 20:11:08 mysqld ended
    • Kevin Hemenway photo MySQL won't start
      2002-03-13 20:28:10  Kevin Hemenway | O'Reilly AuthorO'Reilly Blogger [Reply | View]

      Hmm. I'm wondering if one of the steps needs a slight modification. Do this for me and let me know if it works for you, please. If so, I'll get the article corrected.

      sudo chown -R mysql /usr/local/var

      This is a minor change from the article currently says, but may be crucial to what your problem is. Let me know.
      • MySQL won't start
        2002-08-16 12:52:59  syn_raziel [Reply | View]

        Hi, i'm getting the same errors dealing with localhost.pid and stuff. I tried
        sudo chown -R mysql /usr/local/var
        but it didn't work either
    • MySQL won't start
      2002-03-13 18:42:34  andycrim1 [Reply | View]

      It looks like we have the same problem. I followed the instructions to the letter, and I am puzzled that I can't get mysql to work. I have been trying to get it installed for about a week. I've tried fink and the binary distro from Marc Liyanage, but to no avail.

      I'll probably try one more time from source code.
    • MySQL won't start - one more thing
      2002-03-13 18:32:08  saywake [Reply | View]

      when I first run the mysql_install_db, I get this error:
      [localhost:/usr/local] root# ./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
      ERROR: 1062 Duplicate entry 'localhost-root' for key 1
      ERROR: 1062 Duplicate entry 'localhost-root' for key 1
      020313 21:26:36 /usr/local/libexec/mysqld: Shutdown Complete

      This has happened on 2 separate attempts on 2 different machines...what am I doing wrong?
      • Kevin Hemenway photo MySQL won't start - one more thing
        2002-03-13 20:30:31  Kevin Hemenway | O'Reilly AuthorO'Reilly Blogger [Reply | View]

        The "Duplicate entry" error message isn't too worrisome - I saw it on my own machine initially as well. Basically, one of the things that the install_db script does is to give the local user (you) access to the database. This error message is saying you already have access to the database. It's nothing you're doing wrong, and the error message you reported in an earlier message wouldn't be affected by this.
        • MySQL won't start - one more thing
          2002-03-13 21:58:06  andycrim1 [Reply | View]

          After reinstalling from source everything is now working. Thanks!
  • TOP NOTCH Articles
    2002-03-13 13:45:17  dejesusivan [Reply | View]

    ... Very much worthy of being part of the O'Reilly network. Thank you!!
  • what about jdbc driver?
    2002-03-13 11:19:13  axel_vogelsang [Reply | View]

    i tried to use dbvisualizer as a gui for controlling my databases. where do i install my jdbc driver and which one should i take. thanks
  • errcode: 13
    2002-03-13 08:09:59  andycrim1 [Reply | View]

    I can't get mysql to launch.

    The localhost.err file states:
    /usr/local/libexec/mysqld: Can't create/write to file '/usr/local/var/localhost.pid' (Errcode: 13)
    /usr/local/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
    /usr/local/libexec/mysqld: Error on delete of '/usr/local/var/localhost.pid' (Errcode: 13)
    mysqld ended

    Thanks for the great series.
  • Do it over again with Perl
    2002-03-12 12:56:52  dicklacara [Reply | View]

    I was so encouraged by the results of your excellent tutorial on pHp/mySQL... I took a shot at "installing" mySQL for Perl... no success.

    I have done some web programming in Perl, but never was involved with the install side of things,

    A short tutorial on adding mySQL to the OS X Perl package woukd be appreciated.

    Maybe, someday we'll have ColdFusion on OS X!

    Dick
    • Kevin Hemenway photo Do it over again with Perl
      2002-03-13 20:51:56  Kevin Hemenway | O'Reilly AuthorO'Reilly Blogger [Reply | View]

      Ultimately, you'll want to either look at or join the osx@perl.org list. You can see the archives here (there are some mentions of DBI).

      I've gone through a lot of Perl installations on my perl box, so, in my case, I just had to:

      sudo perl -MCPAN -eshell
      install Bundle::DBD::mysql

      Sat through a few errors, and when things were all finished, this script worked correctly (it assumes the database has been created as per the PHP script, and that some data has been entered).

      #!/usr/bin/perl
      use DBI;

      $dsn = "DBI:mysql:database=test;host=127.0.0.1;";
      $dbh = DBI->connect($dsn, "root", "");
      $sth = $dbh->prepare("SELECT * FROM wisdom");
      $sth->execute;
      while (my $ref = $sth->fetchrow_hashref()) {
      print "$ref->{'id'}: $ref->{'author'} sez: $ref->{'wisdom'}\n";
      }
      $sth->finish;
      • Do it over again with Perl
        2002-03-18 19:45:57  gskluzacek [Reply | View]

        what does the 2 lines below do?

        sudo perl -MCPAN -eshell
        install Bundle::DBD::mysql

        The 2nd one looks to install the mysql database driver for dbi, but the 1st one I'm clueless on. Is there something similar to instal the acutal DBI module? Thanks.

        Greg Skluzacek
        gskluzacek@mac.com
        • Kevin Hemenway photo Do it over again with Perl
          2002-03-19 14:04:21  Kevin Hemenway | O'Reilly AuthorO'Reilly Blogger [Reply | View]

          "sudo" says to run the next command as the root user. "perl" starts the perl interpreter, and automatically loads in a module called "CPAN" ("-MCPAN" is equivalent to "use CPAN;"). Finally, "-e" is the "execute this perl code" command, and we're saying to execute the "shell" command of CPAN.

          The second command installs the actual module. If you know your module name, you can use it - so "install XML::Parser", "install LWP::Simple", "install DBI::mysql", and so on and so forth. If you do the "Bundle::DBD::mysql" as above, then you don't have to worry about installing the matching DBI module - it's contained within this "Bundle".
  • FastCGI on OS X?
    2002-03-11 19:59:41  juicy [Reply | View]

    Any plans to add a FastCGI tutorial? As much as I love PHP, I do have projects that require Perl and FastCGI work, as well. I've tried to get mod_fastcgi and its Perl friends, FCGI.pm and CGI::Fast, to play together. But no luck so far.

    You seem to be the man who can do it. This series is great. I'd love to see FastCGI covered in a future installment!

    Keep up the great educating!
    -B...
  • MySQL problems
    2002-03-11 18:24:34  spiffyman [Reply | View]

    Once again, thanks for a great article. However, I'm having problems with the source install of MySQL.

    After downloading the file you pointed to with Internet Explorer, the actual name of the file was download.php. Because of that, tar (gzip?) didn't want to unpack the file, so Stuffit Expander did. So I was unsure as to whether I should move the resulting folder to /usr/local/src/ or not. (If so, I didn't, and how do I do that? cp doesn't seem to create the directory necessary in /usr/local/src/)

    Anyhow, I ran the ./configure options and it went fine, but when make finished, I got the following line at the end:

    make[2]: Nothing to be done for `all-am'.

    There weren't any other error reports that I could see, but then, maybe I did miss something. When I ran sudo make install, I got this line at the top and throughout the output as well as several lines with `install-data-am' instead:

    make[2]: Nothing to be done for `install-exec-am'.

    And these lines at the bottom:

    make[2]: *** [install-binPROGRAMS] Error 1
    make[1]: *** [install-am] Error 2
    make: *** [install-recursive] Error 1

    Now, when I go to /usr/local/, sudo ./bin/mysql_install_db produces a command not found error.

    I suspect there was some sort of problem in the make or make install commands, but if I find a solution, I'll still need to know what to move or remove so a reinstall goes smoothly. Thanks for your help.
    • MySQL problems
      2002-06-30 04:19:01  mrx1 [Reply | View]

      Well, it's an old post and I bet you got it working since then but it might be useful to others... In general, when I get those stupid "download.php" names, I look at the real name of the file I downloaded (easily enough by double clicking on the dl in the dl manager in IE5, but the way you get it doesn't matter, as long as you find the exact dl path with the name of the file at the end) and just copy and paste it to the downloaded file (replacing the "download.php"), say "yes" when the Finder asks if you wanna change the extension from .php to whatever your file's in... stuffit should now recognize your file and you should be able to do whatever you need with it. Cheers.
  • PHP again
    2002-03-11 14:55:50  bici [Reply | View]

    is php part of the apache install that comes with OS X (10.x.x0 or does one need to install the php programs???

    i suspect because i could not get the script to work that i do not have php installed. how can i determine if php is available on my machine?
    • Kevin Hemenway photo PHP again
      2002-03-11 16:42:58  Kevin Hemenway | O'Reilly AuthorO'Reilly Blogger [Reply | View]

      Yes, PHP is installed by default. If this is your first time reading this series, then you probably don't have PHP turned on. Read part three of the series for information on that.
  • php
    2002-03-11 14:51:15  bici [Reply | View]

    does the php scrip need to shart with


    or will it work without that addition?
    • Kevin Hemenway photo php
      2002-03-11 16:41:22  Kevin Hemenway | O'Reilly AuthorO'Reilly Blogger [Reply | View]

      I think something's missing from your comment, but the example listed in the article is a full script - if you save it as with a .php extension, then you'll be able to run it just fine.
  • OSXGuide.com
    2002-03-11 07:09:06  dani0100 [Reply | View]

    Great article here. If anyone's looking for similar guides on fun things to do with OS X, drop by www.OSXGuide.com for news, views, guides, and an OS X only forum.

    http://www.osxguide.com

    I'd be interested in seeing something on cool tricks using PHP and MySQL on OS X. That's next on my list of Guides to creat.

    Thanks!

    Miguel Danielson
    • OSXGuide.com
      2002-03-12 09:36:50  swanilda [Reply | View]

      I agree with the request for the next lesson: a guide to using MySQL with PHP on OSX. I managed to stumble through this lesson and get things working according to directions, but I am not sure I understand what to do with it next. I did a SQL tutorial (with online SQL interpreter), but where does one actually create the tables using the SQL commands...right in the terminal? In a text editor? In combo with php as .php document that goes on the server? Forgive the dumb questions...this is all so new!
      Thanks for your generosity in creating these detailed lessons.

      Sheri
      • OSXGuide.com
        2002-03-12 10:56:31  swanilda [Reply | View]

        Well, upon a little more investigation, I think I found answers to my questions...which are actually all answered in the affirmative. You can use all of these tools. I did manage to figure out that when I get the mysql> screen, that's where I begin entering CREATE table "name" and the columns, contraints, values. So...I made my first database in the terminal. I would still love to see more tricks such as the OSX Guide person requested. Thanks again for a great tutorial!

        Sheri
  • "Can't connect to mysql.."
    2002-03-10 05:00:04  dbartlett [Reply | View]

    When i run the script i get an error message;

    "Warning: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /Library/WebServer/Documents/test.php on line 4"

    Can anyone suggest a solution ? Sure its just a silly mistake on my part.
    • "Can't connect to mysql.."
      2002-03-13 21:35:47  rjolly@cape.com [Reply | View]

      Warning: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in...

      I get this error message too - I think because I can't actually start mysql, or it stops immediately after starting:

      % sudo ./bin/safe_mysqld -user=mysql &
      Starting mysqld daemon with databases from /usr/local/var
      020314 00:27:53 mysqld ended

      I don't get the command prompt back after running the safe_mysqld command ( I interrupt it with a crtl-c), unless I drop that trailing '&' argument. (Which I couldn't find it in the man page.)

      But with or without the ampersand, the results are the same.

      I tried ps auwx - mysql doesn't show up.

      Any ideas?

      And thanks for the very helpful series!
    • Kevin Hemenway photo "Can't connect to mysql.."
      2002-03-11 08:17:45  Kevin Hemenway | O'Reilly AuthorO'Reilly Blogger [Reply | View]

      This error would come up if you hadn't started the MySQL server, or else, when you tried, you got error messages. Could you rerun through the steps to start MySQL (they're the last few lines of code on page 2) and pay attention to what happens?

      If everything looks fine, you can verify that MySQL is running by entering "ps auwx" in your Terminal - you should see some mention of MySQL if everything went smoothly.
      • "Can't connect to mysql.."
        2002-03-12 16:05:21  curran_riley [Reply | View]

        I too am getting this (on a home pc - work pc install went off without a hitch).

        I've gone through the steps a couple of times now - but when I enter the third command for the package install, I get:

        Starting mysqld daemon with databases from /usr/local/mysql/data
        ./bin/safe_mysqld: command not found: tee [275]
        ./bin/safe_mysqld: command not found: tee [276]

        I must be missing something - but I've created the mysql user, run the package install, and executed the first 2 commands. But something about that 3rd one doesn't go. Any ideas?

        The error log has entries like this:

        020312 17:58:03 mysqld started
        ./bin/safe_mysqld: command not found: nohup [235]

        P.S. - great series of articles - love having Apache, CGI, and PHP running with so little effort!
        • "Can't connect to mysql.."
          2002-07-12 09:52:15  robertlenne [Reply | View]

          I get exactly the same error as curran_riley with the "nohup"-command. Does anyone know what could wrong? It feels like I have tried everything...
  • And Mac OS X Server?
    2002-03-09 07:03:08  maxs [Reply | View]

    I am using Mac OS X Server 10.1.3 but I'm having some problems after installing the packaged version of MySQL....
    Probably because in the Server version of Mac OS X ther's already a pre-bundled MySQL version and there are some conflicts?
    Thank you
    • Kevin Hemenway photo And Mac OS X Server?
      2002-03-11 08:14:31  Kevin Hemenway | O'Reilly AuthorO'Reilly Blogger [Reply | View]

      There quite possibly could be, yes. At the very least, if the Server version of MySQL was still running when you tried to turn on your version of MySQL, then there'd be conflicts. These instructions assume plain old OS X - not OS X Server.
      • And Mac OS X Server?
        2002-04-29 09:13:24  cybersank [Reply | View]

        I was able to install on OS X Server as well.
        Apple previously noted that MySQL would be part pf the system, but you only get it if you're installing a fresh copy of 10.1 Server. If you updated the Server version (like I did) from 10.0 then you only get Tomcat.
        PS.
        I had problems starting the Mysql Server and fixed by adding a ' * ' at the end of the line:
        sudo chown -R mysql /usr/local/mysql/*
  • One missing sudo?
    2002-03-08 22:14:44  pmccann [Reply | View]

    Anyone compiling from source will want to chuck a "sudo" before the "make install" command if they want to avoid a terminal full of angry looking "permission denied" statements. That is, the third of the triumvirate "./configure; make; make install", should actually be

    sudo make install

    Cheers,
    Paul
    • Kevin Hemenway photo One missing sudo?
      2002-03-11 08:12:12  Kevin Hemenway | O'Reilly AuthorO'Reilly Blogger [Reply | View]

      Paul,

      You're absolutely correct. Sorry about that - I'll get it changed in the article some time today hopefully.

      Nice word, btw (triumvirate). It fits.