Koozali.org: home of the SME Server

Contribs.org Forums => General Discussion => Topic started by: jklapp on March 09, 2008, 06:23:05 AM

Title: How to import a mysql database ???
Post by: jklapp on March 09, 2008, 06:23:05 AM
Hi :)

I'm trying to import a database into mysql through phpmyadmin and I'm getting an error "File could not be read" ... Is there another way to import this database?

Thanks :)
Title: Re: How to import a mysql database ???
Post by: brianr on March 09, 2008, 11:13:18 AM
Sounds as if the file is corrupts OR the permission on it are not correct - please give us more information so that we can help you more...
Title: Re: How to import a mysql database ???
Post by: cactus on March 09, 2008, 12:02:25 PM
Hi :)

I'm trying to import a database into mysql through phpmyadmin and I'm getting an error "File could not be read" ... Is there another way to import this database?

Thanks :)
Yes, create the database using the mysqladmin command: http://wiki.contribs.org/MySQL#Create_a_new_database (http://wiki.contribs.org/MySQL#Create_a_new_database) and after that import the database using the following syntax:
Code: [Select]
mysql databasename < /path/to/sql/file
Title: Re: How to import a mysql database ???
Post by: jklapp on March 10, 2008, 01:35:42 AM
Well, here are some details :)

First, I'm a long time windows user and I'm trying to learn SME... So please be forgiving toward my ignorance. :)

The SQL file was exported from a WinNT 4 server running mysql 3.23.53... The database is named sanctuary1... Now on the SME machine, Phpmyadmin says I have ALL PRIVILEGES and GRANT, but I get the error message "File could not be read" when trying to import the SQL file... Maybe the file is unreadable, or maybe there is a permission problem, I don't know.

I would like to upload the SQL file and run it from the SME machine directly, but I'm lost on the path commands... So I need help with what to type in. :)

Here is the location of the SQL file  (/ibays/sanctuary/files/sanctuary1.sql ) If I'm logged in as the "root" what should I type in?

Thanks :)
Title: Re: How to import a mysql database ???
Post by: jklapp on March 10, 2008, 06:59:07 AM
Well, I figured out the path and now I know the problem is the SQL files. :(  One file got an error 1049 (unknown database) and another file got an error 1064 ( a syntax error near 'PK ' at line 1) Does that mean I'm doomed to use only Windows ?? :cry:
Title: Re: How to import a mysql database ???
Post by: brianr on March 10, 2008, 07:45:25 AM
It sounds as though the file may have "windows" end of lines, not suitable for linux.  Get yourself a copy of something like textpad ( on the windows box), and load it up, then re-save it for Linux/Unix.
Title: Re: How to import a mysql database ???
Post by: cactus on March 10, 2008, 09:02:12 AM
Well, I figured out the path and now I know the problem is the SQL files. :(  One file got an error 1049 (unknown database)
You probably did not create the database like I suggested earlier or forgot to specify the database during import. Please re-read my instructions earlier and follow them to the letter. If you do not succeed post the output of the errors here and do not rephrase them.

and another file got an error 1064 ( a syntax error near 'PK ' at line 1) Does that mean I'm doomed to use only Windows ?? :cry:
Again post the error you are reported here to the letter and do not paraphrase, it might be a line ending error but I suspect some illegal syntax in your SQL file.
Title: Re: How to import a mysql database ???
Post by: jklapp on March 11, 2008, 05:11:57 AM
I tried all the above and nothing seemed to work ... But then I logged into each newly created databases directly from mysql and ran this command line ( mysql> \. path/to/sql/file ) each database imported correctly, and I'm happy to report, without any problems. :)

Thank you for your help... I think I'm going to like SME :) ... Now let's see how hard the mail server is to setup. ;)

Title: Re: How to import a mysql database ???
Post by: cactus on March 11, 2008, 08:06:00 AM
and ran this command line ( mysql> \. path/to/sql/file ) each database imported correctly, and I'm happy to report, without any problems. :)
That would mean an export. For an import you need to direct the other way (<) , so I guess you made a typo here.
Title: Re: How to import a mysql database ???
Post by: raem on March 11, 2008, 09:53:42 AM
jklapp

Quote
... Now let's see how hard the mail server is to setup.

It's already set up, just add users and they automatically have email addresses like
user@yourdomain.com
and
user@yourvirtualdomain.com

You can further adjust this by adding specific user@domain email addresses into the Pseudonyms panel
eg
user3@myvirtualdomain1.com forwards to user3

 
Title: Re: How to import a mysql database ???
Post by: jklapp on March 11, 2008, 03:00:42 PM
That would mean an export. For an import you need to direct the other way (<) , so I guess you made a typo here.

No typo... After I logged into the database in mysql, the prompt was "mysql>" and I just typed in "\. path/to/sql/file" :)
Title: Re: How to import a mysql database ???
Post by: jklapp on March 11, 2008, 03:03:58 PM
jklapp

It's already set up, just add users and they automatically have email addresses like
user@yourdomain.com
and
user@yourvirtualdomain.com

You can further adjust this by adding specific user@domain email addresses into the Pseudonyms panel
eg
user3@myvirtualdomain1.com forwards to user3

 

That seems easy enough :) ... Does SME have a SMTP server?
Title: Re: How to import a mysql database ???
Post by: Stefano on March 11, 2008, 05:00:08 PM

The SQL file was exported from a WinNT 4 server running mysql 3.23.53... The database is named sanctuary1... Now on the SME machine, Phpmyadmin says I have ALL PRIVILEGES and GRANT, but I get the error message "File could not be read" when trying to import the SQL file... Maybe the file is unreadable, or maybe there is a permission problem, I don't know.


Hi..

try to look at Heidisql.. is a windows client for mysql..

you can use it to transfer data from a server to another opening 2 connection at the same time..

you can even open the .sql file and import it.

HTH

ciao
Stefano
Title: Re: How to import a mysql database ???
Post by: raem on March 11, 2008, 05:50:53 PM
jklapp

Quote
Does SME have a SMTP server?

Yes.
Have you read the manual(s), linked at the top of these forums, particularly chapter 13
http://wiki.contribs.org/SME_Server:Documentation:Administration_Manual:Chapter13

Title: Re: How to import a mysql database ???
Post by: jklapp on March 11, 2008, 09:22:45 PM
jklapp

Yes.
Have you read the manual(s), linked at the top of these forums, particularly chapter 13
http://wiki.contribs.org/SME_Server:Documentation:Administration_Manual:Chapter13


Read the manuals???  lol ... Now that would make to much sence ;)
Title: Re: How to import a mysql database ???
Post by: jklapp on March 12, 2008, 12:29:26 AM
I'm really liking SME ... I will be very happy the day I turn off the NT Machine... :)

I have a question concerning user passwords (maybe I should have started a new thread for this)

Is there a way to change the way SME does user passwords? (For Example)

[1] I like a short basic password... But when I tried to input one, I got this error...

Quote
The password you provided was not a good password. A good password must contain all of the following: upper case letter, lower case letter, number, non-alphanumeric character, be at least 7 characters long.

[2] Then when I saw the short basic password wasn't going to work, I decided to use my daughter name in the password (NNatalie1!) and I got this error...

Quote
Bad Password Choice: The password you have chosen is not a good choice, because it is based on a dictionary word.

Can this be changed???

Thanks :)
Title: Re: How to import a mysql database ???
Post by: jklapp on March 12, 2008, 01:22:23 AM
This is strange ???

I tried to send a test email through Outlook and I got this error message..

Quote
The message could not be sent because one of the recipients was rejected by the server. The rejected e-mail address was 'jklapp@neo.rr.com'. Subject 'test', Account: 'ignnserver', Server: 'mail.ignn.com', Protocol: SMTP, Server Response: '550 relaying denied jklapp@neo.rr.com', Port: 25, Secure(SSL): No, Server Error: 550, Error Number: 0x800CCC79

I've tried using with and without authentication in Outlook and it makes no difference. :(
Title: Re: How to import a mysql database ???
Post by: jklapp on March 12, 2008, 05:32:40 AM
Ok.. I got Outlook to work... I had to change the Mail Server information in outlook... For some reason the SSL connection only works locally and not with my domain name... The same is true connecting to webmail and server-manager. :(
Title: Re: How to import a mysql database ???
Post by: raem on March 12, 2008, 05:45:53 AM
jklapp

Quote
... For some reason the SSL connection only works locally and not with my domain name...

To prevent relaying, you send via your ISP's smtp server when sending from a remote location.


Quote
Read the manuals???  lol ... Now that would make to much sence

Doesn't seem like you have read them as yet !!!


Quote
The same is true connecting to webmail and server-manager.

Please read the manual, you need to enable external https webmail access in server manager, and you also need to configure server manager access from remote host IP's, also done in server manager.
The default settings only allow both to be accessible from the local network.


Re passwords read the FAQ, password strength section
http://wiki.contribs.org/SME_Server:Documentation:FAQ