Quantcast
Channel: Tech Notes » mysql
Browsing latest articles
Browse All 6 View Live

Image may be NSFW.
Clik here to view.

Create MySQL Database and User

Below are the steps to create a MySQL database and add a user CREATE DATABASE testdb CHARACTER SET utf8 COLLATE utf8_general_ci; GRANT ALL PRIVILEGES ON testdb.* TO 'testuser'@'127.0.0.1' IDENTIFIED...

View Article



Image may be NSFW.
Clik here to view.

MySQL Drop Unique Constraint

In MySQL 5.0 it is possible to drop unqiue constraints but, the syntax is not incredibly intuitive. alter table TABLE_NAME drop index UNIQUE_CONSTRAINT_NAME; Code Ghar provides a more thorough...

View Article

Image may be NSFW.
Clik here to view.

MySQL Increase Column Size

An example of modifying a MySQL table to increase a VARCHAR column size: alter table TABLE_NAME modify COLUMN_NAME VARCHAR(1024) NOT NULL; This increases COLUMN_NAME to 1024 characters.

View Article

Image may be NSFW.
Clik here to view.

Rebuild An InnoDB Table Index

Rebuilding an InnoDB table index is easy in MySQL 5.0. Simply type: mysql> ALTER TABLE table_name ENGINE=InnoDB; Warning: When dealing with large databases, this can place a lot of load on your DB.

View Article

Image may be NSFW.
Clik here to view.

MySQL Update Table Limit Rows

Updating a block of rows in MySQL can be accompished by using the “limit” function: update TABLE_NAME set COLUMN_NAME=VALUE limit MAX; E.g. update products set state=false limit 10;

View Article


Image may be NSFW.
Clik here to view.

MySQL and Negative Infinity

Storing and retrieving negative infinity in a MySQL database is accomplished by inserting an arbitrarily large negative number.  Negative infinity is handy when storing default values in a database....

View Article
Browsing latest articles
Browse All 6 View Live




Latest Images