MySQL

New to Mysql? Read the Series and Become an Expert

New to Mysql? Read the Series and Become an Expert

Fadıl

This is the beginning of a series where I will work through the basic Mysql commands that you will need to manage a database. These commands are covered in this part of the series:

CREATE DATABASE,CREATE TABLE,INSERT,SELECT,FROM,WHERE,AND.

Series name: MissJackson part I, starting out
Skill level: Newbie

So you’ve got Mysql installed and if you are like me you can’t wait to enter all your old baseball cards in your new database so you can sell them on eBay, or maybe you won’t put in your
friend’s/girlfriend’s Birthday, favorite music, address, phone number, favorite music artist…( you don’t ever want to forget your girlfriend’s birthday as you may already know…). Anyway
so you got all this important crap, how do you cram it into Mysql? Ok, first you will have to get into MySQL. Once you are in Mysql you’ve got to create a database so you have something to work
with:

How to Database-Driven User Authentication?

Fadıl

Ever have something that you wanted to put on the internet for only a group of
people to see? Well, then this script is for you. All you need is; PHP and MySQL.
Create a MySQL database to store the usernames and passwords.

CREATE TABLE auth_users ( 
  f_name varchar(50) DEFAULT '' NOT NULL, 
  l_name varchar(50) DEFAULT '' NOT NULL, 
  username varchar(50) DEFAULT '' NOT NULL, 
  password varchar(100) DEFAULT '' NOT NULL 
  );

Now that you have a table named auth_users, you can now create an interface to add First names, Last Names, usernames, and passwords.

How to Using MysqlDump

Fadıl

MysqlDump can be used for many different reasons.  For one, you can use mysqldump to backup the data in your MySql DataBase.  Here is what mysqldumpdoes.

MYSQLDUMP – takes all the information in the selected database or table and dumps it into a  text file.  After the information is in a text file you can dump it into any database you want.
How does mysqldumpwork?
let’s take all the tables and information in the tables from the database mydb and dump it into a text file.

How to Move Your MySQL Data Store

Fadıl

Databases grow over time, and sometimes it’s necessary to add disk space to a server to accommodate that growth. Fortunately, moving your database is a fairly simple process. The following is tested on Ubuntu 12.04LTS, but, by locating directories and files, it should work on other flavors of Linux.

The first step is to stop any incoming data to your database. This might involve editing the crontab to stop scheduled processes that touch your database or stopping programs that are inserting or modifying data, such as a web server or Syslog software. This is the trickiest part, and will probably be the most time-consuming part of the process.

Conceptual, Logical, and Physical Data Models

Conceptual, Logical, and Physical Data Models

Fadıl

There are three levels of data modeling. They are conceptual, logical, and physical. This section will explain the difference between the three, the order with which each one is created, and how to go from one level to the other.

Conceptual Data Model

Features of the conceptual data model include:

  • Includes the important entities and the relationships among them.
  • No attribute is specified.
  • No primary key is specified.

At this level, the data modeler attempts to identify the highest-level relationships among the different entities.