Using PuTTY and mysql

Alright, so I am incredibly new to mysql and command line stuff and I’m trying to feel my way through all of this.

Basically, I’m in the process of converting my invisionfree forum over to SMF, which I am hosting with dreamhost. I received my database dump from IF and am trying to get it uploaded into my database.

I was given the following instructions:

[quote]Be sure you have a freshly installed IPB (v1.3.x) with the default mysql table prefix (ibf_).
Next empty the following tables on the fresh install (again make sure the install is using the prefix ibf_):

or you can use these queries:

DELETE FROM ibf_badwords;
DELETE FROM ibf_posts;
DELETE FROM ibf_calendar_events;
DELETE FROM ibf_categories;
DELETE FROM ibf_contacts;
DELETE FROM ibf_emoticons;
DELETE FROM ibf_forums;
DELETE FROM ibf_groups;
DELETE FROM ibf_members;
DELETE FROM ibf_messages;
DELETE FROM ibf_moderators;
DELETE FROM ibf_polls;
DELETE FROM ibf_stats;
DELETE FROM ibf_titles;
DELETE FROM ibf_topics;
DELETE FROM ibf_tracker;
DELETE FROM ibf_voters;
DELETE FROM ibf_cache_store;
DELETE FROM ibf_forum_perms;
DELETE FROM ibf_topic_mmod;
DELETE FROM ibf_validating;

Then run the queries in the file you downloaded. See[/quote]

I got through most of that until the very end with the link to batch-commands. I downloaded PuTTY and have been trying to use that, but I’m a bit lost. After successfully connecting with my…domain? I tried using the command:

But that just returns the following error: [quote]Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’[/quote]

I have a feeling that I’m in the wrong mode or I was supposed to do something else first which is why I’m having that problem. Help please? I’m kind of clueless.

You are getting that error because MySQL is hosted on a separate server from SSH and Apache. You need to use your MySQL hostname like this.

Where is whatever MySQL domain you added with the DH panel, and dbuser is the name of the MySQL user who has access to the database.

If you need more help, feel free to ask.

Thank you, that worked!

So, I’ve been trying to import that above raw database into the tables, but I keep getting the following error:[quote]ERROR 1136 (21S01) at line 14956: Column count doesn’t match value count at row 1[/quote]

This is line 14956:

I’ve counted and recounted, but I’m pretty sure I have the same number of fields and values, so I’m not really sure what’s up here. :confused:

It was simple enough to convert your INSERT statement into a csv and verify the number of column names and inputs match.

Did a column get added/removed/renamed in the table? Maybe the columns in the table don’t match the columns in the INSERT?

Ah, that was the problem. Everything seems to be good now! Thank you!

I need to use Maria DB from PUTTY. I access this way:

mysql -u username -p databaseName

When I run a query, I get the following:

MariaDB [databaseName]> select * from tableName

When I try to send query results to file, I get this:
MariaDB [databaseName]> select * from tableName INTO OUTFILE order.txt

What do I need to change in the syntax to make it work, please? (THX)

Putty/mysql barfs at my syntax returning generic message for all saying that syntax not correct.

I believe you’re missing the “;” at the end of your SQL commands.

Yes. I am missing the “;”

So, this command now produces a resultset,

MariaDB[databaseName]> select * from tableName;

However, I get the follow error message from the other command,

MariaDB[databaseName]> select * from tableName INTO OUTFILE ‘order.txt’;

Error 1045 (28000): Access denied for user ‘userName’@’%’ (using password: YES)

My the same trouble is good now! Thank you!

Did you tried phpMyAdmin?
It should be less hard for you at least for first time, and you still will able to write SQL requests from scratch.