Ecco alcuni appunti sintetici per l'uso di MySQL da linea di comando.
Opzioni utili possono essere:
--single-transaction One single transaction
-d|--no-data No row information.
-l|--lock-tables Lock all tables for read.
http://dev.mysql.com
Connettersi
mysql -h host -u user -p
Caricare un file sql
mysql -h localhost -u root -p DbName < textfile.sql
Esportare un database (MySQLdump)
mysqldump -h localhost -u root -p DbName > textfile.sql
Opzioni utili possono essere:
--single-transaction One single transaction
-d|--no-data No row information.
-l|--lock-tables Lock all tables for read.
Permessi
GRANT ALL PRIVILEGES ON *.* TO 'utente'@'localhost' IDENTIFIED BY 'pass' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'utente'@'%' IDENTIFIED BY 'pass' WITH GRANT OPTION;
GRANT RELOAD,PROCESS ON *.* TO 'admin'@'localhost';
GRANT USAGE ON *.* TO 'utente'@'localhost';
link utili:
http://www.hmug.org/man/1/mysqldump.phphttp://dev.mysql.com
Commenti