分类存档: MySQL - 第2页

MySQL中的加密与压缩算法

Encryption and Compression Functions:

Name Description
AES_DECRYPT() Decrypt using AES
AES_ENCRYPT() Encrypt using AES
COMPRESS() Return result as a binary string
DECODE() Decodes a string encrypted using ENCODE()
DES_DECRYPT() Decrypt a string
DES_ENCRYPT() Encrypt a string
ENCODE() Encode a string
ENCRYPT() Encrypt a string
MD5() Calculate MD5 checksum
OLD_PASSWORD() Return the value of the pre-4.1 implementation of PASSWORD
PASSWORD() Calculate and return a password string
SHA1()SHA() Calculate an SHA-1 160-bit checksum
SHA2() Calculate an SHA-2 checksum
UNCOMPRESS() Uncompress a string compressed
UNCOMPRESSED_LENGTH() Return the length of a string before compression


PHP中MySQL、MySQLi和PDO的用法和区别

MySQL 是 PHP 操作 MySQL 数据库最原始的 Extension。MySQLi 的 i 代表 Improvement ,提供了相对进阶的功能,就 Extension 而言,本身也增加了安全性。而 PDO(PHP Data Object)则是提供了一个 Abstraction Layer 来操作数据库,光从理论上看不出来有什么差别,所以就直接看代码吧。

首先,先来看一段用 MySQL 编写的代码:

继续阅读 »

mysql的密码修改

方法1: 用SET PASSWORD命令
  mysql -u root
  mysql> SET PASSWORD FOR ‘root’@’localhost’ = PASSWORD(‘newpass’);
方法2:用mysqladmin
  mysqladmin -u root password “newpass”
  如果root已经设置过密码,采用如下方法
  mysqladmin -u root password oldpass “newpass”
方法3: 用UPDATE直接编辑user表
  mysql -u root
  mysql> use mysql;
  mysql> UPDATE user SET Password = PASSWORD(‘newpass’) WHERE user = ‘root’;
  mysql> FLUSH PRIVILEGES;
在丢失root密码的时候,可以这样
  mysqld_safe –skip-grant-tables&
  mysql -u root mysql
  mysql> UPDATE user SET password=PASSWORD(“new password”) WHERE user=’root’;
  mysql> FLUSH PRIVILEGES;

SQL To NoSQL – Top 6 Questions Before Making The Move

  1. SQL to NoSQL: Top 6 Questions Glynn Bird Developer Advocate @ IBM @glynn_bird
  2. Agenda 2 • Top 6 Questions When Moving to NoSQL 1. Why NoSQL? 2. Rows and Tables Become … What? 3. Will I Have to Rebuild My App? 4. How do I query data? 5. What’s _rev? 6. Does it replicate? • Live Q&A 继续阅读 »

mysql更改表结构

修改表的语法
=========================
增加列[add 列名]
=========================
①alter table 表名 add 列名 列类型 列参数【加的列在表的最后面】
例:alter table test add username char(20) not null default ”;
alter table test add birth date not null default ‘0000-00-00’;
继续阅读 »