Version 37 of MySQL

Updated 2013-09-08 15:38:35 by pooryorick

MySQL is an open source database utility. See below for further details.

See Also

MySQL Tcl Bindings
MySQLUsers
applications in Tcl that use MySQL
MySQL: Forked beyond repair? ,Neil Mcallister ,2003-05-21

Tutorials

Beginning MySQL Tutorial ,W.J. Gilmore ,1999-04-03

Description

"MySQL is the world's most popular Open Source Database, designed for speed, power and precision in mission critical, heavy load use." In Sep 2002, they won the Linux Journal's Editors' Choice Award -from the article: "If you're one of the people who has been saying, 'I can't use MySQL because it doesn't have [feature you need here]', it's time to read up on MySQL 4.0 and try it out on a development system. Can you say, 'full support for transactions and row- level locking'? 'UNION'? 'Full text search'?

- http://www.mysql.com/

"The new MySQL is even available as a library you can compile into your application. Proprietary licenses are available if you can't use the GPL."

Response

Other opinions (free speech section)

  • What are some feelings against use of MySQL? http://openacs.org/philosophy/why-not-mysql.html (From the linked-to page: "NOTE: This Document was written in May 2000. Thus, it is outdated and does not represent the latest data concerning MySQL. I will attempt to find time to rewrite this with more current information soon (August 10th, 2001)").
  • On the eve of 2005, why-not-mysql is still somewhat accurate: by default, mysql still does not use the transacted database engine; subqueries are still not supported (v.4.1); It does have foreign key checks, but not with the default driver; row level locking is now supported, again not by the default driver. A key thing why-not-mysql misses is the inability to do a live backup in any other way than stop database, copy files, restart database - not very suitable for server environments. And finaly, please remember that MySQL is only free to use for in-house and GPL'ed software. Everything else requires a per CPU license. Postgresql may be a better solution.
  • On Tcl APIs (only one listed): http://www.mysql.com/doc/en/Tcl.html -> (Linux with occasional Win32 binaries) mysqltcl
  • Regarding the earlier assertion that subqueries are not supported in version 4.1, I can tell you with first-hand experience that they indeed are, and MySQL AB's website lists 4.1 as the version where subqueries were introduced (http://dev.mysql.com/doc/mysql/en/subqueries.html ). (Also, I'm not particularly sure where the assertion that MySQL can't do live backups is coming from -- I do them all the time with mysqldump...)

* FBSQL - live and current site (as of 09/2003) with Win32 binaries, .c source "should also compile on Unix platforms with some minor modifications". Solaris tarball provided. (An attempt to use FBSQL met with frustration... I can't get the fbsql.dll at http://www.fastbase.co.nz/fbsql/index.html to load into ActiveTcl 8.4.5. --Chris Nelson 2004-01-29)

Example

Silas - 2005.10.05 - I've used the following code to test the MySQL remote server each one second with a recursive proc and connect if the internet is on (I'm using FBSQL here):

#make the connection
proc mysqlConnect {} {
    set error [catch {
        set result [exec ping -c 1 $glo::db(host) | grep received]
    } error_message]

    if {$error} {
        if {$glo::db(connected)} {
            tk_messageBox -message "The connection has been lost. It will be connected in $glo::db(time) seconds."
            set glo::db(connected) 0
        }
        puts $error_message
        after [expr $glo::db(time) * 1000] {mysqlConnect}
        return
    }

    set index [string first {1 received} $result]
    puts "($index) $result"

    if {$index && $glo::db(connected) == 0} {
        if {[tk_messageBox -message "The net is OK. Do you want to connect?" -type yesno] == yes} {
            set error [catch {sql connect $glo::db(host) $glo::db(user) $glo::db(pass)} error_message]
            sql selectdb $glo::db(db)
            set glo::db(connected) 1
        }
    }

    after [expr $glo::db(tempo) * 1000] {mysqlConnect}
}