Click to See Complete Forum and Search --> : MySQL "MUL" in Key row.


PJStew
07-22-2006, 09:25 AM
I'm trying to set up an add user part to my login, but i think i need my database to say MUL in the Key row. At the mo. it looks like this.

Enter password: ********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 24 to server version: 5.0.22-community-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use my_database;
Database changed
mysql> explain users;
+------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+-------------+------+-----+---------+-------+
| first_name | varchar(50) | YES | | NULL | |
| last_name | varchar(50) | YES | | NULL | |
| user_name | varchar(25) | YES | | NULL | |
| password | varchar(25) | YES | | NULL | |
+------------+-------------+------+-----+---------+-------+
4 rows in set (0.05 sec)

mysql>

I think it should look like this...

Enter password: ********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 24 to server version: 5.0.22-community-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use my_database;
Database changed
mysql> explain users;
+------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+-------------+------+-----+---------+-------+
| first_name | varchar(50) | YES | | NULL | |
| last_name | varchar(50) | YES | | NULL | |
| user_name | varchar(25) | YES | MUL | NULL | |
| password | varchar(25) | YES | | NULL | |
+------------+-------------+------+-----+---------+-------+
4 rows in set (0.05 sec)

mysql>

does anyone know how to change this?

NogDog
07-22-2006, 11:42 AM
Do you really want to allow nulls in all those columns? Assuming that at least user_name and password should not allow nulls, I'd recommend:

ALTER TABLE users
MODIFY login_name VARCHAR(25) PRIMARY KEY,
MODIFY password VARCHAR(25) NOT NULL;

chazzy
07-22-2006, 01:56 PM
but i think i need my database to say MUL in the Key row.

Where have you seen this MUL keyword? What purpose do you want it to serve?