I have stack overflow data in an xml file listed below, I want to insert it into mysql database using LOAD XML INFILE , it executes but insert blank/null values in table:
<badges>
<row Id="82946" UserId="3718" Name="Teacher" Date="2008-09-15T08:55:03.923" />
<row Id="82947" UserId="994" Name="Teacher" Date="2008-09-15T08:55:03.957" />
<row Id="82948" UserId="3372" Name=
How do I create a local backup of a remote Amazon RDS MySQL database? What I need to know is how to make a complete full local backup of a MySQL database (not a remote Amazon snapshot) that can be used to restore to a new database anywhere, on any MySQL server (same version of course).
NOTE: I know how to import data from a flat file via MySQL.
I have a metric boatload of .txt files I'd like to load into a database.
The tables have the same name as the .txt files, but without the extension.
So I'd like to execute the command
for f in *.txt; do mysql -u root -p -e "LOAD DATA LOCAL INFILE '$f' INTO TABLE $f" -D rn4; done
However, the last $f is giving me headaches as I want it to only use the name, not the extension.
So for the file
Hi to everyone someone know how to get an estimate about the size of one mysql table?
I mean I am planning to make a backup of all the mysql's table on all my server
but I'd like to know how big should be every dump table without make the physical dump.
There is some command which permit to do this one?
I am using mysql 5.1 on debian 6
Cheers
How would I do the following command, with a local file, on a remote database (different machine) ?
$MYSQL_PATH/mysql -u root -h remote.net files -e "
LOAD DATA INFILE '$1'
INTO TABLE $TABLE_NAME
FIELDS TERMINATED BY ','
(size, @d2, @d3, @d4, @d5, path)
The problem seems to be that the INFILE at /tmp/infile.txt is not being recognized remotely.
I have a mysql table (MyISAM), called bla. The Version is 9 (mysql4)
Using a mysql5-server I did an alter table (add column, delete the same column). This is a simple trick to upgrade the table Version.
As shown by mysql:
$ echo "show table status from mydb like 'bla'\G" | mysql -p | grep Version
Enter password:
Version: 10
Normally the unix file command gives the same result, i.e.
I've got a MySQL table with a .MYD file of 44GB, and a .MYI file of 34GB. I'm running scripts from the command line that analyze the data in this table. MySQL is not maxing out the CPU, my memory IS maxed, and VMSTAT is reporting that data is being swapped to disk ... but I'm not terribly familiar with this utility and it's reports.
I am running a High Memory Double XL Amazon EC2 Instance.
I have an SQL fact table which is used for looking up a date and returning another date.
The table schema is as follows:
TABLE date_lookup
(
pk_date DATE,
plus1_months DATE,
plus2_months DATE,
plus3_months DATE
);
UNIQUE INDEX on date_lookup(pk_date);
I have a load file (pipe delimited) containing dates from 01-28-2012 to 03-31-2014.
The following is an example of the load file:
01-2
MySQL command I have so far:
load data infile 'data.txt' into table foo (column_foobar);
data.txt:
bar1
bar2
bar3
Note the tab at beginning of each line. How can I ignore the tab with MySQL so that bar1, bar2, bar3 gets loaded in column_foobar?