Jump to content

satimis

Members
  • Posts

    91
  • Joined

  • Last visited

Everything posted by satimis

  1. Hi justsomeguy,Whether adding following heading on top$table=users, table_name2, table_name3, etc changing following line; $Q = "SELECT * FROM users"; // select everything to; $Q = "SELECT * FROM $table"; // select everything ???I haven't figured out how to make following items as variable; //row for each recordwhile ($row = mysql_fetch_assoc ($result) ) { // loop through the result setecho"<tr><td>" . $row['id'] . "</td><td>" . $row['name'] . "</td><td>" . $row['c$} Any advice? Thanks Following PHP script works for me generating SHA1 hash<?php$str="apassword";$hash=sha1($str); print $hash;?> I haven't figured a script to be run on variable. Say for example;On terminal$ php -f /path/to/script.php password_1/password_2/password-3 etc.Any advice? TIAEdit:Just discovered;The sha1 hash generated by running "script.php" differed from the encrypted password on MySQL table ?On MySQL table; 0eWBW8//TnfEg On terminal;$ php -f /home/satimis/php_pw.php 99232baee6cb82c26cdd2fafebac37d9e2020976 It seems MySQL running different encrypting method ?B.R.satimis
  2. The php script abovementioned can work only on the "users" table inside MySQL database. If there are several tables inside under different name, I must create several scripts to read them. I think one php script wouldn't work on all "tables". Which package provides SHA1 command? I think SHA1 and sha1sum are NOT the same.B.R.satimis
  3. Hi justsomeguy,I got it done just adding border=1 inside <table border=1>. To increase the table size just use 2/3/4 etc. I just want to check the data entered on the database tables. I'm NOT aware how to display the data using MySQL function. Now I use the php script instead. However if there are many tables I have to create many php scripts. It is NOT convenient. I just want to check whether the passwords entered are correct. Now I have to use copy/paste taking down what I have entered. I can't retrieve the password entered on hash. Maybe it can work only by intensive testing and guessing. If some body complains unable to login with his/her password then I have to create a new password for them.B.R.satimis
  4. Modified the script as follow;<?php//These variables will determine the search parameters later$host="localhost"; //Database host.$user="root"; //Database username.$pass="apassword"; //Database password.$dbase="maildb"; //Database.$connect=mysql_connect($host,$user,$pass); //Connect to the database.mysql_select_db($dbase, $connect);//after the connection is made use the INSERT command to enter the values in the db$Q = "SELECT * FROM users"; // select everything//result set$result = mysql_query($Q);//creating the table /w headersecho "<html><body>";echo "<table><tr><td>id</td><td>name</td><td>crypt</td></tr>";//row for each recordwhile ($row = mysql_fetch_assoc ($result) ) { // loop through the result setecho"<tr><td>" . $row['id'] . "</td><td>" . $row['name'] . "</td><td>" . $row['crypt'] . "</td></tr>";}echo "</table>";echo "</body></html>";//close the dbmysql_close();?> Put it on /var/www/sqlusers.php. Fire a browser to evoke it. Then the output is displayed as table but without table frame. How to add it? TIA Thanks for your URL. I need to digest it first. Is it to decrypt the encrypted password one by one? OR to display all of them on the table?B.R.satimis
  5. Yes, there are data on "users' table.mysql> DESCRIBE users;+-----------------+----------------------+------+-----+-------------------------+-------+| Field | Type | Null | Key | Default | Extra |+-----------------+----------------------+------+-----+-------------------------+-------+| id | varchar(128) | NO | PRI | | | | name | varchar(128) | NO | | | | | uid | smallint(5) unsigned | NO | | 5000 | | | gid | smallint(5) unsigned | NO | | 5000 | | | home | varchar(255) | NO | | /var/spool/mail/virtual | | | maildir | varchar(255) | NO | | blah/ | | | enabled | tinyint(3) unsigned | NO | | 1 | | | change_password | tinyint(3) unsigned | NO | | 1 | | | clear | varchar(128) | NO | | ChangeMe | | | crypt | varchar(128) | NO | | sdtrusfX0Jj66 | | | quota | varchar(255) | NO | | | | | procmailrc | varchar(128) | NO | | | | | spamassassinrc | varchar(128) | NO | | | | +-----------------+----------------------+------+-----+-------------------------+-------+13 rows in set (0.00 sec) Ran following steps to enter data mysql> INSERT INTO users (id,name,maildir,crypt) VALUES -> ('satimis@satimis.com','satimis','satimis/', encrypt('pass_A') ), -> ('smsliu@satimis.com','smsliu','smsliu/', encrypt('pass_B') ), -> ('albert@satimis.com','albert','albert/', encrypt('pass_C') ), -> ('postmaster@satimis.com','postmaster','postmaster/', encrypt('pass_D') );etc. Edit:If changing .... echo $row["column1"]; echo $row["column2"]; echo $row["column3"];.... as; .... echo $row['id'] . "<BR>"; echo $row['name'] . "<BR>"; echo $row['crypt'] . "<BR>";.... Then it works;# php /home/satimis/sqlusers.php satimis@satimis.com<br>satimis<br>0e3QZ140ZrOOE<br>smsliu@satimis.com<br>smsliu<br>0eWBW8//TnfEg<br>albert@satimis.com<br>albert<br>XNP5IEvi8VZS6<br>patricia@satimis.com<br>patricia<br>0eg78AAkIGLWM<br>postmaster@satimis.com<br>postmaster<br>0e130m.vyL/aU<br>albertcheung@satimis.com<br>Albert Cheung<br>XXvTmrqgLrBGY<br>root@vz2:/# But the output is NOT in table form. The passwords are already encrypted. How to show the passwords in original text (i.e. before encrypted)? Thankssatimis
  6. ThanksStill failPerformed following steps# mv /home/satimis/phpusers /home/satimis/sqlusers.php# cat /home/satimis/sqlusers.php <?php$host="localhost"; //Database host.$user="root"; //Database username.$pass="apassword"; //Database password.$dbase="maildb"; //Database.$connect=mysql_connect($host,$user,$pass); //Connect to the database.$Q = "SELECT * FROM users"; // select everything$result = mysql_query($Q);while ($row = mysql_fetch_assoc ($result) ) { // loop through the result set echo $row["column1"]; echo $row["column2"]; echo $row["column2"];}?> # chmod +x /home/satimis/sqlusers.php # php /home/satimis/sqlusers.php Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/satimis/sqlusers.php on line 12 line 12 while ($row = mysql_fetch_assoc ($result) ) { // loop through the result set Edit:If adding following line on the script; mysql_select_db($dbase, $connect); after; $connect=mysql_connect($host,$user,$pass); //Connect to the database. Nothing print out on running the script;# php /home/satimis/sqlusers.php B.R.satimis
  7. Hi Synook,Thanks for your advice.# cat /home/satimis/phpusers <?php$host="localhost"; //Database host.$user="root"; //Database username.$pass="apassword"; //Database password.$dbase="maildb"; //Database.$connect=mysql_connect($host,$user,$pass); //Connect to the database.$Q = "SELECT * FROM users"; // select everything$result = mysql_query($Q);while ($row = mysql_fetch_assoc ($result) ) { // loop through the result set echo $row["column1"]; echo $row["column2"]; echo $row["column2"];}?> Where shall I run the script? If just run it on terminal it can't workroot@vz2:/# /home/satimis/phpusers /home/satimis/phpusers: line 1: ?php: No such file or directory/home/satimis/phpusers: line 3: =localhost: command not found/home/satimis/phpusers: line 3: //Database: No such file or directory/home/satimis/phpusers: line 4: =root: command not found/home/satimis/phpusers: line 4: //Database: No such file or directory/home/satimis/phpusers: line 5: =vz2mysqlroot: command not found/home/satimis/phpusers: line 5: //Database: No such file or directory/home/satimis/phpusers: line 6: =maildb: command not found/home/satimis/phpusers: line 6: //Database.: No such file or directory/home/satimis/phpusers: line 8: syntax error near unexpected token `$host,$user,$pass'/home/satimis/phpusers: line 8: `$connect=mysql_connect($host,$user,$pass); //Connect to the database.' Neither I understand what the errors indicate. Please help. TIAB.R.satimis
  8. Hi justsomeguy,Noted and thanks PHP is also new to me.Whether adding following lines on top of the script$host="root"; //Database host.$user=""; //Database username.$pass="apassword"; //Database password.$dbase="maildb"; //Database.$connect=mysql_connect($host,$user,$pass); //Connect to the database. This is a test. Only root can access the database, "maildb". So I will leave "user" blank; $user=""; //Database username. ???If an user, "aaa" can access the database whether I leave the root blank instead; $host=" "; //Database host. TIAB.R.satimis
  9. H justsomeguy,Thanks for your advice.php5 is running.mysql> SHOW tables;+------------------+| Tables_in_maildb |+------------------+| aliases | | domains | | users | +------------------+3 rows in set (0.00 sec) # cat /home/satimis/phpusers <?php$Q = "SELECT * FROM users"; // select everything$result = mysql_query($Q);while ($row = mysql_fetch_assoc ($result) ) { // loop through the result set echo $row["column1"]; echo $row["column2"]; echo $row["column2"];}?> # ls -l /home/satimis/phpusers -rwxr-xr-x 1 satimis satimis 244 May 27 01:22 /home/satimis/phpusers I can't not resolve where to run that script.if login the database it can't find the path/to/phpusersIf running the script direct on terminal it popup;# /home/satimis/phpusers /home/satimis/phpusers: line 1: ?php: No such file or directory/home/satimis/phpusers: line 3: =: command not found/home/satimis/phpusers: line 3: //: is a directory/home/satimis/phpusers: line 4: syntax error near unexpected token `('/home/satimis/phpusers: line 4: `$result = mysql_query($Q);' Please shed me some light. TIAB.R.satimis
  10. Hi Deirdre's Dad,Where shall I put the php script, on which directory? ThanksB.R.satimis
  11. Hi folks,After creating a table and entering data on it, how can I display all data just edited on table. I have been googling around and couldn't figure out what MySQL command I have to use. Please shed me some light. TIAB.R.satimis
  12. Hi folks,Ran following command to create aliases table mysql> CREATE TABLE `aliases` ( -> `pkid` smallint(3) NOT NULL auto_increment, -> `mail` varchar(120) NOT NULL default '', -> `destination` varchar(120) NOT NULL default '', -> `enabled` tinyint(1) NOT NULL default '1', -> PRIMARY KEY (`pkid`), -> UNIQUE KEY `mail` (`mail`) -> );Query OK, 0 rows affected (0.01 sec) And ran following command to enter data mysql> INSERT INTO aliases (mail,destination) VALUES -> ('albert@abc.com','albert@abc.com'), Now I need to change "albert@abc.com" to "albertlee@abc.com" running following command without sucess mysql> ALTER aliases CHANGE 'albert@abc.com', 'albertcheung@abc.com' varchar(120);mysql> ALTER aliases CHANGE 'albert@abc.com' 'albertcheung@abc.com';mysql> ALTER aliases CHANGE 'albert@abc.com', 'albertcheung@abc.com'; etc. Always syntax error.Please advise what will be the correct syntax? TIAWill MODIDY be the same as CHANGE?Can I use DROP to erase this email address? If YES please advise how? B.R.satimis
  13. Hi Synook,Thanks for your advice. If I don't change the column definition can I leave it without retyping it on the command? Could you please help me to understand the command to be entered? For example in my case;INSERT INTO users (id,name,maildir,clear) VALUES If I need to move "name" after "clear", whether typing; -> ALTER users CHANGE name | clear TIAB.R.satimis
  14. Hi jlhaslip,Thanks for your advice.I'll run following commandsmysql> USE database;mysql> ALTER users CHANGE clear crypt varchar (30); According to 12.1.7. ALTER TABLE Syntaxhttp://dev.mysql.com/doc/refman/5.1/en/alter-table.html CHANGE [COLUMN] old_col_name new_col_name column_definition [FIRST|AFTER col_name] I suppose "varchar (30)" is column_definition ? Where to find it?What is [FIRST|AFTER col_name] ?TIAB.R.satimis
  15. Hi folks,Ran following entry creating a database; mysql> INSERT INTO users (id,name,maildir,clear) VALUES -> ('xyz@aaa.com','xyz','xyz/', encrypt('password') ), -> etc. -> etc. -> etc.;Query OK, 4 rows affected (0.00 sec)Records: 4 Duplicates: 0 Warnings: 0 Now I need changing "clear" to "crypt"Please advise how to make such a change. TIAB.R.satimis
  16. satimis

    Syntax Problem

    Hi justsomeguy,Performed 2 tests as follows;1)mysql> UPDATE users SET `crypt`=encrypt('abcde','ab') WHERE id='root@localhost';Query OK, 1 row affected (0.03 sec)Rows matched: 1 Changed: 1 Warnings: 0 mysql> SELECT crypt, encrypt('abcde','ab') -> FROM users -> WHERE id = 'root@localhost';+---------------+----------------------------+| crypt | encrypt('abcde','ab') |+---------------+----------------------------+| ablOUJbYqen22 | ablOUJbYqen22 | +---------------+----------------------------+1 row in set (0.00 sec) 2) mysql> UPDATE users -> SET crypt = encrypt('abcde','ab') -> WHERE id = 'root@localhost';Query OK, 0 rows affected (0.01 sec)Rows matched: 1 Changed: 0 Warnings: 0 mysql> FLUSH PRIVILEGES;Query OK, 0 rows affected (0.00 sec) mysql> SELECT crypt, encrypt('abcde','ab') -> FROM users -> WHERE id = 'root@localhost';+---------------+----------------------------+| crypt | encrypt('abcde','ab') |+---------------+----------------------------+| ablOUJbYqen22 | ablOUJbYqen22 | +---------------+----------------------------+1 row in set (0.00 sec) They seem working. The output on left and right columns are identical.ThanksB.R.satimis
  17. satimis

    Syntax Problem

    Hi justsomeguy,Thanks for your advice. I got it.mysql> SELECT crypt, encrypt('abcde','ab') -> FROM users -> WHERE id = 'root@localhost';+---------------+----------------------------+| crypt | encrypt('abcde','ab') |+---------------+----------------------------+| VpwUzEV/3gddQ | ab.myqrA0/jNA | +---------------+----------------------------+1 row in set (0.00 sec) Even running "N" times, the output on the right column remains unchanged. But still I can't find the 'left' and 'right' column output matched.B.R.satimis
  18. satimis

    Syntax Problem

    Hi jesh,There is NOTHING to do with the root password. This password is used controlling a set of mysql files created on setting up this mail server running virtual domain. The confirmation on its correct change will clarify my doubt in case a problem popup on testing this mail server later. It is NOT the problem of the password changed.In the worst situation I just DROP this maildb and create a new one.Anyway thanks for your assistance and URL.B.R.satimis
  19. satimis

    Syntax Problem

    Hi jesh,Made 2 tests without result.1)Your version;mysql> UPDATE users -> SET crypt = encrypt('abcde') -> WHERE id = 'root@localhost';Query OK, 1 row affected (0.00 sec)Rows matched: 1 Changed: 1 Warnings: 0 mysql> FLUSH PRIVILEGES;Query OK, 0 rows affected (0.01 sec) mysql> SElECT crypt, encrypt('abcde') -> FROM users -> WHERE id = 'root@localhost';+---------------+-----------------------+| crypt | encrypt('abcde') |+---------------+-----------------------+| vBt2T6gFNegU6 | zHwuDiFRfEdZ. | +---------------+-----------------------+1 row in set (0.00 sec) 2)My version; mysql> UPDATE users SET `crypt`=encrypt('abcde') WHERE id='root@localhost';Query OK, 1 row affected (0.00 sec)Rows matched: 1 Changed: 1 Warnings: 0 mysql> FLUSH PRIVILEGES;Query OK, 0 rows affected (0.00 sec) mysql> SELECt crypt, encrypt('abcde') -> FROM users -> WHERE id = 'root@localhost';+---------------+-----------------------+| crypt | encrypt('abcde' |+---------------+-----------------------+| I4NOUUPuf8QqY | x5Gh8u9Cvx0hM | +---------------+-----------------------+1 row in set (0.00 sec) Edit:On your version, I ran following command twice. The output on the right column is different; mysql> SElECT crypt, encrypt('abcde') -> FROM users -> WHERE id = 'root@localhost';+---------------+-----------------------+| crypt | encrypt('abcde') |+---------------+-----------------------+| vBt2T6gFNegU6 | zXozEmpE/CluM | +---------------+-----------------------+1 row in set (0.00 sec) mysql> SElECT crypt, encrypt('abcde') -> FROM users -> WHERE id = 'root@localhost';+---------------+-----------------------+| crypt | encrypt('abcde') |+---------------+-----------------------+| vBt2T6gFNegU6 | fZZHNIeMDHeY2 | +---------------+-----------------------+1 row in set (0.00 sec) I also checked my version. Result was the same, value on right column changed. Value on left column remained the same.But the value on left column differed from the value generated from your version.B.R.satimis
  20. satimis

    Syntax Problem

    Hi jesh,Thanks for your advice.I tried follow before;mysql> UPDATE users SET `crypt`=encrypt('abcde') WHERE id='root@localhost';Query OK, 1 row affected (0.02 sec)Rows matched: 1 Changed: 1 Warnings: 0 It is similar to your advice.Then; mysql> FLUSH PRIVILEGES;Query OK, 0 rows affected (0.01 sec) But I found on ; mysql> DESCRIBE users;+-----------------+----------------------+------+-----+-------------------------+-------+| Field | Type | Null | Key | Default | Extra |+-----------------+----------------------+------+-----+-------------------------+-------+| id | varchar(128) | NO | PRI | | | | name | varchar(128) | NO | | | | | uid | smallint(5) unsigned | NO | | 5000 | | | gid | smallint(5) unsigned | NO | | 5000 | | | home | varchar(255) | NO | | /var/spool/mail/virtual | | | maildir | varchar(255) | NO | | blah/ | | | enabled | tinyint(3) unsigned | NO | | 1 | | | change_password | tinyint(3) unsigned | NO | | 1 | | | clear | varchar(128) | NO | | ChangeMe | | | crypt | varchar(128) | NO | | sdtrusfX0Jj66 | | | quota | varchar(255) | NO | | | | | procmailrc | varchar(128) | NO | | | | | spamassassinrc | varchar(128) | NO | | | | +-----------------+----------------------+------+-----+-------------------------+-------+13 rows in set (0.00 sec) It seems no change;cryptdefault = sdtrusfX0Jj66as before.Tried your suggestion; mysql> UPDATE users -> SET crypt = encrypt('abcde') -> WHERE id = 'root@localhost';Query OK, 1 row affected (0.00 sec)Rows matched: 1 Changed: 1 Warnings: 0mysql> FLUSH PRIVILEGES;Query OK, 0 rows affected (0.01 sec) mysql> DESCRIBE users; +-----------------+----------------------+------+-----+-------------------------+-------+| Field | Type | Null | Key | Default | Extra |+-----------------+----------------------+------+-----+-------------------------+-------+| id | varchar(128) | NO | PRI | | | | name | varchar(128) | NO | | | | | uid | smallint(5) unsigned | NO | | 5000 | | | gid | smallint(5) unsigned | NO | | 5000 | | | home | varchar(255) | NO | | /var/spool/mail/virtual | | | maildir | varchar(255) | NO | | blah/ | | | enabled | tinyint(3) unsigned | NO | | 1 | | | change_password | tinyint(3) unsigned | NO | | 1 | | | clear | varchar(128) | NO | | ChangeMe | | | crypt | varchar(128) | NO | | sdtrusfX0Jj66 | | | quota | varchar(255) | NO | | | | | procmailrc | varchar(128) | NO | | | | | spamassassinrc | varchar(128) | NO | | | | +-----------------+----------------------+------+-----+-------------------------+-------+13 rows in set (0.00 sec) Still the same.Is there any way to check whether password has been changed? TIAB.R.satimis
  21. satimis

    Syntax Problem

    Hi folks,Have created a database 'maildb' and ran following steps entering data afterwards.mysql> use maildb;mysql> show tables; +------------------+| Tables_in_maildb |+------------------+| aliases | | domains | | users | +------------------+3 rows in set (0.01 sec) Ran following command mistakenly; mysql> INSERT INTO users (id,name,maildir,crypt) VALUES -> ('root@localhost','root','root/', encrypt('apassword') );Query OK, 1 row affected (0.00 sec) Then exit mysql.I should replace 'apassword' with the password used on other files, say 'abcde'.Following data have been set on "users"mysql> DESCRIBE users; +-----------------+----------------------+------+-----+-------------------------+-------+| Field | Type | Null | Key | Default | Extra |+-----------------+----------------------+------+-----+-------------------------+-------+| id | varchar(128) | NO | PRI | | | | name | varchar(128) | NO | | | | | uid | smallint(5) unsigned | NO | | 5000 | | | gid | smallint(5) unsigned | NO | | 5000 | | | home | varchar(255) | NO | | /var/spool/mail/virtual | | | maildir | varchar(255) | NO | | blah/ | | | enabled | tinyint(3) unsigned | NO | | 1 | | | change_password | tinyint(3) unsigned | NO | | 1 | | | clear | varchar(128) | NO | | ChangeMe | | | crypt | varchar(128) | NO | | sdtrusfX0Jj66 | | | quota | varchar(255) | NO | | | | | procmailrc | varchar(128) | NO | | | | | spamassassinrc | varchar(128) | NO | | | | +-----------------+----------------------+------+-----+-------------------------+-------+13 rows in set (0.00 sec) I tried to correct the mistake with the correct password by running following commands without result;mysql> UPDATE users SET crypt='apassword'('abcde') WHERE id='root@localhost'; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '('abcde') WHERE id='root@localhost'' at line 1 mysql> UPDATE users SET crypt=encrypt('apassword')(encrypt('abcde')) WHERE id='root@localhost'; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(encrypt('abcde')) WHERE id='root@localhost'' at line 1 mysql> UPDATE users SET crypt='encrypt('apassword')'(encrypt('abcde')) WHERE id='root@localhost'; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'apassword')'(encrypt('abcde')) WHERE id='root@localhost'' at line 1 etc.Please advise the correct syntax to be used. TIAB.R.satimis
  22. satimis

    Typing Mistake

    mysql> DESCRIBE virtual_domains;+-------+-------------+------+-----+---------+----------------+| Field | Type | Null | Key | Default | Extra |+-------+-------------+------+-----+---------+----------------+| id | int(11) | NO | PRI | NULL | auto_increment || name | varchar(50) | YES | | NULL | |+-------+-------------+------+-----+---------+----------------+2 rows in set (0.00 sec) mysql> ALTER TABLE virtual_domains -> MODIFY name varchar(50) not null;Query OK, 0 rows affected (0.12 sec)Records: 0 Duplicates: 0 Warnings: 0 mysql> DESCRIBE virtual_domains; +-------+-------------+------+-----+---------+----------------+| Field | Type | Null | Key | Default | Extra |+-------+-------------+------+-----+---------+----------------+| id | int(11) | NO | PRI | NULL | auto_increment || name | varchar(50) | NO | | | |+-------+-------------+------+-----+---------+----------------+2 rows in set (0.00 sec) Noted with thanks. Noted and thanksB.R.satimis
  23. satimis

    Typing Mistake

    Hi Stefano De Boni',Your advice works here. ThanksBefore reading your posting I tried following commands;mysql> ALTER TABLE virtual_domains -> CHANGE [COLUMN] neme name;ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[COLUMN] neme name' at line 2 mysql> ALTER TABLE virtual_domains -> CHANGE [COLUMN] 'neme' 'name'; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[COLUMN] 'neme' 'name'' at line 2 mysql> ALTER TABLE virtual_domains -> CHANGE [COLUMN] neme name Field; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[COLUMN] neme name Field' at line 2 mysql> ALTER TABLE virtual_domains -> CHANGE [COLUMN] 'neme' 'name' 'Field'; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[COLUMN] 'neme' 'name' 'Field'' at line 2 I can't resolve "column_definition". "varchar(50)" ? "No Null"?I read following manual;http://dev.mysql.com/doc/refman/5.0/en/alter-table.htmlplus some others found on googling. But the syntax confuses me.What is column_definition?What is {INDEX|KEY} [index_name], reference_definition, reference_definition, etc.They confuse me to certain extent. Also the error on the commands run by me previously always asking looking for the right version of MySQL.Are there MySQL documents with examples illustrated? TIAB.R.satimis
  24. satimis

    Typing Mistake

    Hi folks,I made a typing mistake "neme" on following table;mysql> DESCRIBE virtual_domains; +-------+-------------+------+-----+---------+----------------+| Field | Type | Null | Key | Default | Extra |+-------+-------------+------+-----+---------+----------------+| id | int(11) | NO | PRI | NULL | auto_increment || neme | varchar(50) | NO | | | |+-------+-------------+------+-----+---------+----------------+2 rows in set (0.00 sec) Please advise how can I correct it instead of drop the table. TIAB.R.satimis
  25. Hi folks,mysql versionVer 14.12 Distrib 5.0.32I ran following command creating a table:- mysql> CREATE TABLE `tblPerdition` ( -> `user` varchar(128), -> `servername` varchar(255) default '', -> `port` varchar(8) NULL default 'NULL', -> PRIMARY KEY (`user`) -> ); Query OK, 0 rows affected (0.00 sec) mysql> DESCRIBE tblPerdition;+------------+--------------+------+-----+---------+-------+| Field | Type | Null | Key | Default | Extra |+------------+--------------+------+-----+---------+-------+| user | varchar(128) | NO | PRI | | || servername | varchar(255) | YES | | | || port | varchar(8) | YES | | NULL | |+------------+--------------+------+-----+---------+-------+3 rows in set (0.00 sec) I can't figure out how to made Null columns of 'user' blank (without NO)and 'servername' blank (without YES)Please help. TIAB.R.satimis
×
×
  • Create New...