I don't have access to this at the moment to test it, but you can put the entire select statement inside a variable:
And actually, you can specify the database on the command line, so that you pipe the command into mysql:
(I think it's the -d option. It might be -D).
I have following content in the file
CancelPolicyMultiLingual3=U|PC3|EN
RestaurantInfoCode1=U|restID1|1
.....
I am trying to use following matching extression
\|(+)
to get this
PC3|EN
restID1|1
Obviously it does not work.
Any ideas? (13 Replies)
how to find for a file whose name has all characters in uppercase after 'project'?
I tried this:
find . -name 'project**.pdf'
./projectABC.pdf
./projectABC123.pdf
I want only ./projectABC.pdf
What is the regular expression that correponds to "all characters are capital"?
thanks (8 Replies)
Hi,
below is a piece of code written by my predecessor at work.
I'm kind of a newbie and am trying to figure out all the regular expressions in this piece of code.
It is really a tough time for me to figure out all the regular expressions.
Please shed some light on the regular expressions... (3 Replies)
Hi,
In ksh, I am trying to compare folder names having -141- in it's name.
e.g.: 4567-141-8098 should match this expression '*-141-*'
but, -141-2354 should fail when compared with '*-141-*'
simlarly, abc should fail when compared with '*-141-*'
I tried multiple things but nevertheless,... (5 Replies)
I have a file that I'm trying to find all the cases of phone number extensions and deleting them. So input file looks like:
abc
x93825
def
13234
x52673
hello
output looks like:
abc
def
13234
hello
Basically delete lines that have 5 numbers following "x". I tried: x\(4) but it... (7 Replies)
Hi
Ilove unix and alwyas trying to to learn unix,but i am weak in using regular expressions.can you please give me a littel brief discription that how can i understand them and how to use .your response could lead a great hand in my unix love. (1 Reply)
I need to pick a part of string lets stay started with specific character and end with specific character to replace using sed command
the line is like this:my audio book 71-skhdfon1dufgjhgf8.wav'
I want to move the characters beginning with - end before.
I have different files with random... (2 Replies)
Discussion started by: XP_2600
2 Replies
LEARN ABOUT DEBIAN
mysql-schema-diff
MYSQLDIFF(1p) User Contributed Perl Documentation MYSQLDIFF(1p)NAME
mysql-schema-diff - compare MySQL database schemas
SYNOPSIS
mysql-schema-diff [B<options>] B<database1> B<database2>
mysql-schema-diff --help
DESCRIPTION
mysql-schema-diff is a Perl script front-end to the CPAN <http://www.perl.com/CPAN> module MySQL::Diff
<http://search.cpan.org/search?module=MySQL::Diff> which compares the data structures (i.e. schema / table definitions) of two MySQL
<http://www.mysql.com/> databases, and returns the differences as a sequence of MySQL commands suitable for piping into mysql which will
transform the structure of the first database to be identical to that of the second (c.f. diff and patch).
Database structures can be compared whether they are files containing table definitions or existing databases, local or remote.
N.B. The program makes no attempt to compare any of the data which may be stored in the databases. It is purely for comparing the table
definitions. I have no plans to implement data comparison; it is a complex problem and I have no need of such functionality anyway.
However there is another program coldiff <http://rossbeyer.net/software/mysql_coldiff/> which does this, and is based on an older program
called datadiff which seems to have vanished off the 'net.
For PostgreSQL there are similar tools such as pgdiff <http://pgdiff.sourceforge.net/> and apgdiff <http://apgdiff.startnet.biz/>.
EXAMPLES
# compare table definitions in two files
mysql-schema-diff db1.mysql db2.mysql
# compare table definitions in a file 'db1.mysql' with a database 'db2'
mysql-schema-diff db1.mysql db2
# interactively upgrade schema of database 'db1' to be like the
# schema described in the file 'db2.mysql'
mysql-schema-diff -A db1 db2.mysql
# compare table definitions in two databases on a remote machine
mysql-schema-diff --host=remote.host.com --user=myaccount db1 db2
# compare table definitions in a local database 'foo' with a
# database 'bar' on a remote machine, when a file foo already
# exists in the current directory
mysql-schema-diff --host2=remote.host.com --password=secret db:foo bar
OPTIONS
More details to come; for now run "mysql-schema-diff --help".
INTERNALS
For both of the database structures being compared, the following happens:
o If the argument is a valid filename, the file is used to create a temporary database which "mysqldump -d" is run on to obtain the table
definitions in canonicalised form. The temporary database is then dropped. (The temporary database is named
"test_mysqldiff_temp_something" because default MySQL permissions allow anyone to create databases beginning with the prefix "test_".)
o If the argument is a database, "mysqldump -d" is run directly on it.
o Where authentication is required, the hostname, username, and password given by the corresponding options are used (type
"mysql-schema-diff --help" for more information).
o Each set of table definitions is now parsed into tables, and fields and index keys within those tables; these are compared, and the
differences outputted in the form of MySQL statements.
BUGS, DEVELOPMENT, CONTRIBUTING
See <http://software.adamspiers.org/wiki/mysqldiff>.
COPYRIGHT AND LICENSE
Copyright (c) 2000-2011 Adam Spiers. All rights reserved. This program is free software; you can redistribute it and/or modify it under the
same terms as Perl itself.
SEE ALSO
MySQL::Diff, MySQL::Diff::Database, MySQL::Diff::Table, MySQL::Diff::Utils, mysql, mysqldump, mysqlshow
AUTHOR
Adam Spiers <mysqldiff@adamspiers.org>
perl v5.14.2 2012-04-06 MYSQLDIFF(1p)