answersLogoWhite

0

To create a table in MySQL you will need to use the CREATE TABLE function. This is simple enough to use, a simple example of creating a users table is below, it has a unique id (Primary Key) with a unique username and a password field (which I would recommend storing as an MD5).

CREATE TABLE users (id INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,

username VARCHAR( 16 ) NOT NULL ,

password CHAR( 32 ) NOT NULL ,

UNIQUE (

username

)

);

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

How do you create a table in dreamweaver?

using the mysql command "create table table_name" we can create a table in dreamweaver.


How can you create a MYSQL table?

A good place to find tutorials on how to make a MYSQL table is tutorials point. It will show how to create the table as well as give many examples. It also has many other related tutorials.


How do you retrieve data from one MySQL table and create another MySQL table with the same data in it using PHP?

Execute a SELECT INTO statement on the mysql database: INSERT INTO destination_table (id, first_name, last_name) SELECT id, first_name, last_name from source_table;


What is MyISAM in MySQL?

MyISAM is the default table engine in the MySQL database.


How many records and columns to store in MySQL database table and how many tables we can create?

In MySQL, the maximum number of rows and columns a table can have depends on the storage engine, but generally, a MySQL table can have up to 65,535 columns. The maximum number of rows is limited by the storage capacity of the database and the size of the rows. You can create a vast number of tables in a MySQL database, with the practical limit being around 4.3 billion tables per database, though performance may degrade with very high numbers.


How do you create a new database in MySQL?

The MySQL command is "CREATE DATABASE [dbname]" with "[dbname]" replaced with your desired database name.


How do you store and retrieve pictures in MySQL database?

The best thing to do is store them in a longblob field in your MySQL table.


What is MySQL insert command?

The INSERT command in MySQL allows you to enter a new row of data to a table in your database.


How do you retrieve 10 records from table in mysql?

For work with mysql database make use of software below to open/read/scan/export-import mysql data


In mysql what type of values TimeStamp will Create?

This is default 0000-00-00 00:00:00 value when we create a timestamp field in mysql database.


How do you replicate a MySQL TABLE?

I'm assuming you mean *duplicate* not replicate. Replicating refers to having the same data on multiple machines for either performance or backup issues. The following solution is for duplicating a table. I'm by no means a MySQL genius, but I've worked with MySQL for a while. If you have PHPMyAdmin installed, the easiest thing to do is go to your table, click Operations, fill in "copy table to..." If you don't have PHPMyAdmin, the easiest way I can think of is using mysqldump, editting the dump file, then importing the table: > mysqldump -p DatabaseNameToGetFrom TableName > SomeFileName.dump > pico/ee/edit/vi/emacs/YourFavoritePlainTextEditor SomeFileName.dump Use a find and replace on the old table name and change it to the new tablename, save it, exit the editor then run this command: > mysql -p -D DataBaseNameToPutInto < SomeFileName.dump That should do it fine. Another way is this command: create table NEW select * from OLD; Then use: show create table OLD; alter table NEW add primary key (this,that); Then add other keys as necessary;


What is the role of the insert command in MySQL?

The INSERT statement in MySQL is used to add data to a table. The INSERT INTO command inserts one or more rows into a MySQL table. For single row insertion you need to use the following syntax: INSERT Into table_name(column_1,column_2,column_3) VALUES(value_1, value_2, value_3); To speed up the process, you can use additional MySQL database management tools. For example, in dbForge Studio for MySQL, you can use the Generate Script as feature to insert one or more rows into a MySQL table.