mysql collate commonly used commands

2011-05-30  来源:本站原创  分类:Database  人气:93 

# MySQL remote database connection (192.168.9.10), port "3306" user name "root", password "123"
mysql-h 192.168.9.10-P 3306-u root-p123

# Mysql user permission to view
show grants for root @ 'localhost';

# See the MySQL database server and database character set
show variables like '% char%';

# See the MySQL data table (table) character set
show table status from db

# Create the database specifying the database character set
create database mydb character set utf-8;

# Modify the database character set
alter database mydb character set utf-8;

# Modify the comment
alter table test1 comment 'modified the comment';

# Modify the field notes - Note: Field names and field types according to write on the line
alter table test1 modify column field_name int comment 'revised field notes';

# View the field notes of the way - show
show full columns from test1;

# Add column
ALTER TABLE [table name] ADD [column name] INT NOT NULL COMMENT 'Notes'

# Delete the column
ALTER TABLE [table name] DROP [column name]

# Renaming columns \ modify the column type information
ALTER TABLE [table name] CHANGE [column name] [new column name] BIGINT NOT NULL COMMENT 'Notes'

# Rename table
ALTER TABLE [table name] RENAME [new name] table

# Remove the primary key
Alter TABLE [table name] drop primary key

# Add a primary key
ALTER TABLE sj_resource_charges ADD CONSTRAINT PK_SJ_RESOURCE_CHARGES PRIMARY KEY (resid, resfromid)

# Add indexes
ALTER TABLE news add index INDEX_NAME (title);

# Delete index
alter table news drop index INDEX_NAME;

相关文章
  • mysql collate commonly used commands 2011-05-30

    # MySQL remote database connection (192.168.9.10), port "3306" user name "root", password "123" mysql-h 192.168.9.10-P 3306-u root-p123 # Mysql user permission to view show grants for root @ 'localhost'; # See the MySQL datab

  • MySQL database commonly used commands 2010-12-27

    1, MySQL frequently used commands create database name; create a database use databasename; select the database drop database name directly delete the database, do not remind show tables; display table describe tablename; a detailed description of th

  • mysql some commonly used commands, statements - gradual improvement in 2011-03-09

    The following assumes that the current user is the ultimate authority 1, modify a table engine type ALTER TABLE tablename ENGINE = MyISAM Note: mysql engine type commonly used with MyISAM, ISAM, HEAP, BerkeleyDB, InnoDB, MERGE MyISAM is the default t

  • mysql order commonly used commands 2011-05-30

    # MySQL connect to a remote database (192.168.9.10), port "3306" user name "root", password "123" mysql-h 192.168.9.10-P 3306-u root-p123 # View mysql user permissions show grants for root @ 'localhost'; # See MySQL database

  • MySQL record commonly used commands 2011-02-23

    Record number of common mysql command memo, continuously updated ... Windows start / stop: net start mysql net stop mysql Linux start / stop: serice mysql start /etc/init.d/mysqld start serice mysql stop /etc/init.d/mysqld stop Connection: mysql -u u

  • Reproduced: db2, oracle, mysql more commonly used commands 2011-05-10

    First, common knowledge points 1, a database view can visit: oracle: View tnsname.ora or echo $ ORACLE_SID db2: mysql: show databases - see the current database: select database () 2, see the user table, view, table indexes, tables, columns, oracle:

  • MYSQL database, a collection of commonly used commands 2010-05-05

    Mysql database is a multi-user, multi-threaded relational database is a client / server architecture of the application. It is the personal users and business users is free. Mysql database has the following advantages: 1. Simultaneous access to an un

  • mysql commonly used commands 1 2011-01-30

    MYSQL list of commonly used commands 1, system management Add mysql-h host-u username-p Connect MYSQL (in the mysql / bin) exit MYSQL command to exit mysqladmin-u username-p password new password the old password to change the password (in the mysql

  • Linux, mysql commonly used commands ubuntu (rpm) 2011-05-24

    Linux, mysql commonly used commands 1.linux start the mysql command: mysqladmin start / Ect / init.d / mysql start (in front of the mysql installation path) 2.linux next restart mysql command: mysqladmin restart / Ect / init.d / mysql restart (in fro

  • Daquan Mysql commonly used commands, turn 2011-09-01

    Mysql commonly used commands show databases; display database create database name; create a database use databasename; Select database drop database name directly delete the database, not to remind the show tables; display tables describe tablename;

  • MySql5.0 commonly used commands 2010-10-21

    MySql5.0 A commonly used commands, open a connection ............................................ ...................................... 1 Second, increase the user .............................................. .................................... 1

  • SSH commonly used commands Daquan [transfer] 2010-12-10

    SSH commonly used commands Daquan rm-rf mydir / * mydir directory to delete * / cd mydir / * mydir directory entry * / cd - / * Top level directory * / cd ~ / * back to the root directory * / mv tools tool / * the tools directory renamed tool * / ln-

  • Rails finishing commonly used commands 2011-05-31

    Rails finishing commonly used commands Ruby on Rails 2009-12-08 11:16:59 read 247 comments 0 Font Size: medium and small Subscriptions ------ GEM: gem install rails - include-dependencies gem install rails-v = 2.0.2 Automatically install the rails --

  • linux debian commonly used commands 2010-12-01

    Debian (Ubuntu) commonly used commands Daquan [records] Submitted by pirate on 2007, August 19, 8:57 AM. Linux learning This article describes the version from ubuntu 5.10 after the system on behalf of the command parameters, dapper, edgy, and 7.04 v

  • db2 commonly used commands 2011-07-19

    A commonly used commands 1 to establish a database DB2_GCB (based on the file system) CREATE DATABASE DB2_GCB ON G: ALIAS DB2_GCB USING CODESET GBK TERRITORY CN COLLATE USING SYSTEM DFT_EXTENT_SZ 32 db2 "CREATE DATABASE bipdb on 'E:' USING CODESET GB

  • Ubuntu Linux Operating System details commonly used commands 2010-05-24

    Ubuntu Linux Operating System details commonly used commands Udo apt - get install software, install the software command name sudo nautilus to open the file (with root permissions) su root switch to the "root" ls list the current directory file

  • Maven2 commonly used commands 2010-06-17

    from: http://guooo.javaeye.com/blog/280604 Maven2 commonly used commands Maven2 running command: mvn, Common commands are: mvn archetype: create: create a Maven project mvn compile: compile the source code mvn test-compile: compile the test code mvn

  • Detailed Screen commonly used commands 2010-09-23

    screen for multiple window management procedures. 1. Installation: rmp-ivh screen-4.0.2-5 2. Start: screen The default screen will start a process to read / etc / scrennrc configuration file, ~ /. Screenrc configuration file (if any) 3.screen can bri

  • Git commonly used commands 2010-10-12

    The first step: install the software on this machine ----------------------------------- (1) sudo apt-get install git-core curl The second step, identify themselves to the git -------------------------- $ Git config - global user.name "Your Name Come

  • Under the commonly used commands vi editor linux command Daquan 2010-10-16

    Under the commonly used commands vi editor linux command Daquan Text editor is the most commonly used of all computer systems as a tool. Under UNIX editor has ex, sed, and vi and so on, which is the most widely used vi, the vi command range, the foru