aspose file tools*
The moose likes JDBC and the fly likes MySQL - would like to know if it matters. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "MySQL - would like to know if it matters." Watch "MySQL - would like to know if it matters." New topic
Author

MySQL - would like to know if it matters.

tangara goh
Ranch Hand

Joined: Dec 27, 2009
Posts: 125
Dear experts,

Currently, I am forced to learn how to use MySQL because majority of the web hosting company is using it.

My question is that mysql is installed in windows XP but most of the plans are Linux plan.

If I manage to create a database ( I believe I will need to struggle to create it - never learn before, crossing my fingers real hard),
is the database useable with the Linux plan?

OK. Hope to hear some advice here. Many thanks.
Dawn Charangat
Ranch Hand

Joined: Apr 26, 2007
Posts: 249
To start with you can look for some visual MySql front end toold like MySqlFront or HeidiSql. That makes creating databases and tables in MySql a childs play.

Next, moving into your question, whatever you create inside a database server is within the server's jurisdiction, and not the OS's. So you may create as many databases, tables , triggers etc in your windows environment, test it out, and finally when you deploy your app in Linux, just have the same schema replicated in the MySql server on Linux. So long as you have the JDBC URL, username and password correct, I dont think anything can go wrong.
tangara goh
Ranch Hand

Joined: Dec 27, 2009
Posts: 125
OK. Thanks. I will take a look.

BTW, MYSQL keeps giving me a problem. It said "port 3060 already been use" Do you know how to resolve this?


Dawn Charangat
Ranch Hand

Joined: Apr 26, 2007
Posts: 249
You can solve that in 2 ways:

1) While installing MySql, configure the port it runs as something other than 3060.

OR

2) In windows commond prompt, type "netstat -a" (without the quotes) to know which other application is running on 3060, and kill that app or process. then try starting MySql again.

cheers...
tangara goh
Ranch Hand

Joined: Dec 27, 2009
Posts: 125
Thank you for your help. I tried the 1st solution but now I have this problem :-

At the last step where I hit the execution button,

an error message appeared:=

"The security settings could not be applied to the database because the connection has failed with the following error.

Error Number. 1045.

Access denied for user 'root' @ 'locaLhost' (Using password:YES).

Hope you can tell me the resolution for this. Thanks.
Dawn Charangat
Ranch Hand

Joined: Apr 26, 2007
Posts: 249
Are both the MySql server and the front end client running on the same machine ?
If not, then you need to manually give remote access privilege to access the server remotely.
That is one "enhancement" introduced from MySql version 5 onwards.

I can't remember the process top of my head, but it is very simple... can you please google for that ?
Just give the exact error message you got as the google search string.

All the best.
tangara goh
Ranch Hand

Joined: Dec 27, 2009
Posts: 125
ok. i'll do that.

Anyway, I'm now using another machine to create the tables.

But, after finishing typing all my fields etc after the mysql prompt, I do not know how to save the table!

Do you mind just reveal to me the how-to please?

Thanks.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Have you run your insert statements and commited the transaction (if you are using one)?

(Not sure what I'm asking? - have a read here)


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
tangara goh
Ranch Hand

Joined: Dec 27, 2009
Posts: 125
I didn't use Insert. I used CREATE TABLE.

And after I finished, I realised I need to save the table in a database. However, whatever I entered, it doesn't tells me that the table is saved.

I used :

mysql > mysqldump -u tangara -p tangara8 Membership

The above syntax was googled and that guy used Unix but mine run on Windows XP so I'm wondering is the Syntax different?

After that, nothing happened. Could you kindly advise me please?

Or do I have to use INSERT instead of CREATE TABLE ?

Thanks.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

DDL is non-transactional, so once you've finished your SQL statement your table exists.

I'm a bit confused when you mention mysqldump, this is an application for dumping the structure and contents of a database. You would not use it to create tables.
tangara goh
Ranch Hand

Joined: Dec 27, 2009
Posts: 125
OK. I see. Ha ha...I must appear stupid in the eyes of many.

In that case, I'll have to exists MYSQL and retype the whole things all over again is it?

It doesn't make sense but how I can be sure that after I created the table and where can I check that it is already in some kind of repository?

Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Not sure I understand your question. Once you've entered the DDL that creates your table, try selecting from it. If it was successful (which it will have been unless an error is reported) you should be able to do this.
Dawn Charangat
Ranch Hand

Joined: Apr 26, 2007
Posts: 249
Tangara, in MySql, all the DDL statements (statements that create a database, table etc) are automatically committed/saved, the moment you execute them. So in your case, once you execute the CREATE table successfully, without getting any errors, it is automatically saved o your database, you don't have to worry about it. Thats what Paul was trying to convey as well.
tangara goh
Ranch Hand

Joined: Dec 27, 2009
Posts: 125
I am not sure why when I type Show Table followed by the table name, it didn't show up at the command prompt.

Not sure if because I have downloaded the essential version.

And also at the instance configuration during set up, I have chosen non-transactional mode.

Hope to have some advice. Many thanks.
tangara goh
Ranch Hand

Joined: Dec 27, 2009
Posts: 125
Dawn Charangat wrote:To start with you can look for some visual MySql front end toold like MySqlFront or HeidiSql. That makes creating databases and tables in MySql a childs play.



I have downloaded HeidiSql.

The amazing thing is that it automatically converted my "sql" files that I have created using EASY PHP to sql script.

I hope you can advise me the sql script can be sent to the web hosting company now and is acceptable now?

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: MySQL - would like to know if it matters.