Export MySQL database as XML file
Answer:
mysqldump allow you to export database contents to XML file with a simple command.
E.g.
# mysqldump my_db my_table --xml
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
Export MySQL database as XML file
Answer:
mysqldump allow you to export database contents to XML file with a simple command.
E.g.
# mysqldump my_db my_table --xml
Export MySQL database as CSV file
Answer:
Export MySQL database CSV file can be done with the mysqldump command.
E.g.
# mysqldump my_db --fields-terminated-by=',' --fields-enclosed-by='"' --fields-escaped-by='\' --lines-terminated-by='\n' --tab /tmp
You will find the whole database my_db is exported under the /tmp folder, in which *.sql files are the table definiation, and *.txt files are the table's content in CSV format.
Convert IP address to unsigned integer in MySQL
Answer:
To convert an IPv4 address string, such as 127.0.0.1 to an unsigned integer, you can use the INET_ATON function in MySQL.
mysql> SELECT INET_ATON('127.0.0.1');
+------------------------+
| INET_ATON('127.0.0.1') |
+------------------------+
| 2130706433 |
+------------------------+