MYSQL-TOOLS

Comparison of graphical tools for MySQL

Home Blog MySQL

Difference MyISAM and InnoDB

Print PDF

Отличия между движками MyISAM и InnoDB простым языком.

 

В данной таблице я попробовал показать на простых примерах разницу между MyISAM и InnoDB:

Описание MyISAM InnoDB
Транзакционный движек?

 

Транзакция (Transaction) — блок операторов SQL , который в случае ошибки в одном запросе, возвращается к предыдущему состоянию (Rollback), и только в случае выполнения всех запросов подтверждается (Commit)

 

Differences PRIMARY KEY VS UNIQUE in MySQL

Print PDF

So what's different from the PRIMARY KEY and UNIQUE CONSTRAINT?

 

1. PRIMARY KEY does not allow NULL in their fields, and UNIQUE - allow.

2. PK - there can be only one. UQ - can be any number.

3. When you create a PRIMARY KEY by default creates a clustered index, and when you create a UNIQUE not.

 


 

CRUD MySQL in PHP

Print PDF

CRUD — (create read update delete) abbreviation naming four basic functions for working with databases - create, read, update and delete.

Examples

OperationMySQL statment HTTP operation
Create INSERT POST
Read SELECT GET
Update UPDATE PUT or PATCH
Delete DELETE DELETE

 

The classic application to work with the database is usually called CRUD - on the first letter of standard operations, Create, read, update and delete.

It's like the notes in music - any application consists of these basic elements. In our case it is a PHP web page that displays a list of records in the database as a list of (R), allows you to add new records in the MySQL database (C), edit them (U) and delete (D) from database.

With the help of this php application class is implemented through a few stitches.

Here they are:

 

<?

include 'safemysql.class.php';
$db = new SafeMysql();
$table = "test"

if(
$_SERVER['REQUEST_METHOD']=='POST') {
if (isset(
$_POST['delete'])) {
$db->query("DELETE FROM ?n WHERE id=?i",$table,$_POST['delete']);
} elseif (
$_POST['id']) { 
$db->query("UPDATE ?n SET name=?s WHERE id=?i",$table,$_POST['name'],$_POST['id']);
} else { 
$db->query("INSERT INTO ?n SET name=?s",$table,$_POST['name']);

header("Location: http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']);  
exit;  
}  
if (!isset(
$_GET['id'])) {
$LIST = $db->getAll("SELECT * FROM ?n",$table);
include
'list.php'
} else {
if (
$_GET['id']) {
$row = $db->getRow("SELECT * FROM ?n WHERE id=?i",$table,$_GET['id']);
foreach (
$row as $k => $v) $row[$k]=htmlspecialchars($v); 
} else { 
$row['name']=''
$row['id']=0

include
'form.php'
}

 

Template files:
list.php
<a href="/?id=0">Add item</a>
<? foreach ($LIST as $row): ?>
<li><a href="/?id=<?=$row['id']?>"><?=$row['name']?></a>
<? endforeach ?>


form.php
<form method="POST">
<input type="text" name="name" value="<?=$row['name']?>"><br>
<input type="hidden" name="id" value="<?=$row['id']?>">
<input type="submit"><br>
<a href="/?">Return to the list</a>
</form>
<? if ($row['id']):?>
<div align=right>
<form method="POST">
<input type="hidden" name="delete" value="<?=$row['id']?>">
<input type="submit" value="Удалить"><br>
</form>
</div>
<?endif?>

 

HeidiSQL & HTTP Tunnel - it works!

Print PDF
User Rating: / 6
PoorBest 

HeidiSQL&HTTP Tunnel

HeidiSQL is good and for someone simply irreplaceable tool for working with databases MySQL. This GUI has everything you need to work with the MySQL database. But HeidiSQL missing important functionality is the connection through the HTTP tunnel.

HeidiSQL is an easy-to-use interface and a "working-horse" for web-developers using the popular MySQL-Database. It allows you to manage and browse your databases and tables from an intuitive Windows® interface.

When you can't connect to the MySQL server directly, for example a firewall blocks the access from all network protocols, except HTTP protocol, you can use HTTP tunneling.

In this article I'll show you how to connect to remote MySQL server using HeidiSQL via HTTP Tunnel.

 

MySQL stored procedures

Print PDF
User Rating: / 48
PoorBest 

For a long time to suffer with this issue. Literature on the Internet a lot. I had to ask around at different forums, deeper digging in the manual and explain to himself some weird moments. So, short of stored procedures in MySQL.

 

MySQL and character set. Migration (or degradation)

Print PDF

Today I met with the transfer of data between two servers: MySQL 4.0 on FreeBSD (access via SSH) and MySQL 5.0 on Windows XP locally (base package XAMPP Web Servers).

In general, does not matter ... we all know that for any import and export data from one database to another, there are problems with Russian letters. You are probably faced with a bunch of articles on the subject, and they are all good, but today I went a little deeper.

The task was simple - to remove a couple of lines from one plate to the remote Web server. Put phpmyadmin and decide for 2-3 minutes ..And you can keep track of primary keys of the required records and a simple query on a remote server to remove them.

Too all that easy. I took a different route.

 

FAQ on restoring a forgotten root password in MySQL

Print PDF
User Rating: / 4
PoorBest 

mysql password resetHow to recover a lost administrator password?

This article describes what to do if you forget the administrator password or have misplaced the very root-user. The article is intended primarily for beginners, so a description of all the actions described in great detail, but the material may not be without interest and for more experienced users.

 
  • «
  •  Start 
  •  Prev 
  •  1 
  •  2 
  •  Next 
  •  End 
  • »


Page 1 of 2