LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-09-2007, 01:06 PM   #1
knockout_artist
Member
 
Registered: Sep 2005
Distribution: fedora core 9
Posts: 324

Rep: Reputation: 33
mysqldump data base < filename.sql.gz ??


I imported file into mysql.

Quote:

[root@super tmp]# mysqldump kuta < enwiki-20070401-langlinks.sql.gz
-- MySQL dump 10.10
--
-- Host: localhost Database: kuta
-- ------------------------------------------------------
-- Server version 5.0.27

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2007-04-09 15:02:35


I Looked at database
Quote:
[root@super tmp]# mysqlshow
+--------------------+
| Databases |
+--------------------+
| information_schema |
| cacti |
| kuta |
| mysql |
| test |
+--------------------+
[root@super tmp]#
I looked at "kuta"(where I imported the file )
Quote:
[root@super tmp]# mysqlshow kuta
Database: kuta
+--------+
| Tables |
+--------+
+--------+
my question is how do I see what tables did I import in database"kuta"??

Last edited by knockout_artist; 04-09-2007 at 01:09 PM.
 
Old 04-09-2007, 07:23 PM   #2
MoMule
Member
 
Registered: Jul 2006
Posts: 134

Rep: Reputation: 15
I am not a MySQL GURU...

I use the following commands:

mysql> USE mynewdatabase;
mysql> SHOW TABLES;
mysql> DESCRIBE mynewdata;

Try this site.

Deion "Mule" Christopher
 
Old 04-09-2007, 11:08 PM   #3
knockout_artist
Member
 
Registered: Sep 2005
Distribution: fedora core 9
Posts: 324

Original Poster
Rep: Reputation: 33
thank you I am sure that was the command I was looking for.
If any problem I will post agian.

Thanks
 
Old 04-10-2007, 05:22 AM   #4
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
I never knew that mysqldump could be used to import. And it's my guess that it can't; by the looks of the output of the mysqldump command, it indeed dumps and does not import.
I use
Code:
mysql databasename -u username -p < backup.sql
Please note that I have to specify username and password due to my setup (so this might not be necessary for you).

Further your file is a gz file (so compressed/zipped) and that might give some problems as well; I suggest that you first uncompress/unzip it.

Last edited by Wim Sturkenboom; 04-10-2007 at 05:23 AM.
 
Old 04-11-2007, 01:34 PM   #5
knockout_artist
Member
 
Registered: Sep 2005
Distribution: fedora core 9
Posts: 324

Original Poster
Rep: Reputation: 33
Code:
mysql databasename -u username -p < backup.sql
Thank you.
It worked.

One more quetion though
How do see log files in mysql?
Myqls reference say start mysqld with --log filename
I did
Code:
# service mysqld --log /root/log start
Usage: /etc/init.d/mysqld {start|stop|status|condrestart|restart}
===================================================

[root@super ~]# service mysqld --log [root/log] start
Usage: /etc/init.d/mysqld {start|stop|status|condrestart|restart}
===================================================

[root@super ~]# service mysqld --log=root/log start
Usage: /etc/init.d/mysqld {start|stop|status|condrestart|restart}
===================================================

[root@super ~]# service mysqld--log=root/log start
mysqld--log=root/log: unrecognized service
====================================================


[root@super ~]# service mysqld -l /root/log start
Usage: /etc/init.d/mysqld {start|stop|status|condrestart|restart}
====================================================

[root@super ~]# service mysqld -l /root/log condrestart
Usage: /etc/init.d/mysqld {start|stop|status|condrestart|restart}
[root@super ~]#
nothing worked.
Please suggest me a book or document about mysql administration.
I will greatly appreciate it.
I bought/read "high performance mysql" by Jeremy D. Zawodny (Author), Derek J. Balling. I now know how to optimize query etc.
But I still don't feel at home with mysql.

Last edited by knockout_artist; 04-11-2007 at 01:37 PM.
 
Old 04-11-2007, 10:35 PM   #6
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
Your problem in this case is the service command which does not like the arguments that yoy pass it.
The argumants will (probably) work when you start mysqld directly.

I don't use FC so don't know the 'inner' working of the service command. It might call a script called mysqld where you can add the arguments.
Else have a look at the configuration file.
 
Old 04-12-2007, 08:26 AM   #7
MoMule
Member
 
Registered: Jul 2006
Posts: 134

Rep: Reputation: 15
In Mandriva I:

cat /root/.mysql_history

I would check to see if you have that file by default.

Deion "Mule" Christopher
 
Old 04-12-2007, 09:30 AM   #8
knockout_artist
Member
 
Registered: Sep 2005
Distribution: fedora core 9
Posts: 324

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by MoMule
cat /root/.mysql_history

I would check to see if you have that file by default.
yes I do have that file it shows me the commands I have issued using mysql.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Data Base Software Help Ingla Linux - Software 15 03-02-2006 04:19 PM
Data base programmin mola Programming 1 06-05-2005 03:31 AM
Data Base Software sgtbob Linux - Software 2 04-14-2005 05:00 PM
Manage Data Base in c/c++ saint_devil Programming 3 01-03-2005 09:33 AM
RPM data base always becaomes corrupt !!! qwijibow Linux - Software 4 12-01-2003 02:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration