Download presentation
Presentation is loading. Please wait.
Published byCurtis Gallagher Modified over 8 years ago
1
Introduction to MySQL MySQL Overview by Ray Williams CS 320/565 Marymount University
2
MySQL Overview ¢ MySQl is an Open Source Relational Database ¢ MySQL was created by MySQL AB in Sweden by: " David Axmark " Allan Larsson " Michael "Monty" Wiedenus ¢ The "Official" Site is http://www.mysql.comhttp://www.mysql.com " Note there is a current controversy where Progress Software and NuSphere Corporation have set up another site http://www.mysql.org in violation of the MySQL Copyright http://www.mysql.org ColumnColumn
3
MySQL Platforms ¢ MySQL is available on a variety of platforms " Linux " FreedBSD and NetBSD " Solaris " SCO Unix " Win32 " WindowsNT " OS/2
4
MySQL Features ¢Multithreaded ¢ANSI SQL-92 Compliant ¢Online Help ¢Portability ¢Many Application Programming Interfaces APIs " Perl " TCL " Python " Java (JDBC " ODBC " C++
5
MySQL Architecture ¢ As a database MySQL is a series of structured files that are organized in a highly efficient manner. ¢ By default the mysql database is created with the host, user and database privileges. Table Column Row Table
6
MySQL Files and Directories ¢Directories " Support-files - files to aid in installing and configuring " Bin - MySQL commands " Data - Database data files " Include - All C header files " Tests - Perl scripts to test MySQL " Lib - Library files used in C++ API " Scripts - Install scripts for MySQL " Share - Error logs and messages " Mysql-bench - Home of crashMe tool " Files " ChageLog, INSTALL-BINARY, PUBLIC, README, manual.* (txt, htm)
7
Starting & Stopping MySQL ¢ bin/safe_mysqld & " Starts the MySQL daemon (server) under Unix/Linux ¢ mysqld.exe " Starts the MySQL server under Windows ¢ bin/mysqladmin -p ping " Prompt for password (-p) and verify server daemon is running. ¢ bin/mysqladmin -p shutdown " Prompt for password and shutdown server
8
Using MySQl ¢To get into the command line: " bin/mysql -p ¢To view installed databases " SHOW databases; ¢To select a database " USE mysql; ¢To view tables " SHOW TABLES FROM mysql; ¢To view columns in a table " SHOW COLUMNS FROM user; or " DESC user;
9
Using MySQL (cont.) ¢To create a new database " CREATE DATABASE sample_db; or " bin/mysqladmin -p CREATE sample_db; ¢To delete a database " DROP DATABASE sample_db; " bin/mysqladmin -p DROP sample_db; ¢To add a new user " INSERT INTO user VALUES('localhost', 'new_user',password('password'), 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y','Y','Y','Y','Y');
10
Using MySQl (cont.) ¢INSERT INTO user VALUES('localhost', 'new_user',password('password'), 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y','Y','Y','Y','Y');
11
A Quick Run Thru MySQL ¢CREATE DATABASE temp; ¢USE DATABASE temp; ¢CREATE TABLE test_table (Test_ID INT NOT NULL PRIMARY KEY AUTO_INCREMENT, Test_Name VARCHAR(30), Test_Date DATETIME, Test_Giver VARCHAR(30)); ¢INSERT INTO test_table(Test_ID, Test_Name, Test_Date, Test_Giver) VALUES (NULL,'Test','2001-10-02','Beryl'); ¢SELECT * FROM test_table;
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.