Using MySQL
Basic Usage | Administration | Links |
back to top Basic Usage
MySQL & PHP from scratch, Wade Maxfield
p. 46 - 53:
/root]# mysql mysql
where the first mysql is a command, the second an intial sample database
mysql> show tables;
+-----------------+
| Tables in mysql |
+-----------------+
| columns_priv |
| db |
| func |
| host |
| tables_priv |
| user |
+-----------------+
6 rows in set (0.00 sec)
mysql> show columns from user;
mysql> select host,user,password,select_priv from user;
mysql> select host,user,password,select_priv from user where User='root';
mysql>
mysql> CREATE DATABASE imp;
mysql> use imp;
mysql> CREATE TABLE imp_addr (
-> user text,
-> address text,
-> nickname text,
-> fullname text
->);
Query OK, 0 rows affected (0.46 sec)
mysql> CREATE TABLE imp_pref (
-> user text,
-> fullname text,
-> replyto text,
-> lang varchar(30)
-> sig text
-> );
mysql> show tables
mysql> quit
To add text, as in an org chart, enter text as close as reasonable to right position. Snap to grid will prevent correct positioning so toggle it by pressing g (using pointer tool and clicking the diagram first), drag text, re-apply snap-to-grid pressing g again.
To group the text and box, drag a selection frame (dotted line) around the box, press Ctrl-G. [[To ungroup, select, and press Ctrl-U]]
This has accomplished the task with basic tools; there are shortcuts to this by using Flowchart library shapes which include a text piece as part of boxes...
back to top Administration Course
Duane W. French of Alliance Micro Solutions, Inc.,
http://www.alliance-micro.com (800-798-3901)
solicited course development contractors to create a course for Alliance Micro Solutions
along the lines of this outline (of a book? some other courseware?):
Duration: 4 days
MySQL Training Overview
MySQL is the world's most popular open source client-server database. In this four-day, hands-on course, attendees learn the fundamentals of writing MySQL queries, administering the MySQL database, and writing applications that automate tasks within MySQL.
Location and Pricing
Most Accelebrate courses are taught on-site at our clients' locations worldwide
for groups of 3 or more attendees and are customized to their specific needs.
Please visit our client list to see organizations for whom we have recently
delivered training. To receive a customized proposal and price quote, please
contact us.
In addition, some courses are available as live, online classes for individuals. To see a schedule of online courses, please visit http://www.accelebrate.com/online_training/.
MySQL Training Prerequisites
This course can be customized to any level of experience. The last section, Integrating Applications with MySQL, presumes that attendees already know the language in question and merely need to learn how to use the language to automate MySQL.
Hands-on/Lecture Ratio
This MySQL training class is 85% hands-on, 15% lecture, with the longest lecture
segments lasting for 15 minutes. Students "learn by doing," with immediate
opportunities to apply the material they learn to real-world problems.
MySQL Training Materials
All MySQL training students receive:
- Comprehensive courseware
- MySQL Press's MySQL Tutorial
- O'Reilly & Associates' MySQL Cookbook
Software Needed on Each Student PC
- MySQL 4.0 or any later production release—this can either be running on all PCs, or on one server within a networked classroom.
- MySQL Control Center (a graphical interface for administering MySQL and data) or another front-end, if desired.
- Any operating system supported by MySQL. A complete list of operating systems supported by the MySQL version you're interested in can be obtained by going to http://www.mysql.com/downloads/.
MySQL Training Objectives
- To learn how to properly set up and configure MySQL
- To master creating and querying databases in MySQL
- To learn how to administer and secure a MySQL database
- To discover how to write applications that integrate with MySQL databases
Note: MySQL training students interested in learning how to use MySQL to build database-driven Web sites are also encouraged to consider Building Data-Driven Web Sites with PHP & MySQL.
MySQL Training Outline
MYSQL BASICS
- Installing MySQL
- Installing on Linux
- Configuring Your System
- Checking Your System Works
- Setting the Root Password
- Deleting Anonymous Accounts
- Creating an Account for Basic Use
- Quick Tour
- MySQL Directory Structure
- Overview of Executables
- Overview of User Interfaces
- Quick Introduction to the MySQL Monitor
DESIGNING AND CREATING DATABASES WITH MYSQL
- Database Design Crash Course
- Database Concepts and Terminology
- Database Design Principles
- Normalization
- Creating Databases, Tables, and Indexes
- Case Sensitivity
- Identifiers in MySQL
- Creating a Database
- Selecting a Database
- Creating Tables
- Column and Data Types in MySQL
- Creating Indexes
- Deleting Databases, Tables, and Indexes
- Altering Existing Table Structures
WRITING SQL QUERIES
- Simple SELECTs
- Introduction to the Northwind Database
- Some Basics
- SELECTing All Columns in All Rows
- SELECTing Specific Columns
- Sorting Records
- The WHERE Clause and Operator Symbols
- The WHERE Clause and Operator Words
- Checking Multiple Conditions
- Advanced SELECTs
- Calculated Fields
- Aggregate Functions and Grouping
- Built-in Data Manipulation Functions
- Subqueries, Joins, and Unions
- Subqueries
- Joins
- Unions
- Inserting, Updating and Deleting Records
- Using INSERT
- Using UPDATE
- Using DELETE
- Using MySQL Built-In Functions with SELECT
- Operators
- Control Flow Functions
- String Functions
- Numeric Functions
- Date and Time Functions
- Cast Functions
- Other Functions
- Functions for Use with GROUP BY Clauses
MYSQL TABLE TYPES AND TRANSACTIONS
- Understanding MySQL's Table Types
- ISAM Tables
- MyISAM Tables
- InnoDB Tables
- BerkeleyDB (BDB) Tables
- MERGE Tables
- HEAP Tables
- Using Transactions with InnoDB Tables
- What Are Transactions? Using Transactions in MySQL
- The InnoDB Transaction Model
ADMINISTERING MYSQL
- Managing User Privileges
- Creating User Accounts with GRANT and REVOKE
- Privilege Levels
- Evaluating Privileges
- Using the REVOKE Statement
- Understanding the Privilege Tables
- Configuring MySQL
- Setting MySQL Configuration Options
- Setting InnoDB Configuration Options
- Multi-Install Configuration Options
- Configuring for Internationalization
- Administering Your Database
- Starting Up and Shutting Down the MySQL Server
- Getting Information about the Server and Databases
- Setting Variables
- Killing Threads
- Clearing Caches
- Understanding the Log Files
- mysqladmin Option
- Backup and Disaster Recovery
- Backing Up and Restoring Your Database
- Testing Your Backup
- Checking and Repairing Tables
- Securing Your MySQL Installation
- How the Privilege System Works in Practice
- Securing Accounts
- Securing Your Installation Files
- Filtering User Data
- Other Tips
- Replicating Your Database
- Replication Principles
- Setting Up and Configuring for Replication
- Advanced Topologies
- The Future of MySQL Replication
OPTIMIZING MySQL
- Optimizing Your MySQL Server Configuration
- Compiling and Linking for Speed
- Tuning Server Parameters
- Tuning Other Factors
- Optimizing Your Database
- What's Slow in MySQL Databases? Making the Right Design Choices
- Indexing for Optimization
- ANALYZE TABLE
- Using OPTIMIZE TABLE
- Optimizing Your Queries
- Finding Slow Queries
- Benchmarking Your Queries
- Using the Slow Query Log
- Using EXPLAIN to See How Queries Are Executed
- Understanding MySQL's Built-In Query Optimization
- Optimization Tips
INTEGRATING APPLICATIONS WITH MYSQL
- Integrating MySQL with Applications [Note: This section can be taught in Perl, PHP, Java, Python, C#, VB.NET, Visual Basic, or ColdFusion]
- Loading the MySQL database driver
- Connecting to the database [and handling connection errors]
- Preparing a SQL statement
- Executing a SQL statement [and handling SQL or database errors]
- Displaying results
- Obtaining and using database metadata
- Using prepared statements to accelerate queries and defend against SQL injection attacks
- Executing queries inside transactions [including how to subsequently commit or rollback each transaction]
- If MySQL 5.0 is being used, we can also show how to invoke stored procedures (presuming the appropriate driver for the programming language being used supports stored procedure calls
MySQL Cookbook, Second Edition — Dozens of short, focused pieces of code and hundreds of worked-out examples that are perfect for programmers of all levels who don't have the time (or expertise) to solve MySQL problems from scratch. Read more.
O’Reilly’s SQL Cookbook which also contains solutions for MySQL. (See link below) I will locate the above if needed.
http://www.oreilly.com/catalog/sqlckbk
Learning MySQL from OReilly isbn 9 780596 008642
MySQL Administrator’s Guide and Language Reference from MySQL Press isbn 9 780672 328701
MySQL Database Design and Tuning from MySQL Press isbn 9 780672 327650
MySQL Tutorial from MySQL Press. Many topics are similar to Microsoft’s SQL Server and some are very diverse. It would take a full 3 to 4.5 days to cover all the topics.
back to top MySQL Links
-
Amazon: Beginning MySql by Robert-Sheldon
cited as a course outline in a solicitation for instructors by
Duane French, Alliance Micro Solutions, Inc., 16 Technology Dr. Suite 208, Irvine, CA 92618
www.alliance-micro.com
p: 800-798-3901, x01
l: 949-727-1952
f: 949-727-0861