lftp: show hidden directories and files
Some ftp servers do not display by default hidden directories and files therefore lftp does not take care about them in certain operations, for example when trying to delete a directory that contains hidden files lftp throws the following error message: operation failed: 550 cannot delete directory: directory not empty (rm: Access failed: 550 Can't remove directory) To change this behavior.
Show MySQL storage engines
To see the available/enabled MySQL storage engines first you must connect to your mysql server
$ mysql - u root - p - h SERVER
Then run
Character set available in MySQL
MySQL offers several types of charset (CHARACTER_SET), thereby satisfying the most varied projects.
See character set supported by the MySQL Server
> SHOW CHARACTER SET; +----------+-----------------------------+--------------------- | Charset | Description | Default collation +----------+-----------------------------+-------------------- | big5 | Big5 Traditional Chinese | big5_chinese_ci | dec8 | DEC West European | dec8_swedish_ci | cp850 | DOS West European | cp850_general_ci | hp8 | HP West European | hp8_english_ci | koi8r | KOI8-R Relcom Russian | koi8r_general_ci | latin1 | cp1252 West European | latin1_swedish_ci | latin2 | ISO 8859-2 Central European | latin2_general_ci | swe7 | 7bit Swedish | swe7_swedish_ci | ascii | US ASCII | ascii_general_ci ....
See available COLLATION for a CHARACTER SET
> SELECT COLLATION_NAME FROM INFORMATION_SCHEMA.COLLATIONS WHERE CHARACTER_SET_NAME = 'utf8'; +--------------------+ | COLLATION_NAME | +--------------------+ | utf8_general_ci | | utf8_bin | | utf8_unicode_ci | | utf8_icelandic_ci | | utf8_latvian_ci | | utf8_romanian_ci | | utf8_slovenian_ci | ...
See COLLATION, CHARACTER_SET for the columns in a particular table
Here we take as an example the BD: Sakila
> SELECT COLUMN_NAME,COLLATION_NAME, CHARACTER_SET_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'actor' AND TABLE_SCHEMA = 'sakila'; +-------------+-----------------+--------------------+ | COLUMN_NAME | COLLATION_NAME | CHARACTER_SET_NAME | +-------------+-----------------+--------------------+ | actor_id | NULL | NULL | | first_name | utf8_general_ci | utf8 | | last_name | utf8_general_ci | utf8 | | last_update | NULL | NULL | +-------------+-----------------+--------------------+
Recommended reading
– F. van der lan, Rick. SQL for MySQL Developers, Part III, Chapter 22.
Connect to a MySQL server from the LAN
MySQL has a refined security scheme, see MySQL: administration of users, but some time is necessary to allow a user to connect to our MySQL server from any computer on the Local Area Network, let's have a development server: devsrv and can make ssh:
MySQL user administration
MySQL has a flexible and refined security scheme based on access control list. A user in MySQL is identified by the login and ID of the client computer (IP, name), this is based on the principle that the user Pepe that connects from the office does not have to be the same Pepe that connects from the House. MySQL uses tables user, db, host, tables_priv, columns_priv, and procs_priv from mysql database to manage every user privileges allowing to define different level access: database, tables, columns, and operations (select, insert, delete, update, grant). In this guide we will show how create and delete users, establish and revoke permissions.
MySQL server administration – Basic
MySQL is a relational database server with a great reputation for being fast, consume few resources and adapt very well to the demands of the web. In this article we will show how to connect, from the command line, to a MySQL server, as well as create, list, select and delete a database as well as show information about tables and storage engines
Connect to the mysql server
mysql [-h mysql-server] -u user-name -p[password] [BD]
We encourage using the option -p instead of -ppassword, because the latter is less secure (password is saved in the history)
The default mysql server is localhost
Create database
create schema DB;
Create a database specifying charset and collation
create database DB default character set = UTF8 default collate =utf8_general_ci;
schema is an alias for database command and can be used both interchangeably
See the charset and available collations
show collation;
Or by specifying a specific charset
show collation like 'utf8%';
Delete database
drop schema BD;
List databases
show schemas;
Select a database
use DB;
List tables
show tables;
Show the info for a table
desc table-name;
Show description of a column
show columns from table-name where Field='column-name'
Show the indexes for a table
show index from table-name;
List storage engines
show engines;
Recommended reading
-man mysql
Rename in mass
prename is a utility developed in Perl by Larry Wall (creator of the Perl language) and improved by Robin Barker, which allows you to rename in masses. prename finds all files whose name matches a pattern specified (REGEXP). This utility is part of the perl package in Debian GNU/Linux.