An Early Look at MySQL™ on Novell NetWare® Novell BrainShare 2002 An Early Look at MySQL™ on Novell NetWare® Rob Lyon Engineer Novell, Inc. rlyon@novell.com Paul Thomas pthomas@novell.com TUT250—An Early Look at MySQL on Novell NetWare
Outline Introduction Build Install Operation
MySQL™ on NetWare® introductio
What Is MySQL? A relational database management system The most popular open-source SQL database Pronounced “my ess cue ell,” not “my sequel”
Vision…one Net Mission A world where networks of all types—corporate and public, intranets, extranets, and the Internet—work together as one Net and securely connect employees, customers, suppliers, and partners across organizational boundaries Mission To solve complex business and technical challenges with Net business solutions that enable people, processes, and systems to work together and our customers to profit from the opportunities of a networked world
Under Construction
MySQL on NetWare Build
Guiding Principle All changes made to the MySQL source code to enable it to run on Novell NetWare will be… Compatible with the current MySQL architecture, design, and coding style Given back to the open-source community
Build Environment MySQL for NetWare is built using… Standard MySQL makefiles configured using standard GNU tools Automake and Autoconf MetroWerks CodeWarrior command-line compiler and linker with LibC header files and libraries Cygwin UNIX environment for Windows
Build Environment (cont.) Windows Metrowerks CodeWarrior 7.0 CodeWarrior PDK 4.0 LibC (March 2002) Cygwin 1.3.x MySQL 4.0.1 standard-source files MySQL 4.0.1 NetWare-specific changes
--target=i686-pc-netware6 Build Process MySQL source + MySQL delta for NetWare 6 autoconf configure.in configure --target=i686-pc-netware6 --prefix='SYS:/mysql' --without-docs config.h.in */…/Makefile.in config.h */…/Makefile make MySQL for NetWare 6 make install make init-db
MySQL on NetWare Install
Dependencies NetWare 6 SP1 LibC—March 2002 http:// developer.novell.com/ndk/libc.htm
Installation Download and unzip LE167.ZIP to the sys:\ volume of your server http://developer.novell.com/ndk/leadedge.htm Add “SYS:\MYSQL\BIN” to your search path Load “mysqld”
MySQL on NetWare Operation
Connecting to MySQL SERVER: mysql –h host –u user –p Enter password: ******* Welcome to the MySQL monitor. … … mysql> quit Bye
Creating a Database mysql> CREATE DATABASE zoo; mysql> USE zoo Database changed SERVER: mysql –h host –u user –p zoo
Creating a Table mysql> CREATE TABLE animal (name VARCHAR(20), -> species VARCHAR(20), sex CHAR(1), -> birth DATE); mysql> GRANT ALL ON animal.* TO user;
Populating the Table mysql> INSERT INTO animal -> VALUES (‘Fluffy’, ‘African Elephant’, -> ‘f’, ‘1997-02-14’); mysql> LOAD DATA LOCAL INFILE “animal.txt” -> INTO TABLE animal;
Querying the Table mysql> SELECT * FROM animal -> WHERE name = “Fluffy”; mysql> SELECT name FROM animal -> WHERE birth >= “1995-1-1” -> AND sex = “f”;
Getting Information mysql> SHOW DATABASES; mysql> SELECT DATABASE(); mysql> SHOW TABLES; mysql> DESCRIBE animal;
Batch Mode SERVER: mysql < batch-file SERVER: mysql < batch-file > mysql.out
Security Issues SERVER: mysql –u root WARNING!!! SERVER: mysqladmin –u root password password mysql> SHOW GRANTS FOR user@”%”; mysql> REVOKE ALL PRIVILEGES ON *.* -> FROM user@”%”;
User Accounts mysql> GRANT ALL PRIVILEGES ON *.* -> TO admin@”%” IDENTIFIED BY ‘password’ -> WITH GRANT OPTION; mysql> GRANT USAGE ON *.* -> TO guest@localhost; mysql> SET PASSWORD FOR user@”%” = -> PASSWORD(‘password’);
Database Backups SERVER: mysqldump --opt database > backup.sql SERVER: mysql database < backup.sql mysql> BACKUP TABLE table TO ‘/backup’ mysql> RESTORE TABLE table FROM ‘/backup’
MySQL Client APIs JDBC PHP Perl C C++ ODBC Python Tcl Eiffel
C Example MYSQL mysql; mysql_init(&mysql); mysql_real_connect(&mysql,"host","user", "password","database",0,NULL,0)); mysql_close(&mysql);
JDBC Example Class.forName("org.gjt.mm.mysql.Driver"); Connection con = DriverManager.getConnection( "jdbc:mysql://host/database“, “user”, “password”); con.close();
demonstratio
More Information http://www.mysql.com http://developer.novell.com/ndk/leadedge.htm http://www.novell.com