Logging to file '/home/nieusma/tmp/mysql.log' mysql> mysql> show databases; +----------+ | Database | +----------+ | horde | | mysql | | test | +----------+ 3 rows in set (0.00 sec) mysql> use test; Database changed mysql> mysql> show tables; Empty set (0.00 sec) mysql> select user(); +-------------------+ | user() | +-------------------+ | nieusma@localhost | +-------------------+ 1 row in set (0.00 sec) mysql> show tables; Empty set (0.00 sec) mysql> quit Logging to file '/home/nieusma/public_html/docs/database/mysql.txt' mysql> mysql> show tables; ERROR 1046: No Database Selected mysql> show databases; +----------+ | Database | +----------+ | horde | | mysql | | test | +----------+ 3 rows in set (0.00 sec) mysql> mysql> mysql> use mysql; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> show tables -> ; +-----------------+ | Tables_in_mysql | +-----------------+ | columns_priv | | db | | func | | host | | tables_priv | | user | +-----------------+ 6 rows in set (0.01 sec) mysql> describe host -> ; +-----------------+-----------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-----------------+-----------------+------+-----+---------+-------+ | Host | char(60) binary | | PRI | | | | Db | char(64) binary | | PRI | | | | Select_priv | enum('N','Y') | | | N | | | Insert_priv | enum('N','Y') | | | N | | | Update_priv | enum('N','Y') | | | N | | | Delete_priv | enum('N','Y') | | | N | | | Create_priv | enum('N','Y') | | | N | | | Drop_priv | enum('N','Y') | | | N | | | Grant_priv | enum('N','Y') | | | N | | | References_priv | enum('N','Y') | | | N | | | Index_priv | enum('N','Y') | | | N | | | Alter_priv | enum('N','Y') | | | N | | +-----------------+-----------------+------+-----+---------+-------+ 12 rows in set (0.00 sec) mysql> select * from host; Empty set (0.00 sec) mysql> show tables; +-----------------+ | Tables_in_mysql | +-----------------+ | columns_priv | | db | | func | | host | | tables_priv | | user | +-----------------+ 6 rows in set (0.00 sec) mysql> describe user; +-----------------+-----------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-----------------+-----------------+------+-----+---------+-------+ | Host | char(60) binary | | PRI | | | | User | char(16) binary | | PRI | | | | Password | char(16) binary | | | | | | Select_priv | enum('N','Y') | | | N | | | Insert_priv | enum('N','Y') | | | N | | | Update_priv | enum('N','Y') | | | N | | | Delete_priv | enum('N','Y') | | | N | | | Create_priv | enum('N','Y') | | | N | | | Drop_priv | enum('N','Y') | | | N | | | Reload_priv | enum('N','Y') | | | N | | | Shutdown_priv | enum('N','Y') | | | N | | | Process_priv | enum('N','Y') | | | N | | | File_priv | enum('N','Y') | | | N | | | Grant_priv | enum('N','Y') | | | N | | | References_priv | enum('N','Y') | | | N | | | Index_priv | enum('N','Y') | | | N | | | Alter_priv | enum('N','Y') | | | N | | +-----------------+-----------------+------+-----+---------+-------+ 17 rows in set (0.00 sec) mysql> select * from user; +-----------+-------+------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+ | Host | User | Password | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Reload_priv | Shutdown_priv | Process_priv | File_priv | Grant_priv | References_priv | Index_priv | Alter_priv | +-----------+-------+------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+ | localhost | root | 3655fa0b4c044b59 | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | | localhost | horde | 709935e853abb486 | N | N | N | N | N | N | N | N | N | N | N | N | N | N | | % | horde | | N | N | N | N | N | N | N | N | N | N | N | N | N | N | +-----------+-------+------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+ 3 rows in set (0.00 sec) mysql> insert into user values ('localhost', 'filter', password('e-mail')); ERROR 1136: Column count doesn't match value count at row 1 mysql> insert into user values ('localhost', 'filter', password('e-mail'),n,n,n,n,n,n,n,n,n,n,n,n,n,n); ERROR 1054: Unknown column 'n' in 'field list' mysql> insert into user values ('localhost', 'filter', password('e-mail'),'n','n','n','n','n','n','n','n','n','n','n','n','n','n'); Query OK, 1 row affected (0.00 sec) mysql> select * from user; +-----------+--------+------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+ | Host | User | Password | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Reload_priv | Shutdown_priv | Process_priv | File_priv | Grant_priv | References_priv | Index_priv | Alter_priv | +-----------+--------+------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+ | localhost | root | 3655fa0b4c044b59 | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | | localhost | filter | 3afc49771a3583df | N | N | N | N | N | N | N | N | N | N | N | N | N | N | | localhost | horde | 709935e853abb486 | N | N | N | N | N | N | N | N | N | N | N | N | N | N | | % | horde | | N | N | N | N | N | N | N | N | N | N | N | N | N | N | +-----------+--------+------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+ 4 rows in set (0.01 sec) mysql> help MySQL commands: Note that all text commands must be first on line and end with ';' help (\h) Display this help. ? (\?) Synonym for `help'. clear (\c) Clear command. connect (\r) Reconnect to the server. Optional arguments are db and host. edit (\e) Edit command with $EDITOR. ego (\G) Send command to mysql server, display result vertically. exit (\q) Exit mysql. Same as quit. go (\g) Send command to mysql server. nopager (\n) Disable pager, print to stdout. notee (\t) Don't write into outfile. pager (\P) Set PAGER [to_pager]. Print the query results via PAGER. print (\p) Print current command. quit (\q) Quit mysql. rehash (\#) Rebuild completion hash. source (\.) Execute a SQL script file. Takes a file name as an argument. status (\s) Get status information from the server. tee (\T) Set outfile [to_outfile]. Append everything into given outfile. use (\u) Use another database. Takes database name as argument. Connection id: 4 (Can be used with mysqladmin kill) mysql> q -> \c mysql> quit