Re: How do I mysqldump different database tables to the same .sql file?

2013-11-21 Thread Michael Dykman
There is a good reason that the USE database is not output in those dumps..
 it would make the tool very difficult to use for moving data around.

If I might suggest, a simple workaround is to create a shell script along
these lines..  you might to do something a little more sophisticated.

#
#!/bin/sh

echo  USE `database1`;  outflfile.sql
mysqldump -(firstsetofoptions)  outfile.sql
echo  USE `database2`;  outflfile.sql
mysqldump -(secondsetofoptions)  outfile.sql




On Thu, Nov 21, 2013 at 4:44 PM, Daevid Vincent dae...@daevid.com wrote:

 I'm working on some code where I am trying to merge two customer accounts
 (we get people signing up under different usernames, emails, or just create
 a new account sometimes). I want to test it, and so I need a way to restore
 the data in the particular tables. Taking a dump of all the DBs and tables
 is not feasible as it's massive, and importing (with indexes) takes HOURS.
 I
 just want only the tables that are relevant. I can find all the tables that
 have `customer_id` in them with this magic incantation:

 SELECT `TABLE_NAME`,`TABLE_SCHEMA` FROM `information_schema`.`COLUMNS`
 WHERE
 `COLUMN_NAME` = 'customer_id' ORDER BY `TABLE_SCHEMA`, `TABLE_NAME`

 Then I crafted this, but it pukes on the db name portion. :-(

 mysqldump -uroot -proot --skip-opt --add-drop-table --extended-insert
 --complete-insert --insert-ignore --create-options --quick --force
 --set-charset --disable-keys --quote-names --comments --verbose --tables
 member_sessions.users_last_login support.tickets mydb1.clear_passwords
 mydb1.crak_subscriptions mydb1.customers mydb1.customers_free
 mydb1.customers_free_tracking mydb1.customers_log
 mydb1.customers_subscriptions mydb1.customers_transactions mydb1.players
 mydb1content.actors_comments mydb1content.actor_collections
 mydb1content.actor_likes_users mydb1content.collections
 mydb1content.dvd_likes_users mydb1content.free_videos
 mydb1content.genre_collections mydb1content.playlists
 mydb1content.poll_votes mydb1content.scenes_comments
 mydb1content.scenes_ratings_users_new2 mydb1content.scene_collections
 mydb1content.scene_likes_users mydb1content.videos_downloaded
 mydb1content.videos_viewed  merge_backup.sql

 -- Connecting to localhost...
 mysqldump: Got error: 1049: Unknown database
 'member_sessions.users_last_login' when selecting the database
 -- Disconnecting from localhost...

 I searched a bit and found that it seems I have to split this into multiple
 statements and append like I'm back in 1980. *sigh*

 mysqldump -uroot -proot --skip-opt --add-drop-table --extended-insert
 --complete-insert --insert-ignore --create-options --quick --force
 --set-charset --disable-keys --quote-names --comments --verbose --database
 member_sessions --tables users_last_login  merge_backup.sql
 mysqldump -uroot -proot --skip-opt --add-drop-table --extended-insert
 --complete-insert --insert-ignore --create-options --quick --force
 --set-charset --disable-keys --quote-names --comments --verbose --database
 support --tables tickets  merge_backup.sql
 mysqldump -uroot -proot --skip-opt --add-drop-table --extended-insert
 --complete-insert --insert-ignore --create-options --quick --force
 --set-charset --disable-keys --quote-names --comments --verbose --database
 mydb1 --tables clear_passwords customers customers_free
 customers_free_tracking customers_log customers_subscriptions
 customers_transactions players  merge_backup.sql
 mysqldump -uroot -proot --skip-opt --add-drop-table --extended-insert
 --complete-insert --insert-ignore --create-options --quick --force
 --set-charset --disable-keys --quote-names --comments --verbose --database
 content --tables actors_comments actor_collections actor_likes_users
 collections dvd_likes_users free_videos genre_collections playlists
 poll_votes scenes_comments scenes_ratings_users_new2 scene_collections
 scene_likes_users videos_downloaded videos_viewed  merge_backup.sql

 The critical flaw here is that the mysqldump program does NOT put the
 necessary USE DATABASE statement in each of these dumps since there is
 only one DB after the -database apparently. UGH. Nor do I see a command
 line
 option to force it to output this seemingly obvious statement.

 It's a pretty significant shortcoming of mysqldump if you ask me that I
 can't do it the way I had it in the first example since that's pretty much
 standard SQL convetion of db.table.column format. And even more baffling is
 why it wouldn't dump out the USE statement always even if there is only
 one DB. It's a few characters and would save a lot of headaches in case
 someone tried to dump their .sql file into the wrong DB on accident.

 Plus it's not easy to edit a 2.6GB file to manually insert these USE
 lines.

 Is there a way to do this with some command line option I'm not seeing in
 the man page?




-- 
 - michael dykman
 - mdyk...@gmail.com

 May the Source be with you.


RE: How do I mysqldump different database tables to the same .sql file?

2013-11-21 Thread Daevid Vincent
Except that it outputs the USE statement if you have more than one
database, so your theory doesn't hold a lot of water IMHO. Not to mention
it's near the very top of the output so it's pretty easy to trim it off if
you REALLY needed to move the DB (which I presume is not as frequently as
simply wanting a backup/dump of a database to restore).

Thanks for the shell script suggestion, that is what I've done already to
work around this silliness.

 -Original Message-
 From: Michael Dykman [mailto:mdyk...@gmail.com]
 Sent: Thursday, November 21, 2013 1:59 PM
 To: MySql
 Subject: Re: How do I mysqldump different database tables to the same .sql
 file?
 
 There is a good reason that the USE database is not output in those
dumps..
  it would make the tool very difficult to use for moving data around.
 
 If I might suggest, a simple workaround is to create a shell script along
 these lines..  you might to do something a little more sophisticated.
 
 #
 #!/bin/sh
 
 echo  USE `database1`;  outflfile.sql
 mysqldump -(firstsetofoptions)  outfile.sql
 echo  USE `database2`;  outflfile.sql
 mysqldump -(secondsetofoptions)  outfile.sql
 
 
 
 
 On Thu, Nov 21, 2013 at 4:44 PM, Daevid Vincent dae...@daevid.com wrote:
 
  I'm working on some code where I am trying to merge two customer
accounts
  (we get people signing up under different usernames, emails, or just
 create
  a new account sometimes). I want to test it, and so I need a way to
 restore
  the data in the particular tables. Taking a dump of all the DBs and
tables
  is not feasible as it's massive, and importing (with indexes) takes
HOURS.
  I
  just want only the tables that are relevant. I can find all the tables
 that
  have `customer_id` in them with this magic incantation:
 
  SELECT `TABLE_NAME`,`TABLE_SCHEMA` FROM `information_schema`.`COLUMNS`
  WHERE
  `COLUMN_NAME` = 'customer_id' ORDER BY `TABLE_SCHEMA`, `TABLE_NAME`
 
  Then I crafted this, but it pukes on the db name portion. :-(
 
  mysqldump -uroot -proot --skip-opt --add-drop-table --extended-insert
  --complete-insert --insert-ignore --create-options --quick --force
  --set-charset --disable-keys --quote-names --comments --verbose --tables
  member_sessions.users_last_login support.tickets mydb1.clear_passwords
  mydb1.crak_subscriptions mydb1.customers mydb1.customers_free
  mydb1.customers_free_tracking mydb1.customers_log
  mydb1.customers_subscriptions mydb1.customers_transactions mydb1.players
  mydb1content.actors_comments mydb1content.actor_collections
  mydb1content.actor_likes_users mydb1content.collections
  mydb1content.dvd_likes_users mydb1content.free_videos
  mydb1content.genre_collections mydb1content.playlists
  mydb1content.poll_votes mydb1content.scenes_comments
  mydb1content.scenes_ratings_users_new2 mydb1content.scene_collections
  mydb1content.scene_likes_users mydb1content.videos_downloaded
  mydb1content.videos_viewed  merge_backup.sql
 
  -- Connecting to localhost...
  mysqldump: Got error: 1049: Unknown database
  'member_sessions.users_last_login' when selecting the database
  -- Disconnecting from localhost...
 
  I searched a bit and found that it seems I have to split this into
 multiple
  statements and append like I'm back in 1980. *sigh*
 
  mysqldump -uroot -proot --skip-opt --add-drop-table --extended-insert
  --complete-insert --insert-ignore --create-options --quick --force
  --set-charset --disable-keys --quote-names --comments --verbose
--database
  member_sessions --tables users_last_login  merge_backup.sql
  mysqldump -uroot -proot --skip-opt --add-drop-table --extended-insert
  --complete-insert --insert-ignore --create-options --quick --force
  --set-charset --disable-keys --quote-names --comments --verbose
--database
  support --tables tickets  merge_backup.sql
  mysqldump -uroot -proot --skip-opt --add-drop-table --extended-insert
  --complete-insert --insert-ignore --create-options --quick --force
  --set-charset --disable-keys --quote-names --comments --verbose
--database
  mydb1 --tables clear_passwords customers customers_free
  customers_free_tracking customers_log customers_subscriptions
  customers_transactions players  merge_backup.sql
  mysqldump -uroot -proot --skip-opt --add-drop-table --extended-insert
  --complete-insert --insert-ignore --create-options --quick --force
  --set-charset --disable-keys --quote-names --comments --verbose
--database
  content --tables actors_comments actor_collections actor_likes_users
  collections dvd_likes_users free_videos genre_collections playlists
  poll_votes scenes_comments scenes_ratings_users_new2 scene_collections
  scene_likes_users videos_downloaded videos_viewed  merge_backup.sql
 
  The critical flaw here is that the mysqldump program does NOT put the
  necessary USE DATABASE statement in each of these dumps since there is
  only one DB after the -database apparently. UGH. Nor do I see a command
  line
  option to force it to output this seemingly 

InnoDB error 5

2013-11-21 Thread Paul Halliday
Had a system crash this morning and I can't seem to get mysql back up
and running. This is the error:

InnoDB: Progress in percent: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
87 88 89 90 91 92 93 94 95 96 97 98 99 2013-11-21 08:47:26 1570
[ERROR] InnoDB: Tried to read 16384 bytes at offset 589824. Was only
able to read -1.
2013-11-21 08:47:26 802808c00  InnoDB: Operating system error number 5
in a file operation.
InnoDB: Error number 5 means 'Input/output error'.
InnoDB: Some operating system error numbers are described at
InnoDB: http://dev.mysql.com/doc/refman/5.6/en/operating-system-error-codes.html
2013-11-21 08:47:26 802808c00  InnoDB: File operation call: 'read'
returned OS error 105.
2013-11-21 08:47:26 802808c00  InnoDB: Cannot continue operation.

I followed that link but it doesn't tell me anything outside of what
is above. Can I fix this?

Thanks.

-- 
Paul Halliday
http://www.pintumbler.org/

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: InnoDB error 5

2013-11-21 Thread Manuel Arostegui
2013/11/21 Reindl Harald h.rei...@thelounge.net


 Am 21.11.2013 13:51, schrieb Paul Halliday:
  Had a system crash this morning and I can't seem to get mysql back up
  and running. This is the error:
 
  InnoDB: Progress in percent: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
  18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
  41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
  64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
  87 88 89 90 91 92 93 94 95 96 97 98 99 2013-11-21 08:47:26 1570
  [ERROR] InnoDB: Tried to read 16384 bytes at offset 589824. Was only
  able to read -1.
  2013-11-21 08:47:26 802808c00  InnoDB: Operating system error number 5
  in a file operation.
  InnoDB: Error number 5 means 'Input/output error'.
  InnoDB: Some operating system error numbers are described at
  InnoDB:
 http://dev.mysql.com/doc/refman/5.6/en/operating-system-error-codes.html
  2013-11-21 08:47:26 802808c00  InnoDB: File operation call: 'read'
  returned OS error 105.
  2013-11-21 08:47:26 802808c00  InnoDB: Cannot continue operation.
 
  I followed that link but it doesn't tell me anything outside of what
  is above. Can I fix this?

 i would look in the *system logs* because this pretty sure comes
 from the underlying operating system and is *not* mysql specific
 which is also in the message statet with returned OS error 105


 http://lxr.free-electrons.com/source/include/uapi/asm-generic/errno-base.h#L8


Looks like a broken disk or FS corruption :-(

Good luck!
Manuel.


Re: Nested WHERE

2013-11-21 Thread Jopoy Solano
Awesome! Thank you very much Claudio!  :)


On Thu, Nov 21, 2013 at 10:40 AM, Claudio Nanni claudio.na...@gmail.comwrote:

 Hi Jopoy,

 Try this:

 SELECT username,sum(acctoutputoctets) AS total_usage FROM radacct WHERE
 EXTRACT(YEAR_MONTH FROM acctstarttime) = EXTRACT(YEAR_MONTH FROM
 CURRENT_DATE)and EXTRACT(YEAR_MONTH FROM acctstarttime) 
 EXTRACT(YEAR_MONTH FROM CURRENT_DATE + INTERVAL 1 MONTH) GROUP BY username
 HAVING  total_usage  322100
 ORDER BY total_usage DESC;


 On values derived from group functions you have to use HAVING instead of
 WHERE,
 WHERE filters the records before the grouping, HAVING once grouping is
 done.

 Cheers

 Claudio


 2013/11/21 Jopoy Solano m...@jopoy.com

 Hi! I'm not sure how to phrase this question... anyway, here it is:

 I'm trying to show users in DB radius who have exceeded 322100 bytes
 (3GB) within the current month. As of writing I can only display total
 usage by user with this:

 SELECT username,sum(acctoutputoctets) AS total_usage FROM radacct WHERE
 EXTRACT(YEAR_MONTH FROM acctstarttime) = EXTRACT(YEAR_MONTH FROM
 CURRENT_DATE)and EXTRACT(YEAR_MONTH FROM acctstarttime) 
 EXTRACT(YEAR_MONTH FROM CURRENT_DATE + INTERVAL 1 MONTH) GROUP BY username
 ORDER BY total_usage DESC;

 I wanted to add something like a WHERE total_usage  322100 line but
 I don't know where to insert it. Any help would be greatly appreciated.

 Jopoy




 --
 Claudio



Re: InnoDB error 5

2013-11-21 Thread Paul Halliday
It was indeed corruption :/ what a day. I was able to move everything
over to another partition and have managed to get mysql up and running
again.  There was a single file I could not, an .idb (the ,.frm is
there). Is it possible to fix this from ibdata or the logs?

Thanks.

On Thu, Nov 21, 2013 at 9:46 AM, Manuel Arostegui man...@tuenti.com wrote:
 2013/11/21 Reindl Harald h.rei...@thelounge.net


 Am 21.11.2013 13:51, schrieb Paul Halliday:
  Had a system crash this morning and I can't seem to get mysql back up
  and running. This is the error:
 
  InnoDB: Progress in percent: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
  18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
  41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
  64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
  87 88 89 90 91 92 93 94 95 96 97 98 99 2013-11-21 08:47:26 1570
  [ERROR] InnoDB: Tried to read 16384 bytes at offset 589824. Was only
  able to read -1.
  2013-11-21 08:47:26 802808c00  InnoDB: Operating system error number 5
  in a file operation.
  InnoDB: Error number 5 means 'Input/output error'.
  InnoDB: Some operating system error numbers are described at
  InnoDB:
 http://dev.mysql.com/doc/refman/5.6/en/operating-system-error-codes.html
  2013-11-21 08:47:26 802808c00  InnoDB: File operation call: 'read'
  returned OS error 105.
  2013-11-21 08:47:26 802808c00  InnoDB: Cannot continue operation.
 
  I followed that link but it doesn't tell me anything outside of what
  is above. Can I fix this?

 i would look in the *system logs* because this pretty sure comes
 from the underlying operating system and is *not* mysql specific
 which is also in the message statet with returned OS error 105


 http://lxr.free-electrons.com/source/include/uapi/asm-generic/errno-base.h#L8


 Looks like a broken disk or FS corruption :-(

 Good luck!
 Manuel.



-- 
Paul Halliday
http://www.pintumbler.org/

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: Nested WHERE

2013-11-21 Thread Claudio Nanni
Hi Jopoy,

Try this:

SELECT username,sum(acctoutputoctets) AS total_usage FROM radacct WHERE
EXTRACT(YEAR_MONTH FROM acctstarttime) = EXTRACT(YEAR_MONTH FROM
CURRENT_DATE)and EXTRACT(YEAR_MONTH FROM acctstarttime) 
EXTRACT(YEAR_MONTH FROM CURRENT_DATE + INTERVAL 1 MONTH) GROUP BY username
HAVING  total_usage  322100
ORDER BY total_usage DESC;


On values derived from group functions you have to use HAVING instead of
WHERE,
WHERE filters the records before the grouping, HAVING once grouping is done.

Cheers

Claudio


2013/11/21 Jopoy Solano m...@jopoy.com

 Hi! I'm not sure how to phrase this question... anyway, here it is:

 I'm trying to show users in DB radius who have exceeded 322100 bytes
 (3GB) within the current month. As of writing I can only display total
 usage by user with this:

 SELECT username,sum(acctoutputoctets) AS total_usage FROM radacct WHERE
 EXTRACT(YEAR_MONTH FROM acctstarttime) = EXTRACT(YEAR_MONTH FROM
 CURRENT_DATE)and EXTRACT(YEAR_MONTH FROM acctstarttime) 
 EXTRACT(YEAR_MONTH FROM CURRENT_DATE + INTERVAL 1 MONTH) GROUP BY username
 ORDER BY total_usage DESC;

 I wanted to add something like a WHERE total_usage  322100 line but
 I don't know where to insert it. Any help would be greatly appreciated.

 Jopoy




-- 
Claudio


Nested WHERE

2013-11-21 Thread Jopoy Solano
Hi! I'm not sure how to phrase this question... anyway, here it is:

I'm trying to show users in DB radius who have exceeded 322100 bytes
(3GB) within the current month. As of writing I can only display total
usage by user with this:

SELECT username,sum(acctoutputoctets) AS total_usage FROM radacct WHERE
EXTRACT(YEAR_MONTH FROM acctstarttime) = EXTRACT(YEAR_MONTH FROM
CURRENT_DATE)and EXTRACT(YEAR_MONTH FROM acctstarttime) 
EXTRACT(YEAR_MONTH FROM CURRENT_DATE + INTERVAL 1 MONTH) GROUP BY username
ORDER BY total_usage DESC;

I wanted to add something like a WHERE total_usage  322100 line but
I don't know where to insert it. Any help would be greatly appreciated.

Jopoy


Re: InnoDB error 5

2013-11-21 Thread Nick Cameo
What is the best way to backup your database. Which are the files that
I need to store on a usb disk

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: InnoDB error 5

2013-11-21 Thread Shawn Green

Hello Nick,

On 11/21/2013 10:32 AM, Nick Cameo wrote:

OOoopppsss! I do mean for recovery/continual backup. I will do it
manually, but basically get all the data on a USB disk and be able to
recover/move it (the data) on another machine, the same machine etc..

I hope I did not just open up a can of worms. We just went live and
this post gave me a rude awakening. What is an effective easy to
follow protocol for backup and recovery in mysql!

Nick from Toronto



There are two basic types of backups, logical and physical.

Logical backups are performed by a utility that converts your database 
objects into their CREATE ... commands and exports your data as INSERT 
... commands (or as delimited files). These kinds of backups are quite 
portable and compress well. An example of such a tool is mysqldump.


http://dev.mysql.com/doc/refman/5.6/en/mysqldump.html

Physical backups can happen many different ways.  The easiest version to 
make/restore is the 'cold copy'.  This is exactly what it sounds like. 
Shutdown your mysqld and make a copy of everything. At the absolute 
minimum you need the ibdata files, the ib_log files, and all folders 
inside your --datadir location.


Warm or hot copies are provided by tools that coordinate with the server 
to synchronize the state of the InnoDB data to the moment the non-InnoDB 
data has been captured. One example of this is MySQL Enterprise Backup.

http://dev.mysql.com/doc/mysql-enterprise-backup/3.9/en/index.html

Additional details abound in the manual:
http://dev.mysql.com/doc/refman/5.6/en/backup-types.html


Regards,
--
Shawn Green
MySQL Senior Principal Technical Support Engineer
Oracle USA, Inc. - Hardware and Software, Engineered to Work Together.
Office: Blountville, TN

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



How do I mysqldump different database tables to the same .sql file?

2013-11-21 Thread Daevid Vincent
I'm working on some code where I am trying to merge two customer accounts
(we get people signing up under different usernames, emails, or just create
a new account sometimes). I want to test it, and so I need a way to restore
the data in the particular tables. Taking a dump of all the DBs and tables
is not feasible as it's massive, and importing (with indexes) takes HOURS. I
just want only the tables that are relevant. I can find all the tables that
have `customer_id` in them with this magic incantation:
 
SELECT `TABLE_NAME`,`TABLE_SCHEMA` FROM `information_schema`.`COLUMNS` WHERE
`COLUMN_NAME` = 'customer_id' ORDER BY `TABLE_SCHEMA`, `TABLE_NAME`
 
Then I crafted this, but it pukes on the db name portion. :-(
 
mysqldump -uroot -proot --skip-opt --add-drop-table --extended-insert
--complete-insert --insert-ignore --create-options --quick --force
--set-charset --disable-keys --quote-names --comments --verbose --tables
member_sessions.users_last_login support.tickets mydb1.clear_passwords
mydb1.crak_subscriptions mydb1.customers mydb1.customers_free
mydb1.customers_free_tracking mydb1.customers_log
mydb1.customers_subscriptions mydb1.customers_transactions mydb1.players
mydb1content.actors_comments mydb1content.actor_collections
mydb1content.actor_likes_users mydb1content.collections
mydb1content.dvd_likes_users mydb1content.free_videos
mydb1content.genre_collections mydb1content.playlists
mydb1content.poll_votes mydb1content.scenes_comments
mydb1content.scenes_ratings_users_new2 mydb1content.scene_collections
mydb1content.scene_likes_users mydb1content.videos_downloaded
mydb1content.videos_viewed  merge_backup.sql
 
-- Connecting to localhost...
mysqldump: Got error: 1049: Unknown database
'member_sessions.users_last_login' when selecting the database
-- Disconnecting from localhost...
 
I searched a bit and found that it seems I have to split this into multiple
statements and append like I'm back in 1980. *sigh*
 
mysqldump -uroot -proot --skip-opt --add-drop-table --extended-insert
--complete-insert --insert-ignore --create-options --quick --force
--set-charset --disable-keys --quote-names --comments --verbose --database
member_sessions --tables users_last_login  merge_backup.sql
mysqldump -uroot -proot --skip-opt --add-drop-table --extended-insert
--complete-insert --insert-ignore --create-options --quick --force
--set-charset --disable-keys --quote-names --comments --verbose --database
support --tables tickets  merge_backup.sql
mysqldump -uroot -proot --skip-opt --add-drop-table --extended-insert
--complete-insert --insert-ignore --create-options --quick --force
--set-charset --disable-keys --quote-names --comments --verbose --database
mydb1 --tables clear_passwords customers customers_free
customers_free_tracking customers_log customers_subscriptions
customers_transactions players  merge_backup.sql
mysqldump -uroot -proot --skip-opt --add-drop-table --extended-insert
--complete-insert --insert-ignore --create-options --quick --force
--set-charset --disable-keys --quote-names --comments --verbose --database
content --tables actors_comments actor_collections actor_likes_users
collections dvd_likes_users free_videos genre_collections playlists
poll_votes scenes_comments scenes_ratings_users_new2 scene_collections
scene_likes_users videos_downloaded videos_viewed  merge_backup.sql
 
The critical flaw here is that the mysqldump program does NOT put the
necessary USE DATABASE statement in each of these dumps since there is
only one DB after the -database apparently. UGH. Nor do I see a command line
option to force it to output this seemingly obvious statement.
 
It's a pretty significant shortcoming of mysqldump if you ask me that I
can't do it the way I had it in the first example since that's pretty much
standard SQL convetion of db.table.column format. And even more baffling is
why it wouldn't dump out the USE statement always even if there is only
one DB. It's a few characters and would save a lot of headaches in case
someone tried to dump their .sql file into the wrong DB on accident.
 
Plus it's not easy to edit a 2.6GB file to manually insert these USE
lines.
 
Is there a way to do this with some command line option I'm not seeing in
the man page?


Re: InnoDB error 5

2013-11-21 Thread Reindl Harald


Am 21.11.2013 18:59, schrieb Paul Halliday:
 It was indeed corruption :/ what a day. I was able to move everything
 over to another partition and have managed to get mysql up and running
 again.  There was a single file I could not, an .idb (the ,.frm is
 there). Is it possible to fix this from ibdata or the logs?

no - that's what backups are for
lesson learned the hard way

for production you have usually a replication-slave in the same
network which is regulary stopped and it's datadir rsynced to a
offsite-backup (one possible backup strategy) and so if one
server get a corrupt filesystem there is a just-in-time backup
while if things are going terrible wrong (power outage and the
slave is also corrupt you rsync back the slightly outdated
offsite backup

 On Thu, Nov 21, 2013 at 9:46 AM, Manuel Arostegui man...@tuenti.com wrote:
 2013/11/21 Reindl Harald h.rei...@thelounge.net

 Am 21.11.2013 13:51, schrieb Paul Halliday:
 Had a system crash this morning and I can't seem to get mysql back up
 and running. This is the error:

 InnoDB: Progress in percent: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
 87 88 89 90 91 92 93 94 95 96 97 98 99 2013-11-21 08:47:26 1570
 [ERROR] InnoDB: Tried to read 16384 bytes at offset 589824. Was only
 able to read -1.
 2013-11-21 08:47:26 802808c00  InnoDB: Operating system error number 5
 in a file operation.
 InnoDB: Error number 5 means 'Input/output error'.
 InnoDB: Some operating system error numbers are described at
 InnoDB:
 http://dev.mysql.com/doc/refman/5.6/en/operating-system-error-codes.html
 2013-11-21 08:47:26 802808c00  InnoDB: File operation call: 'read'
 returned OS error 105.
 2013-11-21 08:47:26 802808c00  InnoDB: Cannot continue operation.

 I followed that link but it doesn't tell me anything outside of what
 is above. Can I fix this?

 i would look in the *system logs* because this pretty sure comes
 from the underlying operating system and is *not* mysql specific
 which is also in the message statet with returned OS error 105

 http://lxr.free-electrons.com/source/include/uapi/asm-generic/errno-base.h#L8


 Looks like a broken disk or FS corruption :-(



signature.asc
Description: OpenPGP digital signature


Re: InnoDB error 5

2013-11-21 Thread Nick Cameo
OOoopppsss! I do mean for recovery/continual backup. I will do it
manually, but basically get all the data on a USB disk and be able to
recover/move it (the data) on another machine, the same machine etc..

I hope I did not just open up a can of worms. We just went live and
this post gave me a rude awakening. What is an effective easy to
follow protocol for backup and recovery in mysql!

Nick from Toronto

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: InnoDB error 5

2013-11-21 Thread Reindl Harald

Am 21.11.2013 13:51, schrieb Paul Halliday:
 Had a system crash this morning and I can't seem to get mysql back up
 and running. This is the error:
 
 InnoDB: Progress in percent: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
 87 88 89 90 91 92 93 94 95 96 97 98 99 2013-11-21 08:47:26 1570
 [ERROR] InnoDB: Tried to read 16384 bytes at offset 589824. Was only
 able to read -1.
 2013-11-21 08:47:26 802808c00  InnoDB: Operating system error number 5
 in a file operation.
 InnoDB: Error number 5 means 'Input/output error'.
 InnoDB: Some operating system error numbers are described at
 InnoDB: 
 http://dev.mysql.com/doc/refman/5.6/en/operating-system-error-codes.html
 2013-11-21 08:47:26 802808c00  InnoDB: File operation call: 'read'
 returned OS error 105.
 2013-11-21 08:47:26 802808c00  InnoDB: Cannot continue operation.
 
 I followed that link but it doesn't tell me anything outside of what
 is above. Can I fix this?

i would look in the *system logs* because this pretty sure comes
from the underlying operating system and is *not* mysql specific
which is also in the message statet with returned OS error 105

http://lxr.free-electrons.com/source/include/uapi/asm-generic/errno-base.h#L8



signature.asc
Description: OpenPGP digital signature