mysql> CREATE USER 'ubuntu'@'localhost' IDENTIFIED BY 'password'
mysql>CREATE DATABASE 'wordpress-db';
mysql> GRANT ALL PRIVILEGES ON 'wordpress-db'.* TO "ubuntu"@"localhost";
mysql>FLUSH PRIVILEGES;
mysql> CREATE USER 'ubuntu'@'localhost' IDENTIFIED BY 'password'
mysql>CREATE DATABASE 'wordpress-db';
mysql> GRANT ALL PRIVILEGES ON 'wordpress-db'.* TO "ubuntu"@"localhost";
mysql>FLUSH PRIVILEGES;
mysql> SELECT table_name AS "tabla", ROUND(((data_length + index_length) / 1024 / 1024), 2) AS "Tamaño (MB)" FROM information_schema.TABLES WHERE table_schema = "ebdb" ORDER BY (data_length + index_length) DESC; +--------------------------+--------------+ | tabla | Tamaño (MB) | +--------------------------+--------------+ | wp_postmeta | 2172.67 | | wp_options | 990.19 | | wp_posts | 573.66 | | wp_cf_form_entry_values | 124.20 | | wp_redirection_404 | 48.69 | | wp_cf_form_entries | 18.58 | | wp_ine_activity_log | 13.52 | | wp_redirection_logs | 3.33 | | wp_usermeta | 0.55 | | wp_term_relationships | 0.22 | | wp_redirection_items | 0.09 | | wp_terms | 0.09 | | wp_term_taxonomy | 0.09 | | wp_comments | 0.09 | | wp_users | 0.06 | | wp_cf_tracking_meta | 0.05 | | wp_redirection_groups | 0.05 | | wp_cf_form_entry_meta | 0.05 | | wp_termmeta | 0.05 | | wp_commentmeta | 0.05 | | wp_download_log | 0.03 | | wp_dlm_order_transaction | 0.03 | | wp_dlm_order_item | 0.03 | | wp_links | 0.03 | | wp_dlm_order_customer | 0.03 | | wp_cf_tracking | 0.02 | | wp_ine_activity_conf_log | 0.02 | | wp_dlm_session | 0.02 | | wp_dlm_order | 0.02 | | wp_responsive_menu | 0.02 | +--------------------------+--------------+ 30 rows in set (0.00 sec)
mysql> SELECT table_name as tablas, table_rows as registros FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'ebdb'; +--------------------------+-----------+ | tablas | registros | +--------------------------+-----------+ | wp_cf_form_entries | 133859 | | wp_cf_form_entry_meta | 0 | | wp_cf_form_entry_values | 801966 | | wp_cf_tracking | 0 | | wp_cf_tracking_meta | 0 | | wp_commentmeta | 0 | | wp_comments | 0 | | wp_dlm_order | 0 | | wp_dlm_order_customer | 0 | | wp_dlm_order_item | 0 | | wp_dlm_order_transaction | 0 | | wp_dlm_session | 0 | | wp_download_log | 27 | | wp_ine_activity_conf_log | 0 | | wp_ine_activity_log | 103685 | | wp_links | 0 | | wp_options | 110724 | | wp_postmeta | 280516 | | wp_posts | 59708 | | wp_redirection_404 | 114932 | | wp_redirection_groups | 2 | | wp_redirection_items | 68 | | wp_redirection_logs | 6851 | | wp_responsive_menu | 279 | | wp_term_relationships | 2271 | | wp_term_taxonomy | 396 | | wp_termmeta | 38 | | wp_terms | 396 | | wp_usermeta | 2701 | | wp_users | 71 | +--------------------------+-----------+ 30 rows in set (0.00 sec)
mysql> SELECT table_schema AS "ebdb", ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS "Tamaño (MB)" FROM information_schema.TABLES GROUP BY table_schema; +--------------------+--------------+ | ebdb | Tamaño (MB) | +--------------------+--------------+ | curso1 | 4.05 | | ebdb | 3946.50 | | farodb | 640.95 | | gym | 0.70 | | information_schema | 0.16 | | live | 8.88 | | musica | 712.17 | | mysql | 3.94 | | netfam | 0.55 | | performance_schema | 0.00 | | PFE | 57.86 | | plugins | 0.67 | | quirospacio | 4.25 | | sici1 | 17.09 | | sici2 | 16.61 | | sys | 0.02 | +--------------------+--------------+ 16 rows in set (2.17 sec)
mysqldump -u root -p nombre_base_de_datos > fichero.sql
mysql -u root -p nombre_base_de_datos < fichero.sql
mysqldump -u root -p --all-databases > fichero.sql
mysqldump -u root -p --databases base_datos1 base_datos2 > fichero.sql
mysqldump -u root -p base_datos tabla > fichero.sql
mysqldump --help
hnoguera@cliente:~$ mysql -h 10.0.0.143 -u cliente -p
Enter password:
ERROR 1130 (HY000): Host '10.0.0.15' is not allowed to connect to this MySQL server
hnoguera@cliente:~$ mysql -h localhost -u root -p
Enter password:
mysql> GRANT SELECT, INSERT ON bdd.* TO 'nuevo_usuario'@'10.0.0.15' IDENTIFIED BY 'pass' ;
Query OK, 0 rows affected (0.00 sec)
bind-address = 127.0.0.1
bind-address = 0.0.0.0
root@LAMP-squeeze:~# /etc/init.d/mysql restart
Stopping MySQL database server: mysqld.
Starting MySQL database server: mysqld.
hnoguera@cliente:~# mysql -h 10.0.0.143 -u nuevo_usuario -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 36
Server version: 5.1.49-3 (Debian)
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
sudo dpkg -i archivo.deb
sudo apt-get install libzip1 python-paramiko python-pysqlite2 libctemplate0 libgtkmm-2.4-1c2a libmysqlclient16
sudo dpkg -i mysql-workbench-gpl-5.2.38-1ubu1104-i386.deb