MySQL Notes
From Brandonhutchinson.com
(Difference between revisions)
(New page: * To securely provide a user password non-interactively, place user passwords within the ''[client]'' section of ''~/.my.cnf''. e.g., [client] password="''password''" [http://dev.mysql.c...) |
|||
| (3 intermediate revisions not shown.) | |||
| Line 1: | Line 1: | ||
| - | * To securely provide a user password | + | * To list the databases on a MySQL server: |
| + | show databases; | ||
| + | |||
| + | * To select a database on a MySQL server: | ||
| + | use ''database''; | ||
| + | |||
| + | * To list the tables in a MySQL database: | ||
| + | show tables; | ||
| + | |||
| + | * To list the schema of a table in a MySQL database: | ||
| + | desc ''table''; | ||
| + | |||
| + | * To securely provide a user password automatically, place user passwords within the ''[client]'' section of ''~/.my.cnf''. The file should have 600 or 400 permissions. e.g., | ||
[client] | [client] | ||
password="''password''" | password="''password''" | ||
[http://dev.mysql.com/doc/refman/5.1/en/password-security.html 5.5.6. Keeping Your Password Secure] | [http://dev.mysql.com/doc/refman/5.1/en/password-security.html 5.5.6. Keeping Your Password Secure] | ||
Current revision
- To list the databases on a MySQL server:
show databases;
- To select a database on a MySQL server:
use database;
- To list the tables in a MySQL database:
show tables;
- To list the schema of a table in a MySQL database:
desc table;
- To securely provide a user password automatically, place user passwords within the [client] section of ~/.my.cnf. The file should have 600 or 400 permissions. e.g.,
[client] password="password"
