PigRider Blogs

Sign In
HTML CSS Javascript Ruby on Rails C++ Java Python SQL Git Linux Others All
Previous 1 Next

MySQL Data Types

[Author: Dingyu]   [Thu, 2015-01-15, 11:16]   [983 views]

SQL

Please click below link to see details:
http://dev.mysql.com/doc/refman/5.7/en/storage-requirements.html ... see full article

Java Web application with Mysql

[Author: lzhang]   [Wed, 2014-04-09, 15:21]   [2022 views]

Java SQL

1 Java connection to MySQL 
To start, let us work on a simple java application(no web) connected to MySQL database(other database will be similar). 
Software needed: 
      Java http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
      MySQL  http://dev.mysql.com/down ... see full article

Start and Stop MySQL Service on Windows with Windows Command Prompt

[Author: Dingyu]   [Sun, 2013-10-20, 15:03]   [1454 views]

SQL

# Start MySQL Service on Windows with Windows Command Prompt
net start MySQL
# Stop MySQL Service on Windows with Windows Command Prompt
net stop MySQL
# Start and Stop other Windows Service with Windows Command Prompt
net start ServiceName
net stop ServiceName ... see full article

MySql: add auto-increment feature to a column in Ruby on Rails

[Author: ming.lian]   [Sun, 2013-08-11, 17:47]   [3051 views]

Ruby on Rails SQL

In ruby on rails, if you need to set a column with auto-increment, you have to execute a SQL command in your model.
Alter table Tablename modify column ColumnName int(11) auto_increment; ... see full article

Create MySQL composite primary key in Ruby On Rails

[Author: ming.lian]   [Sun, 2013-08-11, 17:47]   [1990 views]

Ruby on Rails SQL

MySql默认是以primary key作为clustered index,如果没有primary key的话,就以第一个unique index column作为clustered index,不需要单独建clustered index。
但是Ruby on Rails默认以自动生成的id作为primary key。所以如果你不想用自动生成的id作为primary key,则需要在ruby on rails里手动声明primary key。
代码如下:
create_table :table_name, :id => false do |t|
  t.integer :column_1 ... see full article

Change the password in MySQL when you don't have SUPER privilege

[Author: Dingyu]   [Sun, 2013-08-11, 17:46]   [1242 views]

SQL

If you wish to change your password by yourself but you don't have the SUPER privilege, below process may help you.
Suppose that:
Your MySQL username is Nickname
Your current MySQL password is OldPassword
You wish to change your password to NewPassword 
1. Log into the MySQL
If you are logging into ... see full article

Find records with non-printable characters in T-SQL

[Author: Dingyu]   [Sun, 2013-08-11, 17:44]   [2168 views]

SQL

I know two ways to find records with non-printable characters in T-SQL. The first way, use the "like" statement to do it:
SELECT * FROM tableName
WHERE (columnName COLLATE Latin1_General_BIN2) like '%[^' + CHAR(32) + '-' + CHAR(126) + CHAR(9) + CHAR(10) + CHAR(13) + ']%'
The second way, use the "PAT ... see full article

How to Set Primary Keys Other Than :id in Rails 3 with MySQL

[Author: Dingyu]   [Sun, 2013-08-11, 17:43]   [3359 views]

Ruby on Rails SQL

In Rails 3, the primary key in a database table is very important. Rails model ActiveRecord functions, like save, destroy, update_attributes, and so on, require it to invoke callbacks. Rails 3 uses the column 'id' as a default primary key in a database table. However, in MySQL, only the primary key ... see full article
Previous 1 Next

Most Popular in This Category: