nonethefewer: (Default)
What I want today is a way to copy data from SQL Server to MySQL.

Production data is kept on the former on server A, and invoicing is kept on the latter on server B.  There's this fifteen-million-step process of exporting the data from SQL Server, using sed to prettify the data, then importing it into MySQL... why not cut all that out?

If I can, of course.

Query!  Is this a sensical thing to do?  I found this...

Originally posted on Dreamwidth.  Number of comments so far:
nonethefewer: (Default)
I want this very much, plaes (sic).

I have a script right now from userscripts.org that lets me hit Ctrl-Enter in phpMyAdmin to submit a SQL query.

Is there any goddamn way at all to have that work as well for F5, when the SQL query textarea has the focus?

I ask because I also use SQL Server here at work, which uses F5 to run its queries, and if I hit F5 in phpMyAdmin and refresh the web page one more time, I'm gonna snap.

Originally posted on Dreamwidth.  Number of comments so far: comment count unavailable
nonethefewer: "But today, the pattern of lights is *all wrong*!" "Oh god! Try pressing more buttons!" "*It's not helping*!" (tech support)
That whole thing yesterday about the unknown string thing?

Yeah, I forgot to close a single quote, halfway up in the string.

*siiigh*

I'm real bright when I'm frustrated, I tell you what.

Originally posted on Dreamwidth.  Number of comments so far: comment count unavailable
nonethefewer: "But today, the pattern of lights is *all wrong*!" "Oh god! Try pressing more buttons!" "*It's not helping*!" (tech support)
That whole thing yesterday about the unknown string thing?

Yeah, I forgot to close a single quote, halfway up in the string.

*siiigh*

I'm real bright when I'm frustrated, I tell you what.
nonethefewer: (Default)
We migrated the database over from one server to another, and now?  Now, kitties, now I am going to die of frustration.

In phpMyAdmin:

INSERT INTO tbl_table (name, website) VALUES ('Company', 'http://www.google.com');

ERROR: Unknown Punctuation String @ ###
STR: ://


I am full of hate.

What's really getting to me is the part where if I click Insert and manually enter the data that way, it submits fine.  If I copy that code and change it for the next name in the list, it fails.

fjdsklfjdsjfeuyaoi5t7238

Originally posted on Dreamwidth.  Number of comments so far: comment count unavailable
nonethefewer: (Default)
We migrated the database over from one server to another, and now?  Now, kitties, now I am going to die of frustration.

In phpMyAdmin:

INSERT INTO tbl_table (name, website) VALUES ('Company', 'http://www.google.com');

ERROR: Unknown Punctuation String @ ###
STR: ://


I am full of hate.

What's really getting to me is the part where if I click Insert and manually enter the data that way, it submits fine.  If I copy that code and change it for the next name in the list, it fails.

fjdsklfjdsjfeuyaoi5t7238
nonethefewer: (Default)
Stupid question time.

PHP/MySQL.  I have this line:

mysql_query("INSERT IGNORE INTO table SELECT * FROM othertbl") or die(mysql_error());

When I run this elsewhere (phpMyAdmin, command line, mysql prompt), I get an indication of how many rows were changed.

How can I capture that in PHP, for writing to elsewhere?

Originally posted on Dreamwidth.  Number of comments so far: comment count unavailable
nonethefewer: (Default)
Stupid question time.

PHP/MySQL.  I have this line:

mysql_query("INSERT IGNORE INTO table SELECT * FROM othertbl") or die(mysql_error());

When I run this elsewhere (phpMyAdmin, command line, mysql prompt), I get an indication of how many rows were changed.

How can I capture that in PHP, for writing to elsewhere?
nonethefewer: (Default)
A fuller thing from yesterday's post re PHP/MySQL.

The steps, laid out. )

So, it's probably that the data's being exported from type bit to type boolean for some daft reason, and MySQL is all like, "I'm taking in tinyint, what's this boolean bullshit?", and setting it to 0, because that's the default value.

It's still bloody annoying that command line works but PHP doesn't, on the same file.

Oh well.  I put cast(the_column as int) as the_column in the query for the package; that should help.

--

[eta] Except that didn't change a goddamn thing.  Motherfuck.  FINE.  LINE BY LINE IT IS, ASSHOLES.

Originally posted on Dreamwidth.  Number of comments so far: comment count unavailable
nonethefewer: (Default)
A fuller thing from yesterday's post re PHP/MySQL.

The steps, laid out. )

So, it's probably that the data's being exported from type bit to type boolean for some daft reason, and MySQL is all like, "I'm taking in tinyint, what's this boolean bullshit?", and setting it to 0, because that's the default value.

It's still bloody annoying that command line works but PHP doesn't, on the same file.

Oh well.  I put cast(the_column as int) as the_column in the query for the package; that should help.

--

[eta] Except that didn't change a goddamn thing.  Motherfuck.  FINE.  LINE BY LINE IT IS, ASSHOLES.
nonethefewer: (Default)
PHP/MySQL question.

There is a tab-separated file that contains, among other things, true/false values.

I run this from the command line:

mysqlimport -v --fields-terminated-by='\t' --fields-optionally-enclosed-by="'" --lines-terminated-by='\n' --user=user --password=password dbname filename.csv

The true/false values are updated fine.

I do the exact same damn thing from PHP, and all true/false columns are set to false.

What gives?

[eta] Same if I run this in PHP:

mysql_query("LOAD DATA INFILE '$file' INTO TABLE table_name FIELDS TERMINATED BY '\t' ENCLOSED BY \"'\" LINES TERMINATED BY '\n'");

WRYYYYYYYy

Originally posted on Dreamwidth.  Number of comments so far: comment count unavailable
nonethefewer: (Default)
PHP/MySQL question.

There is a tab-separated file that contains, among other things, true/false values.

I run this from the command line:

mysqlimport -v --fields-terminated-by='\t' --fields-optionally-enclosed-by="'" --lines-terminated-by='\n' --user=user --password=password dbname filename.csv

The true/false values are updated fine.

I do the exact same damn thing from PHP, and all true/false columns are set to false.

What gives?

[eta] Same if I run this in PHP:

mysql_query("LOAD DATA INFILE '$file' INTO TABLE table_name FIELDS TERMINATED BY '\t' ENCLOSED BY \"'\" LINES TERMINATED BY '\n'");

WRYYYYYYYy
nonethefewer: (Default)
Riddle me this, network/DBA folk.

* We have three servers that hold the production data.  They are on NewNetwork.  The rest of the computers here are on OldNetwork.

* I can use Remote Desktop to get to MainServer, which is on OldNetwork.  It can talk to the three servers.  As in, I can use SQL Server to connect to each of the three servers to access their databases.

(This is really really good, as using VNC to use Remote Desktop to each of the three servers bugs the flying crap outta me.)

* MainServer is using SQL Server 2008 R2.  The server itself is Windows 2008 Server R2.

* The second invoicing system is stored on a Linux box, on OldNetwork.  cat /proc/version gives me: Linux version 2.6.12-2.3.legacy_FC3 (mockbuild@petra.fedoralegacy.org) (gcc version 3.4.4 20050721 (Red Hat 3.4.4-2)) #1 Sun Feb 19 07:48:10 EST 2006

* It is running MySQL 3.23.58, for reasons that utterly frustrate me, but I can't change that at this time.


I want to set something up on the Linux box to get the data from the three data servers into the MySQL db, programmatically.

Can I?

If so, how?

Originally posted on Dreamwidth.
nonethefewer: (Default)
I'm always late to the party.

EOL of MySQL Query Browser, MySQL Administrator, MySQL Migration Toolkit

They're moving over to MySQL Workbench.  Here's a screenshot of the home page.
nonethefewer: (Default)
- Vista 64-bit.
- Excel 2007.
- MyODBC 3.51.  (We're using MySQL 3.23.)

Steps:

- Go to Data Sources (ODBC) and add a user data source to connect to the db.
- Test the connection - it works.
- In Excel, go to the Data section, and click From Other Sources.
- Choose From Data Connection Wizard.
- ODBS DSN, next.

Suck:

No matter what I select, clicking Next gives me nothing.  No delay, no display, no closing windows, no hanging, nothing.  This isn't just MySQL (though I listed it to be thorough) - no option does anything.

What &$(# gives?
nonethefewer: (Default)
Check me on this.

select column_name, column_default, is_nullable from information_schema.columns order by column_name;

Gets, among other rows, this:

user_sig | NULL | NO

So... it can't be nulled... and the default value is null?

Am I just braindead today, and this makes sense and I need sleep?
nonethefewer: (geeky love)
I think maybe I'll teach myself more PHP and MySQL by making a calltracker for myself.

(I like Zoho, but I'm missing things.)
nonethefewer: (tasks)
I am loving my tasks thing.

Right now, I'm teaching myself about triggers for MySQL.  The Tasks table has the columns Completed, Deleted, and DateAdded, which have default values of 0, 0, and Now(), respectively.  Instead of putting that into the ASP page, I want it so that inserting a new row in Tasks adds those items automatically.

I'm not sure if having a trigger that does that means I can't have those columns be not null.  But I'll find out!  Brilliance.

If I get this done, I'll totally put this somewhere so that others can run off with it.

Things left:

- Get the actions working (complete/edit/delete).
- Have an export-to-.csv function.
- Have an Empty Trashcan-thing action, if there are items to be deleted.
  - Have a way of disabling that.
- Filter on tags!
- Column chooser!
- Sort/filter on whatever I want!  (I only want to filter on tags, but hey, why not?)
- Dance!
nonethefewer: A steampunk heart, from here: http://www.girlgeniusonline.com/comic.php?date=20050926 (geeky)
Eeeheehee, I have ASP talking to MySQL just nicely.  I have a page for inputting new tasks, which (after it sends the task to MySQL) redirects to the main tasks page.

Next steps:

- Add Edit function.
- Add Change tags function.
- Add Delete function.
- Add 'deleted' column.  (I'm freakish.)
- Investigate filtering.
- Stop doing meth.
nonethefewer: (sweet jesus!)
I now have an .asp page that lists my tasks, colour-coded by priority, with multiple tags listed with commas.

*♥s it*
Page generated Aug. 9th, 2025 01:46 pm
Powered by Dreamwidth Studios