SQL

Message Bookmarked
Bookmark Removed
I will, apparently, be learning it. What is it good for and what can I expect?

adam... (nordicskilla), Friday, 5 November 2004 20:07 (twenty-one years ago)

It's good for querying a database. You can expect to forget that you should be using 'is null'.

Mr Noodles (Mr Noodles), Friday, 5 November 2004 20:10 (twenty-one years ago)

What is it good for
selecting stuff from places where things are like %other things.

dave225 (Dave225), Friday, 5 November 2004 20:10 (twenty-one years ago)

bother things? mother things? what what what?

Mr Noodles (Mr Noodles), Friday, 5 November 2004 20:11 (twenty-one years ago)

you can teach it to me! I don't understand it, or databases, or jack shit

kyle (akmonday), Friday, 5 November 2004 20:28 (twenty-one years ago)

Can I break ILX with it?

adam... (nordicskilla), Friday, 5 November 2004 20:30 (twenty-one years ago)

Only if you already know a lot about the ILX backend. (Basically, no.)

Girolamo Savonarola, Friday, 5 November 2004 20:31 (twenty-one years ago)

Is the backend where everybody hooks up in secret?

adam... (nordicskilla), Friday, 5 November 2004 20:32 (twenty-one years ago)

SELECT putting a motherfucking semicolon at line's end FROM stupid shit that the Oracle SQL interface makes you do for no real reason SORT BY sheer hatred;

adam (adam), Friday, 5 November 2004 20:35 (twenty-one years ago)

Sorry, I just went NUTS.

adam... (nordicskilla), Friday, 5 November 2004 20:36 (twenty-one years ago)

there is no stupid shit and there is almost always a reason.

Mr Noodles (Mr Noodles), Friday, 5 November 2004 20:37 (twenty-one years ago)

Will I turn weird?

adam... (nordicskilla), Friday, 5 November 2004 20:37 (twenty-one years ago)

yes

kyle (akmonday), Friday, 5 November 2004 20:38 (twenty-one years ago)

"turn"

Dan Quisenberry (deangulberry), Friday, 5 November 2004 20:39 (twenty-one years ago)

:)

Dan Quisenberry (deangulberry), Friday, 5 November 2004 20:39 (twenty-one years ago)

Perhaps. Just learn to love todate and tochar and save yourself alot of pain. NVL and Decode can also save you lots of time.

Mr Noodles (Mr Noodles), Friday, 5 November 2004 20:39 (twenty-one years ago)

I don't know databases from a hole in the ground, but I think I'd better learn SQL too if I want to get some good tech writing jobs... My level of fear of math-like things is such that I once claimed I couldn't use Excel because I was Amish.

Layna Andersen (Layna Andersen), Friday, 5 November 2004 20:41 (twenty-one years ago)

SELECT annoying, just-different-enough-for-you-to-forget syntax for each bloody statement.

(why do INSERT and UPDATE have to be so different to each other, anyway?)

caitlin (caitlin), Friday, 5 November 2004 21:09 (twenty-one years ago)

expect annoyance and confusion at the outset, but a unique thrill when you write your first gargantuan SELECT query that works perfectly.

fortunate hazel (f. hazel), Friday, 5 November 2004 21:12 (twenty-one years ago)

if exists (select * from sysobjects where id = object_id('dbo.St_R334b') and sysstat & 0xf = 4)
drop procedure dbo.St_R334b
GO

CREATE PROCEDURE St_R334b
@Region varchar(12),
@fYear char(4),
@fMonthStart char(2),
@fMonthEnd char(2)
AS
BEGIN

DECLARE @Months int
DECLARE @TotalRev float

SELECT @Months = convert(int,@fMonthEnd) - convert(int,@fMonthStart) + 1

SELECT @TotalRev = Sum(t.MON_REV_C)
FROM tdrs_data AS t
WHERE t.fYear=@fYear AND (t.fMonth BETWEEN @fMonthStart AND @fMonthEnd)

SELECT c.CorporateID, c.CorporateName, c.Region,
Sum(t.MON_REV_C) AS mon_rev_c_sum,
Sum(t.MON_REV_C)/@TotalRev AS mon_rev_pct_of_ttl,
Sum(t.MON_REV_P) AS mon_rev_p_sum,
Sum(t.MON_PAX_C) AS mon_pax_c_sum,
Sum(t.MON_PAX_P) AS mon_pax_p_sum,
rev_class =
CASE
WHEN ((Sum(t.MON_REV_C)/@Months) * 12) > 3000000 THEN 1
WHEN ((Sum(t.MON_REV_C)/@Months) * 12) > 1000000 AND ((Sum(t.MON_REV_C)/@Months) * 12) 500000 AND ((Sum(t.MON_REV_C)/@Months) * 12) 100000 AND ((Sum(t.MON_REV_C)/@Months) * 12) 3000000 THEN 'Over $3 MM'
WHEN ((Sum(t.MON_REV_C)/@Months) * 12) > 1000000 AND ((Sum(t.MON_REV_C)/@Months) * 12) 500000 AND ((Sum(t.MON_REV_C)/@Months) * 12) 100000 AND ((Sum(t.MON_REV_C)/@Months) * 12)

57 7th (calstars), Friday, 5 November 2004 21:17 (twenty-one years ago)

*shudder*

caitlin (caitlin), Friday, 5 November 2004 21:22 (twenty-one years ago)

See, I don't work w/ SQL like that. I am happy for that, too. Though I will undoubtedly not make a damn bit of coin until I muck around in that sort of shit.

David R. (popshots75`), Friday, 5 November 2004 21:25 (twenty-one years ago)

programmers are weird. phpmyadmin for mysql still confuses me.

Kenan (kenan), Friday, 5 November 2004 21:27 (twenty-one years ago)

Luckily that crap was already in place when I got to my current job; I still have to go in and decipher it now and then though.

57 7th (calstars), Friday, 5 November 2004 21:32 (twenty-one years ago)

if i tell you i can make sense of that, will you give me a job?

fortunate hazel (f. hazel), Friday, 5 November 2004 21:35 (twenty-one years ago)

I hate every php-based database admin tool I've come across. I hate to admit it, but my favourite database admin program is probably MS SQL Server Enterprise Manager.

caitlin (caitlin), Friday, 5 November 2004 21:36 (twenty-one years ago)

SQL is a bit of an anomaly in computing, in that it's the most common standard for accessing data, but has largely been a failure. The idea is you declaratively tell the computer what data you want and it figures out the best way to get it. Things haven't panned out that way in the 30 years or so of its life.

Keith Watson (kmw), Friday, 5 November 2004 21:41 (twenty-one years ago)

I've always thought that SQL was easy to learn, but very difficult to master.

57 7th (calstars), Friday, 5 November 2004 21:42 (twenty-one years ago)

Just like bass guitar!

Keith Watson (kmw), Friday, 5 November 2004 21:42 (twenty-one years ago)

The difficult part is in understanding how the database will react to queries you give it. It's not just the SQL that counts here either, indexing, network round-trips, how data is aggregated, available memory on boxes and so on all play a part.

Keith Watson (kmw), Friday, 5 November 2004 21:44 (twenty-one years ago)

there is no stupid shit and there is almost always a reason.

What's the reason for using a sub-DOS CLI in 2004? Not that I mind using a command line--but why can't it act more like BASH? My problems are really more with Oracle than with SQL.

adam (adam), Friday, 5 November 2004 21:51 (twenty-one years ago)

Why don't you download cygwin Bash for your PC?

http://www.cygwin.com/

Keith Watson (kmw), Friday, 5 November 2004 21:52 (twenty-one years ago)

Oh god what strange world I am entering?

adam... (nordicskilla), Friday, 5 November 2004 21:55 (twenty-one years ago)

Be scared...
No really. Be scared.

57 7th (calstars), Friday, 5 November 2004 22:02 (twenty-one years ago)

I just kinda took a crash course in it (well mySQL actually). You can expect to eventually find this joke funny:

What is it good for
selecting stuff from places where things are like %other things.
-- dave225 (right.knewi...), November 5th, 2004 2:10 PM. (Dave225) (later) (link)


--------------------------------------------------------------------------------

bother things? mother things? what what what?
-- Mr Noodles (infinitecow...), November 5th, 2004 2:11 PM. (Mr Noodles) (later) (link)

teeny (teeny), Friday, 5 November 2004 22:02 (twenty-one years ago)

Are you Lil Jon?

xpost

adam... (nordicskilla), Friday, 5 November 2004 22:03 (twenty-one years ago)

Best SQL line I saw recently started 'where what like'.

Martin Skidmore (Martin Skidmore), Friday, 5 November 2004 22:05 (twenty-one years ago)

Oh, I'm sure I'll have a few real gems just like that to share with you all soon! What fun we'll have!

*RUNS AWAY*

adam... (nordicskilla), Friday, 5 November 2004 22:06 (twenty-one years ago)

what kind of job did you inherit? I thought you'd just have to use a front-end thing. are you a db admin now????

kyle (akmonday), Friday, 5 November 2004 22:09 (twenty-one years ago)

Yes!

adam... (nordicskilla), Friday, 5 November 2004 22:10 (twenty-one years ago)

All of our regional people come to ME for HELP!!!

adam... (nordicskilla), Friday, 5 November 2004 22:10 (twenty-one years ago)

have fun

kyle (akmonday), Friday, 5 November 2004 22:12 (twenty-one years ago)

are the "regional people" like "provincals"?

kyle (akmonday), Friday, 5 November 2004 22:12 (twenty-one years ago)

Something like that, yeah. Dumbasses.

adam... (nordicskilla), Friday, 5 November 2004 22:12 (twenty-one years ago)

"hicks"

Kenan (kenan), Friday, 5 November 2004 22:13 (twenty-one years ago)

Hope that your workplace uses only one flavor of DB. We use Oracle and mysql and I continually forget that, say, mysql can't do an update on certain types of joins. Grrrr.

SQL joins are one of the things that are a pain in the ass to learn to master, but once you can do them and understand why you'd want an inner join vs an outer join, you will be happy. And a huge geek.

fairly good joins 101: http://www.onjava.com/pub/a/onjava/2004/01/07/SQLJoins.html

lyra (lyra), Saturday, 6 November 2004 04:35 (twenty-one years ago)

Oh God, this takes me back - I was writing queries back in Oracle v4 on an IBM mainframe, y'know (my inability to get beyond v7.3 into the OO world pretty much ended my career in software development). I never mastered PL/SQL, but felt a bit more comfortable with ProPascal and ProFortran.

Thank goodness I don't have to worry about this stuff any more.

Michael Jones (MichaelJ), Saturday, 6 November 2004 15:05 (twenty-one years ago)

but Michael, the alleged OO parts of Oracle 8 and 9 are rubbish, and I can't imagine many places use them - I work in an Oracle house, and no one there uses them at all. I like OO much better than the old style, but I wouldn't use the half-arsed Oracle version if I could avoid it.

Martin Skidmore (Martin Skidmore), Saturday, 6 November 2004 17:10 (twenty-one years ago)

I agree... OO simply doesn't fit with relational databases. The "OO" features are purely a marketing gimmic. Pre-relational databases fit better with OO (and obviously OO databases). It's a bit like the XML features they're all currently bolting on to databases.

Keith Watson (kmw), Saturday, 6 November 2004 18:16 (twenty-one years ago)

Yeah, the two are too different to fit together. I remember a lecturer at uni said that 'OO database' was an oxymoron, and he's right - the whole idea of separating off the data is contrary to the fundamental ideas of OO. The first version Oracle released with 'object-relational' features didn't even have inheritance implemented!

Martin Skidmore (Martin Skidmore), Saturday, 6 November 2004 20:13 (twenty-one years ago)

if you do a count and group by the boolean field name you'd end up with two values, a count of the true values and a count of the false ones. just ignore the count for true. would that work?

koogs (koogs), Thursday, 14 July 2005 16:20 (twenty years ago)

I can't seem to attach an IF to a COUNT. I can't see to attach a WHERE to a COUNT.

use HAVING after the group statement.

e.g. HAVING COUNT(1) > 4

mark grout (mark grout), Friday, 15 July 2005 09:21 (twenty years ago)

Ah! That seems like it might work... cool! Thanks, Mark. Will try it on this next report I'm writing.

MIS Information (kate), Friday, 15 July 2005 09:25 (twenty years ago)

Hey, I was about to say HAVING! I wasted eight years of my life being Not Very Good at this stuff...

Michael Jones (MichaelJ), Friday, 15 July 2005 09:29 (twenty years ago)

Hrrmmm. Why can't I do multiple Outer Joins? So long as the left table is always the same, what's the problem?

Stupid Microsoft Query.

MIS Information (kate), Friday, 15 July 2005 09:47 (twenty years ago)

Hey, never mind all that "I was about to say!" I just rescued this thread off the very last entry on "New Answers"!

I wish you could manifest Inner Joins within a left outer. Instead you have to create a view and link to that!

mark grout (mark grout), Friday, 15 July 2005 09:53 (twenty years ago)

If I had some method or admin tools whereby I could create views within the actual database, instead of mucking about with all these crappy Microsoft and Crystal Query builders, none of this would be a problem. :-(

MIS Information (kate), Friday, 15 July 2005 09:57 (twenty years ago)

I just get told "DONT PUT VIEWS IN THE DATABASE, LINK TO Stored Procedures which call the view!"

mark grout (mark grout), Friday, 15 July 2005 10:00 (twenty years ago)

Yeah, I'm being told that now, (with the new system) but bloody hell, this database never has the views I want!

In my oracle database no one else ever goes in there, so I can create all the views I want.

MIS Information (kate), Friday, 15 July 2005 10:15 (twenty years ago)

seven months pass...
I don't think is an SQL question but I need help.

In a nutshell, we've got data for our organisation's contacts and such like hosted remotely on an SQL database. We've made significant changes to it recently, and wanted to upload new tables. To cut a long story short, our data hosts say that their insurance indemnity prevents them from assisting us, which means we can't upload the data we need to upload.

It appears we have two choices, neither of which I'm familiar with how to do:

1) Our database is a SQL Server one, so we need to create a new database in that, then either send our host company the raw datafiles (detached database) or a backup (.bak file) of the contents.

2) Setup a DTS job to import the records directly onto the SQL server from our local server

I'm afraid that I'm utterly stumped on both of these, and need some help. Can anyone advise, or even better, be able to help directly?

Yours hopefully.

Dave B (daveb), Thursday, 23 February 2006 13:29 (twenty years ago)

Detaching/backing up SQL Server databases is VERY EASY, fortunately. All you have to do is open SQL Server Enterprise Manager, connect to the database you want to detach/backup, right-click on it and go through the options under "All Tasks" until you find the backup option or the detach option.

I would give more explicit steps but I'm kind of going off dim memories here and I'm late for work.

Dan (Also Check Google For More Explicit Help: "SQL" "Server" "Detach" "Database, Thursday, 23 February 2006 13:35 (twenty years ago)

Ooh, I had to create a DTS job a bit ago to transfer data from one server to another. It's not *too* hard to do a simple one - if you start up Enterprise Manager, select your server, and go to "Tools -> Data Transformation Services -> Export Data..." it will fire up a wizard to create a new DTS package. You do need to be able to access both database servers from the one copy of Enterprise Manager to do it that way.

The big problem *I* had was that the wizard didn't know how to take account of foreign key relationships. So, the package it created wouldn't run, because it would try to import data into the new tables in the wrong order. The only way to get around it was to use the wizard's output as a starting point, make notes on where it failed, then use the DTS package editor to add dependancy data to the package - "do not copy B until A is complete" and so on. The DTS editor is graphical, so this is a matter of dragging arrows around on the screen.

xpost: as Dan says, detaching and transferring the data file is probably easier for what you're doing.

Forest Pines (ForestPines), Thursday, 23 February 2006 13:41 (twenty years ago)

Argh. I think I explained myself badly. This is wot the situation is:

- We had an access database
- That became an SQL one
- I copied the tables into Excel, did some clean up on them and want to put them back into the SQL databse.

The hosting company said nope, they couldn't write over the old tables with the new ones as their insurance didn't indemnify them for this. This means I have 4 tables in Excel which I want to put back into our SQL database / create a brand new database with. This is what I have no idea how to do - any tips? Better still, would anyone on here be able to do it for me? Happy to pay that special someone...

Dave B (daveb), Thursday, 23 February 2006 14:26 (twenty years ago)

how about copying the old database into a new one altogether (and keep the old one as an archive), clear all the data in the new database and ask company to re-load?

ken c (ken c), Thursday, 23 February 2006 14:41 (twenty years ago)

has the actual structure of the tables changed, too?

ken c (ken c), Thursday, 23 February 2006 14:41 (twenty years ago)

The DTS Import Wizard in Enterprise Manager should let you create a DTS job to import data into the database from Excel files.

Forest Pines (ForestPines), Thursday, 23 February 2006 14:46 (twenty years ago)

Copying data from Excel to SQL Server is v easy with DTS, but then I use DTS all the time.

Just create an Excel connection to the table, and Data Transformation Task to the SQL Server database you want to copy it to, bob's your uncle.

Colonel Poo (Colonel Poo), Thursday, 23 February 2006 14:46 (twenty years ago)

(you just need to select "Microsoft Excel 97-2000" as the data source type)

Forest Pines (ForestPines), Thursday, 23 February 2006 14:47 (twenty years ago)

but the problem is that the hosting company doesn't want a bulk upload over old data no?

ken c (ken c), Thursday, 23 February 2006 14:49 (twenty years ago)

Hmm well I have no idea about hosting companies, this is a new concept to me. Why would you get another company to host your data anyway? Oh well.

Colonel Poo (Colonel Poo), Thursday, 23 February 2006 14:51 (twenty years ago)

i guess it's some kind of data warehouse company that presumably provides better uptime/backup/disaster recovery etc.

ken c (ken c), Thursday, 23 February 2006 14:58 (twenty years ago)

need more info from dave though really

ken c (ken c), Thursday, 23 February 2006 15:00 (twenty years ago)

So, has anyone used the new SSIS (SQL Server 2005 replacement for DTS)? Do existing DTS packages upgrade, or do you have to rebuild them?

Jaq (Jaq), Thursday, 23 February 2006 15:09 (twenty years ago)

Haven't used it yet, but plan to soon as got copy of 2005 coming. I'm leaving this job soon so I need to have a look at 2005 before I leave so I can put it on my CV ;)

Colonel Poo (Colonel Poo), Thursday, 23 February 2006 15:14 (twenty years ago)

Yeah, we are prepping to move to it v. shortly. I've got it installed on my desktop but haven't upgraded anything yet. The import wizard thing is of course seamless on new stuff.

Jaq (Jaq), Thursday, 23 February 2006 15:16 (twenty years ago)

I would like to give you info but I r afraid I do not know.

Can I just create a new set of tables on Enterprise Manager and import the data from excel tables and then point the Access database at those new tables instead, and the leave the old tables there to slowly degrade, accuracy wise?

Dave B (daveb), Thursday, 23 February 2006 15:20 (twenty years ago)

I was with you up until the "point the Access database" part because I've never used Access. Everything else made sense to me.

Dan (Not As Helpful As I Thought) Perry (Dan Perry), Thursday, 23 February 2006 15:23 (twenty years ago)

Dave, is your Access database the front end to entering/modifying stuff in the SQL database?

Jaq (Jaq), Thursday, 23 February 2006 15:25 (twenty years ago)

you should be able to just create the new tables yeah. or even a new database altogether with the same table names etc.

who set up the original tables in the first place?

ken c (ken c), Thursday, 23 February 2006 15:32 (twenty years ago)

Yes - to Jaq's question

To Ken's - it is lost in the mists of time

Dave B (daveb), Thursday, 23 February 2006 15:46 (twenty years ago)

When you add the replacement tables to your database, you might have to re-establish whatever relationships existed to the original tables (if there even were any).

Jaq (Jaq), Thursday, 23 February 2006 15:49 (twenty years ago)

I think you should be able to create new tables in your SQL database, then reroute your Access links to point to the new tables using the Linked Table Manager, or whatever it's called.

Alternatively, do something like what Ken suggested: make new tables with backup copies of the old data, then delete the actual tables' contents and replace with the new data.

Forest Pines (ForestPines), Thursday, 23 February 2006 15:51 (twenty years ago)

one month passes...
Argh! Boring Microsoft Query problem!

OK so I usually use SQL Server 2000 so am not used to dealing with MS Query (in Excel)

How do I use date functions in Query??

I want to do something like this:

SELECT * FROM [TABLE]
WHERE order_date = getdate()

But Query won't accept getdate, now, date, or anything else I can think of. Is it just too fucking shit to deal with date functions? There's nothing in Help about it.

I have a workaround using a parameter, i.e.

SELECT * FROM [TABLE]
WHERE order_date = ?

and then put =today() in a cell on teh Excel sheet and use that as the parameter, but that can't be the best way to do it, surely??

Colonel Poo (Colonel Poo), Tuesday, 4 April 2006 11:51 (twenty years ago)

I don't see any other way, Colonel. MS Query seems to be a very limited subset of SQL.

Jaq (Jaq), Tuesday, 4 April 2006 13:57 (twenty years ago)

NOW()

?

mark grout (mark grout), Wednesday, 5 April 2006 08:46 (twenty years ago)

i need a ruby on rails guy to do a freelance project. anyone anyone?

phil-two (phil-two), Friday, 7 April 2006 21:49 (twenty years ago)

please?

phil-two (phil-two), Friday, 7 April 2006 21:51 (twenty years ago)

CHANGE THREAD TITLE TO "SOL" PWNED

Fight the Real Enemy -- Tasti D-Lite (ex machina), Friday, 7 April 2006 22:11 (twenty years ago)

six months pass...
>> So, has anyone used the new SSIS (SQL Server 2005 replacement for DTS)? Do existing DTS packages upgrade, or do you have to rebuild them?

-- Jaq (js...), February 23rd, 2006 3:09 PM. (Jaq) (link)

I'm now attempting to use it and it's fucking horrible. I didn't have too much trouble using DTS apart from a couple of bugs here and there, but this SUCKS.

It's not even stable. I was copying 700,000 rows from one server to another, and it ended up inserting the data from 500,000 of them into one row. I ended up with a varchar field of length 512,000,000. I've since worked out this happens when the server is running low on memory, so I can't run anything else when an SSIS package is running. Great.

Today I found that the SQL Server Destination object is basically useless, as trying to copy a datetime field from OLE DB Source (also SQL Server) to SQL Server Destination will fail with a type conversion error, even though the source & destination columns are both datetime. You have to use an OLE Destination DB object for it to work.

And apparently the migration tool to upgrade DTS to SSIS is so unreliable even Microsoft have advised not to use it.

ARGH. I know it's a Microsoft product, so I shouldn't be surprised, but this is SO BAD it defies all expectation. I'd rather just write everything in stored procedures than use this, but I don't think my manager will agree unfortunately, so I'm stuck with it :'(

Colonel Poo (Colonel Poo), Tuesday, 10 October 2006 13:37 (nineteen years ago)

five months pass...
Does anyone know how to export images (specifically jpegs) from a varbinary field?

If I do this:

declare @cmd nvarchar(4000)
set @cmd = 'bcp "SELECT TOP 1 Photo FROM dbo.ImageWarehouse" queryout "c:datatest2.jpg" -T -n'

exec xp_cmdshell @cmd


trouble is, BCP doesn't output the data as it is in the bastard table. Instead it adds 4 bytes to the beginning of file (AB 8A 00 00). If I edit the file and remove the offending 4 bytes, it opens as an image. Any idea what's up? I can't see an obvious problem with the BCP command.

Colonel Poo, Monday, 2 April 2007 15:06 (nineteen years ago)

Never mind, extensive googling reveals this to be a bug with BCP. How strange, a Microsoft program that doesn't fucking work properly.

Just in case anyone else has this problem - use TEXTCOPY.exe instead, that does the trick.

Colonel Poo, Monday, 2 April 2007 16:19 (nineteen years ago)

one year passes...

hey so like.. i'm running a website on drupal and somehow ran out of memory on my virtual machine - bringing it to its knees! are there any simple diagnostic tools i can try to see if particular queries are being extra hoggy?

Tracer Hand, Wednesday, 14 January 2009 18:00 (seventeen years ago)

never used drupal but it's a php framework, right? what DB are you running under it? mysql?

i spent WAY too much time today setting up the MySQL-python-1.2.2 lib. I love open source- build, error. google error. fix file. build. get new error. google. fix new error. build. reads config wrong. fix config. build. repeat 3 more times. finally install. 25 minutes down the drain. on the other hand, it's a nice lib once it's running.

lyra, Wednesday, 14 January 2009 22:15 (seventeen years ago)

getting ruby on rails to work with mysql on Leopard was the delightful way I spent my entire day.

akm, Wednesday, 14 January 2009 22:26 (seventeen years ago)

My best is that it's not MySQL going badzooks, Tracer. Use top or a similar tool to track down who's hogging memory at the process level. That'll at least allow you to rule out MySQL.

Carne Meshuggah (libcrypt), Wednesday, 14 January 2009 22:43 (seventeen years ago)

I was trying to re-install mysql because I'd forgotten the root password, and was trying to follow the instructions <a href="http://dev.mysql.com/doc/refman/5.1/en/resetting-permissions.html";>here</a> except that at the step where I'm supposed to enter "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld.exe", something funky happened. Now, every time I boot up my computer, mysqld.exe crashes. I can at least bring up the mysql console, though I can't do anything because I don't have the password. A regular uninstall/reinstall doesn't fix things. Is there a way to unfubar things, or at least start over with a clean uninstall?

Leee, Thursday, 15 January 2009 06:12 (seventeen years ago)

Nuke the database directory. Also, you don't need to reinstall to reset the root password on MySQL.

Carne Meshuggah (libcrypt), Thursday, 15 January 2009 08:07 (seventeen years ago)

Database directory being where Mysql is installed?

Leee, Thursday, 15 January 2009 23:20 (seventeen years ago)

Not necessarily. The directory where all the database files are kept. I don't know where this is on Windows.

Carne Meshuggah (libcrypt), Thursday, 15 January 2009 23:50 (seventeen years ago)

running Mysql on windows is just wrong. but yeah, one of your endless config files should tell you where you have that directory.

lyra, Friday, 16 January 2009 01:37 (seventeen years ago)


You must be logged in to post. Please either login here, or if you are not registered, you may register here.