Results 1 to 6 of 6
  1. #1

    How to alter tabel and create table in mysql

    Hi guys

    I am sorry for such a noob question, but I have a script and there are some modifications that I want to make

    In the instructions it says ALTER TABLE and CREATE TABLE in myqsl but I dont know exactly how to do this.

    I have tried to google but everything i find is very technical and doesnt explain the easiest way to do it.

    Should I use phpmyadmin or whats the correct way?

  2. #2
    Join Date
    Feb 2006
    Location
    Victoria, Australia
    Posts
    132
    There are mulitple ways but seeing as you've mentioned phpmyadmin try this link http://www.smartwebby.com/PHP/database_table_create.asp

  3. #3
    Join Date
    May 2005
    Location
    New York
    Posts
    736
    you can use phpmyadmin or the commandline mysql admin tool

    mysql
    mysql> CREATE DATABASE db_name;
    mysql> USE db_name;
    mysql> CREATE TABLE table_name;
    mysql> \q


    etc
    Perigee Global Corporation
    Design, Development and Hosting Solutions
    Dedicated Servers, CDN, Hosted E-Mail, Web Hosting, VPS & Cloud Servers
    1.212.400-7632 www.perigeeglobal.com

  4. #4

  5. #5
    Join Date
    Jun 2009
    Location
    Kochi,India
    Posts
    177
    You can easily do this through phpmyadmin and if you want to do it from the command prompt here are some commands
    * To update info already in a table

    mysql> UPDATE [table name] SET Select_priv = 'Y',Insert_priv = 'Y',Update_priv = 'Y' where [field name] = 'user';


    *Delete a row(s) from a table.

    mysql> DELETE from [table name] where [field name] = 'whatever';

    * Update database permissions/privilages.

    mysql> flush privileges;

    * Delete a column.

    mysql> alter table [table name] drop column [column name];

    * Add a new column to db

    mysql> alter table [table name] add column [new column name] varchar (20);

    * Change column name.

    mysql> alter table [table name] change [old column name] [new column name] varchar (50);

    * Make a unique column so you get no dupes.

    mysql> alter table [table name] add unique ([column name]);

    * Make a column bigger.

    mysql> alter table [table name] modify [column name] VARCHAR(3);

    * Delete unique from table.

    mysql> alter table [table name] drop index [colmn name];
    Ezeelogin -
    The ultimate multiple server administration software.
    *Parallel shell *rm -rf protection *SSH logging*automated password changes*encrypted storage*
    AdMod.com -Delivering innovative web hosting solutions

  6. #6

Similar Threads

  1. insert sql breaking after alter table
    By vbpowerhost in forum Programming Discussion
    Replies: 9
    Last Post: 01-07-2009, 10:59 PM
  2. Mysql alter table = deletes rows?
    By LindonNetworks in forum Programming Discussion
    Replies: 3
    Last Post: 09-14-2007, 10:26 PM
  3. Alter table how
    By Cool Surfer in forum Programming Discussion
    Replies: 2
    Last Post: 07-11-2007, 09:26 AM
  4. SQL Request: Alter Table
    By Dark Angel in forum Programming Discussion
    Replies: 2
    Last Post: 09-09-2002, 11:12 PM
  5. Alter table?
    By Scotty_B in forum Hosting Security and Technology
    Replies: 4
    Last Post: 07-01-2002, 05:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •