Tag Info

New answers tagged

0

If you want the binlog file and position, just include --master-data. According to the MySQL Documentation on mysqldump's --master-data option Use this option to dump a master replication server to produce a dump file that can be used to set up another server as a slave of the master. It causes the dump output to include a CHANGE MASTER TO ...


0

To dump a database mysqldump -u root -p databasename > databasename.sql Dumping particular table alone then this would apply mysqldump -u... -p... mydb t1 t2 t3 > mydb_tables.sql


1

The reason for the definer clause is that view can act as protective layers above the tables. For example, instead of limiting users to be able to read specific columns from a table with otherwise sensitive data, one can create a view which only presents allows columns, and let users select from that view. Sometimes you may allow users to read a view even ...


0

What was useful for me was something like: mysqldump -u db_user -p db_name table_name --no_create_info \ --lock-all-tables --where 'id in (SELECT tn.id FROM table_name AS tn \ JOIN related_table AS rt ON tn.related_table_id = rt.id \ WHERE rt.some_field = 1)' > data.sql From http://krosinski.blogspot.com/2012/12/using-table-join-with-mysqldump.html


0

The easiest way could be: Export your MySql database as a csv file with the name of the columns as headers. Create an empty database in SQL (I did it on SQL Server 2012) Import the csv file into the empty database. You might need an ODBC component depending on which version of SQL and Framework you are working on (Microsoft.ACE.OLEDB.12.0). I noticed The ...


0

Usually you run mysqldump to create a database copy and backups as follows: $ mysqldump -u user -p db-name > db-name.out Copy db-name.out file using sftp/ssh to remote MySQL server: $ scp db-name.out user@remote.box.com:/backup Restore database at remote server (login over ssh): $ mysql -u user -p db-name < db-name.out OR $ mysql -u user -p ...


1

The --single-transaction option of mysqldump does do a FLUSH TABLES WITH READ LOCK prior to starting the backup job but only under certain conditions. One of those conditions is when you also specify the --master-data option. In the source code, from mysql-5.6.19/client/mysqldump.c at line 5797: if ((opt_lock_all_tables || opt_master_data || ...


1

Set lower_case_table_names=1 on the Linux server before importing, this will convert all databases to lower case and new queries will use lower case, too. You can see it here. Your problem arises from the fact that the default value on Mac is 2 (names are not case sensitive when queried, but they are when stored) but 0 on Unix/Linux (names are always case ...



Top 50 recent answers are included