| |
| |
Getting Started with MySQL |
 |
| |
Logging
into MySQL:
C
:\mysql\bin> mysql -h host
-u user -p dbname
Enter password: *********** |
| |
Changing
Databases:
mysql> use dbname;
Getting database Information
Listing all databases:
C
:\mysql\bin> mysqlshow
-u
user -p
or
mysql> show databases;
Listing
all tables for a database:
C
:\mysql\bin> mysqlshow -u
user -p dbname
or
mysql> use dbname;
mysql>
show tables;
Getting table information:
C
:\mysql\bin> mysqlshow -u
user -p dbname
tablename
or
mysql> use dbname;
mysql>
explain tablename;
or mysql>
describe tablename;
or mysql> show columns from tablename;
Display MySQL version:
C
:\mysql\bin> mysqladmin -u
user -p version
status proc
or
mysql> SELECT VERSION();
|
| |
|